You are on page 1of 59

Page 1 of 59

Documentation of Male Map System

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 2 of 59

1) Acknowledgement

This case study is done in order to minimize the time spent on searching for houses in male. Normally searching for a house in male is a very time consuming job. If one had to search a house in male, then one had to look at the male address book and search manually the name of the house. And get the block number and road number of the particular house. After getting that information one had to look at Male map to see the exact location of the house.

The map of male software was created with the help of my lecturers at IBS who helped to solve the various problems in this project.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 3 of 59

2 Contents Index no 1 2 3 4 5 6 6.1 6.2 6.3 6.4 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 8 8.1 8.2 9 9.1 9.2 10 10.1 10.2 11 11.1 11.2 11.3 11.4 11.5 12 13 14 15 16 Description Acknowledgement Contents Introduction Profile of male Map of male The existing system How data stored in existing system Disadvantages in the existing system Possible Solutions Best solution Proposed System Objectives to be achieved Overall plan Feasibility study Fact finding techniques Decision making E-R Diagram Data flow diagram System Specification Hardware Specification Software Specification System development Tables Relationships Forms Coding Validation Testing Black box testing White box testing Unit testing Validation testing System testing Implementation of the new system Future enhancements Review Glossary Reference Page number 2 3 4 5 6 7 8 9 10 10 11 12 13 14 15 16 17 18-23 24 24 24 25 25 27 28-32 33-51 52 52 52 52 52 53-54 55 55 56 56 57 58

3) Introduction
Mohamed Hassan no 23 2nd year project MIDSE552 Batch

Page 4 of 59 Modern business organizations become more and more dependent on their information systems to deal with the complexity and changeability of the context (markets) in which they operate and consequently their internal organization structures. Up-to-date, complete and accurate information has become a necessity to survive in an increasingly competitive world. Developments like mass customization of products and services, and end-to-end process control require automated means to control operational business processes, for the simple reason that humans cannot oversee the entire operation in an efficient and effective way anymore. Consequently, business requirements to information systems increase at a dazzling pace. On the other hand, the rapid developments in information technology give way to application types that simply were not feasible just a few years ago. These developments range from basic computing technology via communication technology and a broad spectrum of data and process management technology to complete frameworks for enterprise information systems and e-business systems.

The case study was done in order to achieve 3 major objectives 1) To study the existing system and find its problems 2) To check the feasibility of the system 3) To propose a better system

4)Profile of Male

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 5 of 59

The capital of Maldives is Male. The city is one of the smallest capitals in the world and is home to nearly one third of the country's population. It is located in the Kaafu Atoll and is the center for all commercial activities of the country. The name Male was taken from the Sanskrit word "mahaalay", meaning "big house". The history of Male goes back as early as 16th century. The Portuguese founded this little town during this time. The entire town is divided into four parts, which are Henveiru, Galolhu, Maafannu and Machangolhi. One of the most densely populated cities of the world, Male is the center for all sorts of government and political activity of the country. Male is a city filled with numerous high rise buildings and sky scrapers. The roads are lined with shops and restaurants. One can find numerous palm trees lining the paved streets of the town. These add to the greenery and to the town's beauty. Male does not have any beaches. It is however, surrounded by a number of seawalls. The city is general is extremely picturesque and exudes a pleasant look. Male, the capital of Maldives is a popular tourist destination. One can find numerous shops and local attractions in this little town. Some of the popular tourist attractions in Male include The Islamic Center, Huskuru Miskyii, Mulee-Aage and the National Museum. One can also find a number of Monuments in Male to visit. Male is a shopper's paradise. There are numerous shops and huge shopping malls from where one can buy numerous articles and gift items. Popular items that one can buy from Male inlcudes apparels, cosmetics, perfumes, jewelerry, watches and various electronic items. The 'thudu kuna', a traditional Maldivian mat , is a popular souvenir that one can buy from here. The Majeedhee Magu, is one of the most important shopping streets of male where one can find numerous roadside shops over here selling almost everyhting that one can possibly think of. Chaandhanee Magu is the best palce to buy souvenirs and other traditional gift items. For marketing, one can check out the fish market and the local market. There are numerous hotels and restaurants in this city where one can wine and dine in a relaxed manner. Both continental and intercontinental as well as local dishes are available in these hotels. Major eating outlets in the city inlcude City Motel, Classic Inn, Extra Heaven and Aquatic Residency. Being a very small city, moving around is not at all difficult. One can walk or go for a taxi ride also. One can find numerous air-conditioned taxis over here. Reaching Male, the capital of Maldives is not at all difficult. Nearly all the major international airlines have flights to the Male International Airport. One can take a flight from the city of your departure and fly to Male. However, the airport is separated from the main city by an ocean. Hence, one has to take ferry ride from the airport to the city mainland. The capital of Maldives is indeed one of the most beautiful looking cities of the world.

5) The map of male 2nd year project

Mohamed Hassan no 23

MIDSE552

Batch

Page 6 of 59

6) The existing system initial investigation

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 7 of 59

A printed version of Male map is hung on a wall. The maps dimensions are 5 feet by 4 feet. The map shows all the roads, address, and block numbers as shown below. An excel sheet contains all the house names alphabetically arranged with corresponding block numbers, ward names and road names. The excel sheet is searched to note down the road name, block number, ward name and house name to locate the house on male map. Once all that information is noted a person goes to the hung map of male. And searches for the block number on the map which matches the block number noted. For example in order to find location of meerubahuruge. The excel sheets address column had to be searched manually for meerubahuruge. When meerubahuruge is found the corresponding block number is 66. And the corresponding road is Ameeru Ahmeed Magu and the ward is Heinveiru. When this information is got from excel sheet the male map is again searched for block number 66. The block number had 4 sides. And the 4 sides will have four roads. So the side corresponding to Ameeru Ahmed Magu is looked on which meerubahuruge will be located on male map.

6.1) How Data are stored in existing system 2nd year project

Mohamed Hassan no 23

MIDSE552

Batch

Page 8 of 59

In the existing system addresses of male are recorded in an excel sheet. Below is a screen shot of the excel sheet. The fields are in Dhivehi language so an English version of the same table is prorived.

Serial number 1

House name Meerubahurug e

Road name Kalaafaanu higun

Block number 123

Ward Maafannu

In the excel sheet searching of a house is done manually since the records are entered in Dhivehi language and xp Dhivehi font faruma is not used in the excel. The house names arranged alphabetically.

6.2) Disadvantages of existing system The following disadvantages are noted in the existing system Mohamed Hassan no 23 2nd year project MIDSE552 Batch

Page 9 of 59

The excel sheet has repeated road names, ward names Have to manually search houses Have to note down block number, road name, ward name in order to locate a house on male map The male Map is hung on a wall in a separate place. So have to go the place where map is hung and look the map for a particular house by standing near the map. Time consuming to search a particular address Accidentally delete or alter the excel sheet data. The Map is printed on canvas so recent houses are not marked or shown on the map. The Male map can only be viewed by one person at a time.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 10 of 59

6.3 Possible Solution The solution to the problem are given below 1) Buy more male maps and male address books Every person who had to search a particular address should be given a male Map and a male address book. But Male map costs 3,000/- Maldivian rufiyaa for only one map. The cost of male address book is 100/- Maldivian rufiyaa. So a total cost of 3,100/- should be spent on every employee who needs to look up places in male. So that much spending for a Male Map and Male address book is not worth the cost. So buying is more maps and more Male address books is not an option 2) Leave the male address book in a place where everyone can see. But that also means the Male address book maybe lost or misplaced, so when the need arise to lookup an address from male address book the book may not be available. So that is also not an option.

3) Buy male map software Unfortunately male map software is not available for sale nor is it available to be used on standalone machines or workstations. But some websites provide male map software to be used as an online application. That means if no internet connection is available then male map software cant be used.

6.4 Best solution 1) Make a male Map program or software Since I have to do a 2 nd year project to complete my diploma in software engineering, making a map software for male is the best solution. Since I am the programmer no programmers are needed to program the male map software. I will be doing it free of cost for my own experience and to broaden my own knowledge.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 11 of 59

7 Proposed System The proposed system will be developed by using visual basic.net 2008 as front end. And Microsoft access 2007 as back end. Visual basic.net 2008 will be used to create all the GUI and the menu, reports etc. Visual basic.net 2008 is a programming language developed by Microsoft. Microsoft Access 2007 is a relational database management supplied with Microsoft Office 2007.

In the existing system road names, ward names are repeated many times. So in the proposed system care is taken in order to reduce the redundancy in the database. The database tables are put into 2 nd normal form so redundancy is reduced. The proposed system can only be used by authorized persons. Searching for a particular house can be done easily. As soon as the searching for a house is completed the location of the particular house will be shown as image file. The proposed system can automatically generate reports for all houses in male. And it can generate reports for all nearby house name, road names, blocks numbers , ward names for a given houses. It can also generate login reports for a particular user. This will help to discover the user who deleted database rows and which user shares their user names and passwords with others.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 12 of 59

7.1 Objectives to be achieved The proposed system will have the following objectives. 1) Search a house by enter house name 2) Once a house is searched automatically show the location of the house or place 3) Zoom in zoom out features in map 4) Panning feature in map 5) The male map will only be used by selected users 6) Login times of the users should be noted 7) Automatically generate reports showing all the houses in male 8) Automatically generating all nearby house names, road names by entering house name 9) Automatically generate login reports for a particular user

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 13 of 59

7.2 Overall plan # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Description Acknowledgement Contents Introduction Profile of male Map of male The existing system initial investigation How Data are stored in existing system Disadvantages of the existing system Possible solution Best solution Proposed System Objectives to be achieved Overall plan Feasibility study Fact finding techniques Decision making E-R Diagrams Data flow diagrams System specification Hardware specification Software specification Data tables Relationships Forms Coding Validation Testing Black box testing White box testing Unit testing System Testing Implementation of the new system Future enhancements Review Glossary Reference duration 30 mins 30 mins 30 mins 1 hour 15 mins 1 day 8 hours 4 hours 3 hours 2 hours 1 hour 30 mins 45 mins 3 hours 3 hours 3 hours 2 hours 4 days 30 mins 30 mins 30 mins 3 hours 30 mins 3 hours 10 days 1 hour 1 hour 1 hour 1 hour 1 hour 1 hour 30 mins 1 hours 1 hour 1 hour 1 hour

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 14 of 59

7.3 Feasibility Study After doing a case study a feasibility study is done to check whether the developed system can be implemented or not. In feasibility study the following are considered
a) Technical feasibility In technical feasibility the following issues are taken into consideration.

Whether the required technology is available or not Whether the required resources are available Manpower- programmers, testers & debuggers Software and hardware

Since no programmers, required technology is available, no hardware and software is needed for implementation of this software the project is technically feasible. b) Economic Feasibility For any system if the expected benefits equal or exceed the expected costs, the system can be judged to be economically feasible. In economic feasibility, cost benefit analysis is done in which expected costs and benefits are evaluated. Economic analysis is used for evaluating the effectiveness of the proposed system. In economic feasibility, the most important is cost-benefit analysis. As the name suggests, it is an analysis of the costs to be incurred in the system and benefits derivable out of the system. Since I am developing the software on my own, no costs are necessary. Hence the project is economically feasible. c) Operational Feasibility Operational feasibility is mainly concerned with issues like whether the system will be used if it is developed and implemented. Whether there will be resistance from users that will effect the possible application benefits? The essential questions that help in testing the operational feasibility of a system are following.

Does management support the project? Are the users not happy with current business practices? Will it reduce the time (operation) considerably? If yes, then they will welcome the change and the new system. Have the users been involved in the planning and development of the project? Early involvement reduces the probability of resistance towards the new system.

The management of most restaurants, Pickup and car centers management need to have Map software as their staff have to find places in male very often. And in the existing system if the person who have the male address book doesnt come to office then there is no way to find an address. The end users are very frustrated with the existing system. So they want a better system for locating places in male. So Mohamed Hassan no 23 2nd year project MIDSE552 Batch

Page 15 of 59

management and end users are willing to use the male map software. Hence the project is operationally feasible. 7.4 Fact finding techniques The fact finding technique which I used is interviews. The following questions are put to 2 persons to know the weakness of the existing system. The 2 persons gave almost same answer to 2 questions. 1) What do you feel about the existing system? Ahmed: the existing system has many drawbacks. Namely the male address excel sheet had to be consulted and each house had to be searched manually one by one till required house wanted houses house name, road name, block number and ward number is found. After that all related data are noted and then have to go and check the actual map of male which will be hung on a wall in some other place. The map had to be searched by standing next to it. This consumes time. So its a burden to us. 2) What are features should be included in the new Map software? Ahmed: The map software should have house searching features. Once the house is searched it should automatically show the exact location of the place on Male map software.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 16 of 59

7.5 Decision making Decision making is an integral part of any business. I am going to use decision tree to represent various decision making in this project. Login

Houses add

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 17 of 59

7.6 E.R Diagram

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 18 of 59

7.7 DFD
Context level of Male Map System (MMS)

1st level DFD of MMS

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 19 of 59

0th Level DFD for login

1st level DFD for login

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 20 of 59

2nd Level DFD for login

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 21 of 59

0th level DFD for House

1st Level DFD for Houses

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 22 of 59

2nd level DFD for Houses

0th level DFD for reports

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 23 of 59

1st level DFD for reports

2nd level DFD for report

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 24 of 59

8. System Specification

System specification is the configuration needed to run the developed system. It consists of hardware and software specifications.

8.1Hardware specificationv RAM CPU Hard disk Display Keyboard Mouse Printer 1GB Inter Pentium 4 1Ghz or higher 40 GB On board 64Mb or Video card higher than 64Mb Qwerty keyboard USB mouse A Color printer or black and white printer

8.2 Software Specification Operating system Programming language Relational Database management system Below is a brief definition of the softwares. Operating system- The software used to control all the hardware and software of the computer Visual Basic.net 2008 A programming language developed by Microsoft for rapid application development. Microsoft Access 2007 A relational database management system which comes bundled with Microsoft office 2007. Windows xp professional or windows 7 Visual basic.net 2008 Microsoft Access 2007

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 25 of 59

9. System Development 9.1 Tables Table name: Houses

This table holds all the house numbers, road names, road numbers, block numbers, ward numbers. House_no will be used to fetch all the details corresponding to a particular house_no.

Table name: blocks

This table holds blocks numbers and corresponding images. Column pic holds the path to the image file. The block_no will uniquely identify the image for a particular block. Block_no will later be used to fetch the image of a particular block.

Table name: wards

This table holds ward names and ward number. Ward number is a unique id given to particular ward name. This ward number will later be used to fetch needed ward names.

Table Name: roads

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 26 of 59

This table holds road numbers, road names and corresponding block numbers. Road_no is is unique number given to a particular road. The road number will later be used to fetch the road name. Table name: users Column name user_name user_password User_level Data type Text text text

This table holds all user details. In this table user_name is unique. User_name will be used later to fetch all user details.

Table name: login_details Column name user_name Time Data type Text Date/time

This table is used to hold all login times for a particular user. In this table time is unique field. Because users may login many times, so user name cant be a unique id. If user name is unique then login date and time can only be recorded only once. And the previous record will be over written.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 27 of 59

9.2 Relationships The house table is linked to roads table by using road number which is the primary key for road table. The house table contains road number which is the foreign key in houses table. The house table is linked with blocks table by using block_no which is the primary key in blocks table. The house table is linked with wards table by using ward_no which is the primary key in wards table.

Users Login details User_name User_name User_passwo Login_time rd User_level

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 28 of 59

10. Forms Progressbar

This is the first screen that will come up when the male map exe is clicked. This form will show the loading percentage and visual loading progressbar.

Login form

After the splash screen login form is shown. If a correct user name and password is supplied then only the system will be used.

Mdi parent form If the login user name and password is correct then the MDI parent form is shown. This form contains all the menus that can be accessible to a user or Administrator. Note user menu and will only be activated if an Administrator is logged to the system.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 29 of 59

Add houses form

This form will be shown once a user presses add house menu. This form is used to add new houses to the houses table. If a house name that is already in database is entered into form then that house will not be inserted to the database. And will display a message house already in database. Delete houses This form will be shown if the user presses the delete menu from houses. This form is used to delete house details from house table. The search text have to filled to search a particular house then the datagrid displays the details for that house. And when delete button is pressed the house details are deleted

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 30 of 59

Update houses

This form is shown if the user presses update menu from houses in main menu. The text box should be filled with a house name to edit that particular house details. Once a house name is entered to the textbox the particular or likely house details are shown in the datagrid. From the datagrid click the desired house name and that particular house details are transferred to textboxes. After editing the necessary details click update to update the house details.

Search house.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 31 of 59

This form is shown if the user presses the search house from main menus houses. This form is used to search a particular house in male. Once the desired house name is entered a suggested list of house names are shown below the textbox. Once the desired house name is selected from list box that particular house location is shown (exact map image is shown)

All houses report This form is shown if all houses is pressed from report menu in main menu.This form is used to show a report for all the houses in male.

Nearby houses This form is used to generate a report to include all nearby house names, roads, block no, and road names of a particular house.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 32 of 59

Login details

This form is used to generate a report for all the login times of a particular user. The user name should be supplied to generate the report.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 33 of 59

10.1. Coding Loading screen form


Dim i, j As Integer PictureBox1.Visible = True PictureBox2.Visible = True PictureBox1.Width = i PictureBox2.Width = i i=i+2 j=j+1 Label2.Text = j & " %" If j = 100 Then Timer1.Stop() Me.Hide() LoginForm1.Show() End If

Login form
Public Class LoginForm1 Dim dt, dt2 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Dim fuser, fpword, duser, dpword, duser_level As String Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click If TextBox1.Text = "" Then MsgBox("Enter User name") ElseIf PasswordTextBox.Text = "" Then MsgBox("Enter password") ElseIf IsNumeric(TextBox1.Text) And TextBox1.Text <> "" Then MsgBox("User name should be text.Numbers are not allowed") ElseIf IsNumeric(PasswordTextBox.Text) And PasswordTextBox.Text <> "" Then MsgBox("Password should be text.Numbers are not allowed") Else ' fuser is entered user name in form 'fpword is enter password in the form 'duser name and dpassword is database user name and password fuser = TextBox1.Text fpword = PasswordTextBox.Text connect() conn.Open() comm.CommandText = "select * from users where user_name='" & TextBox1.Text & "'" comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) duser = dt.Rows(0).Item(0) dpword = dt.Rows(0).Item(1) duser_level = dt.Rows(0).Item(2)

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 34 of 59 conn.Close() If fuser = duser Then If fpword = dpword Then MsgBox("Login successful.Welcome " & fuser) ' if successfully logged in then insert user name and login time to login time table connect() conn.Open() comm.CommandText = "insert into login_time values('" & fuser & "','" & Date.Now & "')" comm.Connection = conn comm.ExecuteNonQuery() conn.Close() MDIParent1.Show() If duser_level = "Administrator" Then MDIParent1.UsersToolStripMenuItem.Enabled = True Else MDIParent1.UsersToolStripMenuItem.Enabled = False End If Me.Hide() Else MsgBox("Invalid password") End If Else MsgBox("Invalid user name") End If End If End Sub Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click TextBox1.Text = "" PasswordTextBox.Text = "" End Sub End Class

MDI parent form


Imports System.Windows.Forms Public Class MDIParent1 Dim dt2 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form4.Show() End Sub Private Sub AllHouseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Report_all_houses.Show() End Sub Private Sub AHouseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Report_nearby_houses.Show()

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 35 of 59 End Sub Private Sub LoginDetailsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Report_login.Show() End Sub Private Sub DeleteToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form3.Show() Form3.Button1.Text = "Delete" Form3.GroupBox1.Text = "Search a house to delete and then click the desired house to delete" Form3.GroupBox2.Text = "Do you really want to delete the house" Form3.TextBox2.Enabled = False Form3.TextBox3.Enabled = False Form3.TextBox4.Enabled = False Form3.ComboBox1.Enabled = False End Sub Private Sub UpdateToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form3.Show() Form3.Button1.Text = "Update" Form3.GroupBox1.Text = "Search a house and then click the house details to update" Form3.GroupBox2.Text = "Update House details" End Sub Private Sub SearchToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form1.Show() End Sub Private Sub AddToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) user_add.Show() End Sub Private Sub EditUpdateToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) user_edit_delete.Show() End Sub Private Sub AddToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Form2.Show() End Sub Private Sub AddToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem.Click Form2.Show() End Sub Private Sub DeleteToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click Form3.Show() Form3.Button1.Text = "Delete" Form3.TextBox2.Enabled = False Form3.TextBox3.Enabled = False Form3.TextBox4.Enabled = False Form3.TextBox5.Enabled = False

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 36 of 59 Form3.GroupBox2.Text = "Select house details then click delete" End Sub Private Sub UpdateToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateToolStripMenuItem.Click Form3.Show() Form3.Button1.Text = "Update" Form3.GroupBox2.Text = "Select house details then click Update" End Sub Private Sub AddToolStripMenuItem1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddToolStripMenuItem1.Click user_add.Show() End Sub Private Sub UpdateDeleteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateDeleteToolStripMenuItem.Click user_edit_delete.Show() End Sub Private Sub AllHousesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AllHousesToolStripMenuItem.Click Report_all_houses.Show() End Sub Private Sub NearbyHouseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NearbyHouseToolStripMenuItem.Click Report_nearby_houses.Show() End Sub Private Sub LoginDetailsToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginDetailsToolStripMenuItem.Click Report_login.Show() End Sub Private Sub SearchToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SearchToolStripMenuItem.Click Form1.Show() End Sub End Class

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 37 of 59

Add Houses form


Dim i2, froadnumber, fwardnumber As Integer Dim comm As New OleDb.OleDbCommand Dim dt, dt2, dt3, dt4, dt5 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Public froad_no, fblock_no, fward_no, fhouse_no As Integer Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox4.Visible = False ListBox1.Visible = False ListBox2.Visible = False connect() conn.Open() comm.CommandText = "select * from wards" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) Dim i As Integer For i = 0 To dt.Rows.Count - 1 ComboBox1.Items.Add(dt.Rows(i).Item(1)) Next conn.Close() End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox1.Text = ListBox1.SelectedItem ListBox1.Visible = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "" Then MsgBox("Fill House name") ElseIf IsNumeric(TextBox1.Text) Then MsgBox("House name field will not accept numbers") ElseIf TextBox2.Text = "" Then MsgBox("Fill road name") ElseIf IsNumeric(TextBox2.Text) Then MsgBox("road name field will not accept numbers") ElseIf ListBox2.SelectedItem = "" Then MsgBox("Select road name from the list") 'ListBox2.SelectedIndex = -1 ElseIf Not IsNumeric(TextBox3.Text) Then MsgBox("Block number fiedl will accept only numbers") ElseIf TextBox3.Text = 0 Or TextBox3.Text >= 407 Then MsgBox("road number should be between 1 and 406") ElseIf ComboBox1.SelectedItem = "" Then MsgBox("Select a ward") ElseIf TextBox4.Text = "" Then MsgBox("Fill road name") TextBox4.Visible = False

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 38 of 59 TextBox2.Visible = True Else ' connect to database and check whether entered house is present or not dt2.Clear() connect() conn.Open() comm.CommandText = "select * from houses where house_name = '" & TextBox1.Text & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2) conn.Close() If dt2.Rows.Count > 0 Then MsgBox("The house name is already present.Write a diffent house name") Else ' Connect to houses table and get the last road_no and increment road_no by 1 dt4.Clear() connect() conn.Open() comm.CommandText = "select * from houses" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt4) Dim rowcount, newhouse_no As Integer rowcount = dt4.Rows.Count newhouse_no = rowcount + 1 conn.Close() 'If the house isn't present then Add the details to houses name table connect() conn.Open() comm.CommandText = "insert into houses values(" & newhouse_no & ",'" & TextBox1.Text & "'," & froad_no & ", " & TextBox3.Text & ", " & fward_no & " )" comm.CommandType = CommandType.Text comm.Connection = conn comm.ExecuteNonQuery() MsgBox("House added") conn.Close() TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" ListBox1.Items.Clear() ListBox2.Items.Clear() ListBox1.Visible = False ListBox2.Visible = False TextBox4.Visible = False TextBox2.Visible = True ComboBox1.Text = "Select ward name" End If conn.Close() End If conn.Close() End Sub

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 39 of 59

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged dt2.Clear() ListBox1.Items.Clear() ListBox1.Visible = True connect() conn.Open() comm.CommandText = "select * from houses where house_name like '" & TextBox1.Text & "%" & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2) Dim i As Integer If dt2.Rows.Count = 0 Then ListBox1.Visible = False Else For i = 0 To dt2.Rows.Count - 1 ListBox1.Items.Add(dt2.Rows(i).Item(1)) Next End If conn.Close() End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged dt3.Clear() ListBox2.Visible = True ListBox2.Items.Clear() connect() conn.Open() comm.CommandText = "select * from roads where road_name like '" & TextBox2.Text & "%" & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) Dim i As Integer For i = 0 To dt3.Rows.Count - 1 ListBox2.Items.Add(dt3.Rows(i).Item(1)) Next froad_no = dt3.Rows(0).Item(0) conn.Close() End Sub Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged TextBox2.Visible = False TextBox4.Visible = True TextBox4.Enabled = False TextBox4.Text = ListBox2.SelectedItem ListBox2.Visible = False End Sub

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 40 of 59 Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If ComboBox1.SelectedItem = "Maafannu" Then fward_no = 1 ElseIf ComboBox1.SelectedItem = "Heinveiru" Then fward_no = 2 ElseIf ComboBox1.SelectedItem = "Galholhu" Then fward_no = 3 ElseIf ComboBox1.SelectedItem = "Manchangolhi" Then fward_no = 4 End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" ListBox1.Items.Clear() ListBox2.Items.Clear() TextBox4.Visible = False TextBox2.Visible = True ComboBox1.Text = "Select ward name" End Sub Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged End Sub End Class

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 41 of 59

Delete or update houses form


Public Class Form3 Dim dt, dt2, dt3, dt4, dt5, dt6, dt7 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Dim fhouse_no, froad_no, fblock_no, fward_no As Integer Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged dt.Clear() Check House name is empty If TextBox1.Text = "" Then MsgBox("Enter a house name") Else Display matching houses connect() conn.Open() comm.CommandText = "select * from houses where house_name like '" & TextBox1.Text & "%" & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) If dt.Rows.Count = 0 Then If no records are found do nothing Else DataGridView1.DataSource = dt fhouse_no = dt.Rows(0).Item(0) froad_no = dt.Rows(0).Item(2) fblock_no = dt.Rows(0).Item(3) fward_no = dt.Rows(0).Item(4) End If End If conn.Close() End Sub Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ListBox1.Visible = False GroupBox2.Visible = False TextBox5.Visible = False connect() conn.Open() comm.CommandText = "select * from wards" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2) Dim i As Integer For i = 0 To dt2.Rows.Count - 1 ComboBox1.Items.Add(dt2.Rows(i).Item(1)) Next conn.Close() End Sub Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Button1.Text = "Update" Then

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 42 of 59
' If button text is update then do the editing part 'Checking whether all the textboxes are filled or in correct format If TextBox4.Text = "" Then MsgBox("Enter House name") ElseIf IsNumeric(TextBox2.Text) Then MsgBox("Road can't accept numbers") ElseIf (TextBox5.Text = "") Then MsgBox("Select road from list") ElseIf TextBox3.Text = "" Then MsgBox("Enter block number") ElseIf TextBox3.Text = 0 Or TextBox3.Text >= 407 Then MsgBox("Only block numbers between 1 and 407 are accepted") ElseIf ComboBox1.SelectedItem = "" Then MsgBox("Select Ward Name") ElseIf TextBox5.Text = "" Then TextBox2.Visible = True TextBox4.Visible = False Else 'connect to the database and update the record in database connect() conn.Open() comm.CommandText = "update houses set house_name='" & TextBox4.Text & "',road_no=" & froad_no & ",block_no=" & TextBox3.Text & ",ward_no=" & fward_no & " where house_no=" & fhouse_no & "" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt6) conn.Close() MsgBox("house updated") conn.Close() TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" ComboBox1.Text = "select ward name" GroupBox2.Visible = False gridvalues() End If Check Mdi parent clicked menu. ElseIf Button1.Text = "Delete" Then dt4.Clear() connect() conn.Open() comm.CommandText = "delete from houses where house_no=" & fhouse_no & "" comm.CommandType = CommandType.Text adp.SelectCommand = comm adp.Fill(dt4) MsgBox("House deleted") conn.Close() GroupBox2.Visible = False gridvalues() End If End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged dt3.Clear() ListBox1.Visible = True ListBox1.Items.Clear() conn.Close()

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 43 of 59
connect() conn.Open() comm.CommandText = "select * from roads where road_name like '" & TextBox2.Text & "%" & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) Dim j As Integer For j = 0 To dt3.Rows.Count - 1 ListBox1.Items.Add(dt3.Rows(j).Item(1)) Next conn.Close() End Sub Private Sub ListBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox5.Visible = True TextBox2.Visible = False TextBox5.Text = ListBox1.SelectedItem froad_no = dt3.Rows(0).Item(0) ListBox1.Visible = False End Sub Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick GroupBox2.Visible = True ListBox1.Visible = False Label1.Visible = False TextBox5.Visible = True TextBox2.Visible = False ListBox1.Items.Clear() fhouse_no = dt.Rows(DataGridView1.CurrentRow.Index).Item(0) TextBox4.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(1) froad_no = dt.Rows(DataGridView1.CurrentRow.Index).Item(2) TextBox3.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(3) fblock_no = dt.Rows(DataGridView1.CurrentRow.Index).Item(3) ComboBox1.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(4) dt5.Clear() connect() conn.Open() comm.CommandText = "select * from roads where road_no=" & froad_no & "" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt5) conn.Close() TextBox5.Text = dt5.Rows(0).Item(1) End Sub Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If ComboBox1.SelectedItem = "Maafannu" Then fward_no = 1 ElseIf ComboBox1.SelectedItem = "Heinveiru" Then fward_no = 2 ElseIf ComboBox1.SelectedItem = "Galholhu" Then fward_no = 3

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 44 of 59
ElseIf ComboBox1.SelectedItem = "Manchangolhi" Then fward_no = 4 End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Public Sub gridvalues() dt7.Clear() connect() conn.Open() comm.CommandText = "select * from houses where house_no=" & fhouse_no & "" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt7) DataGridView1.DataSource = dt7 conn.Close() End Sub Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged If TextBox5.Text = "" Then TextBox5.Visible = False TextBox2.Visible = True End If End Sub End Class

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 45 of 59

Search House form


Public Class Form1 Dim i, i2 As Integer Dim comm As New OleDb.OleDbCommand Dim dt, dt2, dt3, dt4 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Public froad_no, fblock_no, fward_no, fhouse_no As Integer Public selectedhouse As String

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ListBox1.Visible = False GroupBox1.Visible = False GroupBox2.Visible = False Label1.Visible = False Label2.Visible = False Label3.Visible = False Label4.Visible = False End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Set picture width to 20% more set picture height to 20% more Me.PictureBox1.Width += 20% Me.PictureBox1.Height += 20% End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Set picture width to 20% less set picture height to 20% less Me.PictureBox1.Width -= 20% Me.PictureBox1.Height -= 20% End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) dt3.Clear() connect() conn.Open() comm.CommandText = "select * from blocks where block_no=" & TextBox1.Text & " " comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) conn.Close() End Sub Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) End Sub

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 46 of 59 Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged 'Fetch all the records from the houses table and display only house names beginning with the search letter or word only in the listbox ListBox1.Visible = True ListBox1.Items.Clear() dt.Clear() connect() conn.Open() comm.CommandText = "select * from houses where house_name like '" & TextBox1.Text & "%" & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) Dim i As Integer For i = 0 To dt.Rows.Count - 1 ListBox1.Items.Add(dt.Rows(i).Item(1)) Next conn.Close() End Sub Private Sub ListBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged Label1.Text = "" GroupBox1.Visible = True GroupBox2.Visible = True 'get the selected listbox house name and store it in a variable called selectedhouse selectedhouse = ListBox1.SelectedItem 'fetch only the selected house and its correspoinding values from the listbox dt2.Clear() connect() conn.Open() comm.CommandText = "select * from houses where house_name = '" & selectedhouse & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2) conn.Close() Label1.Text = dt2.Rows(0).Item(0) Label2.Text = dt2.Rows(0).Item(2) Label3.Text = dt2.Rows(0).Item(3) Label4.Text = dt2.Rows(0).Item(4) dt4.Clear() connect() conn.Open() get house name, road name, ward name block number and display in label boxes comm.CommandText = "select distinct house_name,road_name,ward_name,houses.block_no from houses,roads,wards,blocks where houses.house_no=" & Label1.Text & " and wards.ward_no=" & Label4.Text & " and roads.road_no=" & Label2.Text & " and houses.block_no=" & Label3.Text & " " comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt4) conn.Close()

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 47 of 59 Label3.Text = dt4.Rows(0).Item(3) Label11.Text = dt4.Rows(0).Item(0) Label12.Text = dt4.Rows(0).Item(1) Label13.Text = dt4.Rows(0).Item(2) Label14.Text = dt4.Rows(0).Item(3) display image of the map by using the block number displayed in label3 dt3.Clear() connect() conn.Open() comm.CommandText = "select * from blocks where block_no=" & Label3.Text & " " comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) PictureBox1.Image = Image.FromFile(dt3.Rows(0).Item(1)) Me.PictureBox1.Size = Me.PictureBox1.Image.Size conn.Close() End Sub End Class

Add users form


Dim comm As New OleDb.OleDbCommand Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ComboBox1.Items.Add("Administrator") ComboBox1.Items.Add("user") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text = "" Then MsgBox("Enter user name") ElseIf IsNumeric(TextBox1.Text) Then MsgBox("user name willn't accept numbers") ElseIf TextBox2.Text = "" Then MsgBox("Enter Password") ElseIf IsNumeric(TextBox2.Text) Then MsgBox("Password's first character should be a letter") ElseIf ComboBox1.SelectedItem = "" Then MsgBox("Select user level") Else connect() conn.Open() comm.CommandText = "insert into users values('" & TextBox1.Text & "', '" & TextBox2.Text & "','" & ComboBox1.SelectedItem & "')" comm.Connection = conn comm.ExecuteNonQuery() MsgBox("record added") TextBox1.Text = "" TextBox2.Text = ""

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 48 of 59 ComboBox1.Text = "Select user level" conn.Close() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" ComboBox1.Text = "Select user level" End Sub End Class

Edit users or delete form


Dim dt, dt2, dt3, dt4 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged dt.Clear() connect() conn.Open() comm.CommandText = "select * from users where user_name like '" & TextBox1.Text & "%" & "'" comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) DataGridView1.DataSource = dt conn.Close() End Sub Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick End Sub Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GroupBox2.Visible = False ComboBox1.Items.Add("Administrator") ComboBox1.Items.Add("User") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim fusername As String If dt.Rows.Count = 0 Then MsgBox("Search user to delete then press delete") Else fusername = dt.Rows(DataGridView1.CurrentRow.Index).Item(0) connect()

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 49 of 59 conn.Open() comm.CommandText = "delete * from users where user_name='" & fusername & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt4) MsgBox("user deleted") conn.Close() gridvalues() End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox3.Enabled = False If dt.Rows.Count = 0 Then MsgBox("Search a user and then Click user details") GroupBox2.Visible = False Else GroupBox2.Visible = True TextBox3.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(0) TextBox2.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(1) ComboBox1.Text = dt.Rows(DataGridView1.CurrentRow.Index).Item(2) End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click connect() conn.Open() comm.CommandText = "update users set user_password='" & TextBox2.Text & "', user_level='" & ComboBox1.Text & "' where user_name='" & TextBox3.Text & "'" comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) MsgBox("user updated") conn.Close() dt.Clear() GroupBox2.Visible = False gridvalues() End Sub Public Sub gridvalues() dt2.Clear() connect() conn.Open() comm.CommandText = "select * from users " comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2)

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 50 of 59 DataGridView1.DataSource = dt2 conn.Close() End Sub End Class

Login date and time report for users


Dim dt As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dt.Clear() If TextBox1.Text = "" Then MsgBox("Enter a house Name") ElseIf IsNumeric(TextBox1.Text) Then MsgBox("Numbers are not accepted.Enter a house name") Else connect() conn.Open() comm.CommandText = "select users.user_name,user_level,loging_time from users,login_time where users.user_name='" & TextBox1.Text & "' and users.user_name=login_time.user_name" comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt) Dim rpt As New CrystalReport3 rpt.SetDataSource(dt) CrystalReportViewer1.ReportSource = rpt conn.Close() End If End Sub End Class

All houses report form


Public Class Report_all_houses Dim dt2 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load dt2.Clear() connect() conn.Open() comm.CommandText = "select house_no,house_name,ward_name,houses.block_no,road_name from houses,wards,roads,blocks where houses.ward_no=wards.ward_no and houses.road_no=roads.road_no and blocks.block_no=houses.block_no " comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt2) Dim rpt As New CrystalReport1 rpt.SetDataSource(dt2) CrystalReportViewer1.ReportSource = rpt

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 51 of 59
conn.Close() End Sub Private Sub CrystalReportViewer1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load End Sub End Class

All nearby houses report form


Public Class Report_nearby_houses Dim dt, dt2, dt3 As New DataTable Dim adp As New OleDb.OleDbDataAdapter Dim comm As New OleDb.OleDbCommand Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dt3.Clear() If TextBox1.Text = "" Then MsgBox("Enter a house Name") ElseIf IsNumeric(TextBox1.Text) Then MsgBox("Numbers are not accepted.Enter a house name") Else connect() conn.Open() comm.CommandText = "select distinct house_no,house_name,ward_name,houses.block_no,road_name from houses,wards,roads,blocks where houses.ward_no=wards.ward_no and houses.road_no=roads.road_no and blocks.block_no=houses.block_no and house_name='" & TextBox1.Text & "' " comm.CommandType = CommandType.Text comm.Connection = conn adp.SelectCommand = comm adp.Fill(dt3) Dim rpt2 As New CrystalReport2 rpt2.SetDataSource(dt3) CrystalReportViewer1.ReportSource = rpt2 conn.Close() End If End Sub End Class

10.2 Validation

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 52 of 59

Validating is used to check whether all the forms are filled with correct data types and actions are performed according to a given rule. The users normally fill forms with incorrect data unknowingly. This may cause the software to behave erratically or stop its operation. 11) Testing Before the new system is implemented it had to be tested to check whether the final project is defect free. The following tests will be done to ensure that.

11.1) Black box testing The black box testing is testing without having any knowledge of the internal workings of the application. The tester is doesnt now the system architecture and does not have access to the source code. Typically, when performing a black box test, a tester will interact with the system's user interface by providing inputs and examining outputs without knowing how and where the inputs are worked upon.

11.2) White box testing

White box testing is the detailed investigation of internal logic and structure of the code. White box testing is also called glass testing or open box testing. In order to perform white box testing on an application, the tester needs to possess knowledge of the internal working of the code. The tester needs to have a look inside the source code and find out which unit/chunk of the code is behaving inappropriately.

11.3 Unit testing


The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules.

For example, the project is having two units and decides it would be more cost effective to glue them together and initially test them as an integrated unit, an error could occur in a variety of places:

Is the error due to a defect in unit 1? Is the error due to a defect in unit 2? Is the error due to defects in both units? Is the error due to a defect in the interface between the units? Is the error due to a defect in the test?
2nd year project MIDSE552 Batch

Mohamed Hassan no 23

Page 53 of 59

11.4 Validation test All the forms and reports are checked by given tests to see whether the forms or report behave the way the users expect. Eg. Login form is checked for correct data types and correct user name and password User name Hassan Rooster Hassan 1234 Hassan Empty or not filled Password R123 R123 B123 R123 123 R123 Output Login successful Invalid user name Invalid password User name characters should be

Password should be text. Numbers are not accepted Enter user name

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 54 of 59

Example Checking whether all the fields are filled and with correct data types in the add-users form. When the given user name is null. The program will prompt for a user name. If the data type given for user name is numbers then that data type will not be accepted by the user name field. And will prompt for a user name to be entered.

If the password entered is numbers then output is passwords first character should be a letter If all the fields are filled with correct data types then only the user is added

If the user level is not selected then output will be to select user level

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 55 of 59

11.5 System testing When all the above tests are completed the system is integrated into a whole system by merging all the modules of the project. After merging all the modules the system is checked to see whether all the forms and actions are performed correctly once the system is completed. 12.Implementation of the new system The system will be implemented when all the tests are done on the system and found to be free of errors. The system will be implemented in the working environment.

Training When the system is implemented the staff who will be using the system will be thoroughly trained. The idea is to familiarize the user to use the software easily.

The user manual After the system is implemented the user manual will be consulted for future reference and to know how to use the different features if one forgot how to use the system.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 56 of 59

13.Future enhancements The male map software is written to be used as a desktop application. In future it can be used to implement in a network environment. In future the male map software can be improved to show the exact location of the place with a market showing the exact location. In the desktop version that feature is not included because adding that feature means having a separate picture for every house in male. The total number of houses in male is about 7000. That means7000 pictures with markers showing the exact place will have to be created. The 7000 pictures had to entered to a database. Thats about 2 months work. So that feature is not included in this project.

14.Review This project is done in order to show that a map software can be made easily by using Microsoft access and vb.net. The developed system will make searching for a place an easy task. The system can be upgraded to include new features.

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 57 of 59

15.Glossary Lecturer: a teacher, or a person who explains things. Existing system: the system which is already in use in an organization Feasibility: Checking whether a project is worthwhile in terms of money, legally, and usefullness Data: Stored information in a database. Authorized: a person who have the right to do something Panning: viewing an image in a predefined object such as a form. Zooming-in: enlarging an image area. Zooming-out: shrinking an image area. System specification The computer systems features, such as RAM, etc. Hardware specification the hardware features Relationship How the data tables are related to each other Update: editing an existing record in a database. Delete: removing a record from a database. Add: adding a record to a database.
Mohamed Hassan no 23 2nd year project MIDSE552 Batch

Page 58 of 59

Report: A printable version of a useful data in a particular order. Manually: Work done by hand Testing: Checking for errors Training: educating staff Manual: A book describing how to work with the system.

16.Reference I have consulted some books in order to do this project. The following are books which I consulted. Introduction to System analysis and design by Shelly cashman Analysis and design of information systems by Arthur M.Langer

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch

Page 59 of 59

Mohamed Hassan no 23

2nd year project

MIDSE552

Batch