Sie sind auf Seite 1von 227

Project Report

Page 1 of 227

Table of Content

SL. No.
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

Topic
1. Introduction 2. System Analysis 2.1. Identification of Need 2.2. Preliminary Investigation 2.3. Feasibility Study 2.4. Project Planning 2.5. Project Scheduling 2.6. Software Requirement Specification 2.7. Software Engineering Paradigm 2.8. Data model, Control Flow diagram 3. System Design 3.1. Modularization details 3.2. Data integrity and consVehiclets 3.3. Database design 3.4. User Interface design 4. Coding 4.1. Complete Project Coding 4.2. Comments and Description 4.3. Standardization of the coding/Code Efficiency 4.4. Error handling 4.5. Parameter Calling/Passing 4.6. Validation Checks 5. Testing 5.1. Testing techniques and Testing strategies 5.2. Debugging and Code improvement 6. System Security Measures 6.1. Database/data Security 6.2. Creation of user profile and access rights 7. Cost Estimation 8. Reports 9. Pert Chart 10. Gantt Chart 11. Future Scope 12. Bibliography 13. Appendices 14. Glossary

Page No

Page 2 of 227

1. Introduction
This project provides the user with many configurable features. On top of its incredible flexibility this project offers 3 global configurations within the same program that affect all other options and the way you ship.

The software has the following key features: Menu Driven: The entire system is developed as a menu driven system. When the system is started the software starts with a flash screen and then the dialog box appears with required menus and submenus. The dialog box contains menu. From the menus user can do the required operation by clicking menus and their submenus. Flexible: The system is as flexible as there is no need for the remembering of any command. There is a help menu consists the instructions for the usage of the software and information about the components in a step-by-step basis. User Friendly: This software is user friendly since the system is entirely Menu driven.

This project simplifies the shipping process of companies using multiple carriers. This project includes your carriers rates and their specifications. Once all rates are entered, the system provides a rate-shopping capability that ensures the selection of the best rate.

Page 3 of 227

This project provides your carriers with bar-coded labels, manifests and bills of lading in their specific format. More advantages of using this system: easy to use cost comparison between multiple carriers carrier selection based on transit time and service requirements no start-of-day / end-of-day requirement, user can close carrier any time, over any length of time. This allows multiple manifests per day or consolidation on a weekly basis. EDI enabled for ASN, carrier billing, status and more on-line Tracking is available for many carriers
REPORTING AND ON-LINE CAPABILITY

With this system, all reporting needs can be customized. Standard reports are offered: powerful on-line or on-screen reporting allowing the user to view historic data in a multitude of ways carrier payment summary eliminates costly freight auditing cost centre analysis lane/weight analysis On-line tracing for fast accurate response to status inquiries is also available, by your reference, your customers reference, package ID, BOL#, date and much more.
RATE LOOKUP

This project offers users, the ability to lookup rates to ship to a particular client based on estimated pieces, weight, cube and service requirements.

Page 4 of 227

sales personnel can give accurate estimates on potential orders. customer service personnel can offer clients the service levels and freight charges prior to placing an order to allow for pre selection of carrier and service. check various routing or consolidation options to assist in cost saving and service enhancing ability

2. System Analysis 2.1. Identification of Need

For identifying problems/needs, we scan the following: the performance of the system the information being supplied and its form the economy of processing the control of the information processing the efficiency of the existing system the security of the data and software the security of the equipment and personnel, etc.

After identification of the problem, it is defined and a general direction or method for solving this problem is also determined. Then project boundaries are defined. The management establishes the term of reference as well as the resources to be provided for the project. System development is an iterative process and the first identifiable stage of it is Problem Definition, whose final output is Terms of Reference.

Page 5 of 227

2.2.

Preliminary Investigation

A request to take assistance from information systems can be made for many reasons, but in each case someone in the organization initiates the request when the request is made. The first systems activity the preliminary investigation begins. This activity has three parts: i. ii. iii. Request, clarification Feasibility study Request approval

Request Clarification: Many requests from employees and users in the organizations are not clearly defined. Therefore, it becomes necessary that project request must be examined and clarified properly before considering systems investigation.

This Project is on Shipping Management System, in which there are several Agents, each having their unique ID, and has the information about the Agents , the Route, Fare, the Tourist spots etc. in details. The agent books a package tour on receiving request from the Shippingers or the customers. After booking is done, the customer is provided with tickets with all journey details.

2.3.

Feasibility Study

Depending on the results of the initial investigation, the survey is expanded to a more detailed feasibility study. A feasibility study is a test of a system proposal according to its workability, impact on the organization, ability to meet users needs, and effective use of resources. It focuses on three major questions:

Page 6 of 227

1. What are the users demonstrable needs and how does a candidate system meet them? 2. What resources are available for given candidate systems? Is the problem worth solving? 3. What is the likely impact of the candidate system on the organization? How well does it fit within the organizations master MIS plan? Each of these questions must be answered very carefully. They revolve around investigation and evaluation of the problem, identification and description of the candidate systems, specification of performance and the cost of each system, and final selection of the best system. The objective of a feasibility study is not to solve the problem but to acquire a sense of its scope. During the study the problem definition is crystallized and aspects of the problem to be included in the system are determined. The result of the feasibility study is a formal proposal. The proposal consists of the following: 1. Statement of the problem: A carefully worded statement of the problem that led to analysis. 2. Summary of findings and recommendations: A list of the major findings and recommendations of the study. It is ideal for the user who requires quick access to the results. 3. Details of findings: An outline of the methods and procedures undertaken by the existing system, followed by coverage of the objectives and procedures of the candidate system. 4. Recommendations and conclusions: Specific recommendations regarding the candidate system, including personal assignments, costs, project schedules and target dates.

Page 7 of 227

After the management reviews the proposal, it becomes a formal agreement that paves the way for actual design and implementation. This is a crucial decision point in the life cycle. Many projects die here, whereas more promising ones continue through implementation. Changes in the proposal are made in writing, depending on the complexity, size and cost of the project. It is simply common sense to verify changes before committing the project to design. The Feasibility Study is broadly classified into the following heads: I) Economic Feasibility: From the Cost Estimation module the total DLOC of the project is 1400. According the costing that has arrived from DLOC considering the fact the project type is organic comes to be Rs.5000. This cost is bearable by the client within the prescribed limits of the later. Hence the project is Economically Feasible. II) Technical Feasibility: The hardware required for the project would mainly be a sophisticated printer for printing purpose other than the PC itself. These are technically available with latest technology incorporated into them. The software on which the project has been built up is mainly VB 6.0 Crystal Reports and Oracle which are readily available and technically sound. Hence the project is Technically Feasible. III) Operational Feasibility: Deploying the project would involve running the setup kit created by me on the client computer, creating ODBC connectivity and exporting the Oracle Database. These three jobs are well documented and can be easily deployed by a naive user. After deployment regular maintenance of the sound card, back up of the Database, trouble shooting etc. can also be achieved by well documented manuals. Hence the project is Operationally Feasible.

2.4.

Project Planning

Page 8 of 227

The objective of the Project Planning is to provide a framework that enables the manager to make reasonable estimates of resources, cost and schedule. These estimates are made within a limited time frame at the beginning of a software project and should be updated regularly as the project progresses. The planning objective is achieved through a process of information discovery that leads to reasonable estimates.

Master Project Plan


The Master Project Plan tells how the product will be built by gathering detailed plans from members of the project team. The team then uses this collection of more detailed deliverables to synchronize its work throughout the remainder of the project. The purpose of a Master Project Plan is to:

Consolidate feature team and role work plans. Describe how feature teams and roles will execute their tasks. Synchronize the plans across the team.

The overall owner of the Master Project Plan is Program Management, because this role is the primary coordinator of planning and process for the project. However, each role on the team is responsible for developing and maintaining its own realistic project plan within the overall plan. The Master Project Plan should include the items listed in Table. Table: Components of the Master Project Plan Plan Development Description Tells how Development will build whats described in the Functional Specification. It describes such things as tools, methodologies, best practices, sequences of events, and test methods. Page 9 of 227

Test

Includes a testing strategy, the specific areas to be tested, and the resources (hardware and people) Testing will require to do its job.

Vehicleing User support

Includes a strategy and a plan for developing any necessary Vehicleing materials. Includes a strategy and details for developing anything that users will need for performance, such as wizards and user manuals.

Communications Includes a marketing strategy and promotional activities for users. Deployment Includes a strategy and a detailed plan for preparing end users and operations personnel before and during deployment.

2.5.

Project Scheduling

Software Project Scheduling is an activity that distributes estimated effort across the planned project duration by allocating the effort to specific software engineering tasks. Like all other areas of software engineering, a number of basic principles guide software project scheduling: Compartmentalization Interdependency Time allocation Effort validation Defined responsibilities Defined outcomes Defined milestones

Page 10 of 227

Program Evaluation and Review Technique (PERT) and Critical Path Method (CPM) are two project scheduling methods that can be applied to software development. Both techniques are driven by information already developed in earlier project planning activities: Estimation of effort A decomposition of the product function The selection of the appropriate process model and task set Decomposition of tasks. When creating a software project schedule, the planner begins with a set of above tasks. A timeline chart, also called Gantt chart can be used for this purpose. The Gantt chart depicts the various parts of a software project schedule that emphasizes the concept scoping task for a software product. All project tasks are listed on the left side. Horizontal bars are used to indicate the duration of each task. A diamond is used to indicate a milestone. Of all the schedules in the Master Project Schedule, the development schedule is the most crucial. All the other schedules will be based on it. The Master Project Schedule includes:

Development schedule. Product ship dates, both internal and external. Test schedule. Vehicleing schedule. User support schedule. Communications schedule. Deployment schedule.

2.6.

Software Requirement Specification


Page 11 of 227

According to the Client proposal we have arrived at our design in order to implement our client requirements. Software Requirement Specification is produced at the end of the Analysis task. The function and performance of the software are refined by a complete information description, a detailed functional and behavioral description, performance requirements and design consConsignmentts, appropriate validation criteria and other data related to requirements. A simplified outline as given below is for the specification. Introduction: the introduction of the Software Specification states the goal and objective of the software, describing it in the context of the computer based system. Actually, the introduction may be nothing more than software scope of the planning document. System reference, Overall description, Environment characteristics, Interface with devices, Interface with Operating system, Interface with Databases. Functional Requirements The requirement of this function has been implemented on the basis of the project designing and partitioning the Project into different sub-modules, which are as follows: a) Functional Partitioning: I) Server: 1) Login system 2) Add, Update, and Delete system for: i. Consignor
ii.

Consignee

iii. Consignment

Page 12 of 227

iv. Route 3) Report generating system. b) Functional Description: I) Server: 1) Logon to the SMS modification system. 2) Add a new record, Update existing record, and Delete old record i.
ii.

for:

Consignor Consignee Consignment Route

iii. iv.

3) Generate Reports for Consignee activity, Consignment query, Consignor. 4) View information relating to Consignee, Consignor, Consignment as a graphical form. II) Terminal: View information relating to Consignee, Consignor,

Consignment as a graphical form.

c) Control Description:

Page 13 of 227

Proper security authentication has been provided by this system. Security features is discussed later. Non-functional Requirements * The system can be run on all NT type of Windows platform. * The system requires MS SQL Server Database installed. * The system requires adequate Memory. Behavioral Description State Diagram for Logon:

Request Logon

Enter Id & Password

Logon Do: Display Logon

Do: Request Id & Password

Do: Verify User

Bad Password Validate Try Bad Account

Do: Logon

Do: Cancel Massage

State Diagram for Add/Update/Delete:

Page 14 of 227

Request updating database

Enter data

Add/Update/Delete Do: Display Add/Update/Delete

Do: Request Data

Do: Verify Data

Validate Try Bad Data

Do: Cancel Massage

Do: Update
Database

State Diagram for Report:

Request display report

Enter data

Report Do: Display Report

Do: Request Data

Do: Verify Data

Validate Try Bad Data

Do: Show

Do: Cancel massage

Page 15 of 227

State Diagram for SMS (Shipping Management Systems):

Request for Information

Enter data

SMS Do: Display SMS

Do: Request Data

Do: Verify Data


Validate

Try Bad data

Do: Cancel Message

Do: information

Validation Criteria a) Performance Bounds: Performance of this system will heavily depend on processing speed of the Terminals (Computer). b) Routees of Tests: Each module will be tested independently. Finally the overall testing will be made in order to find out whether the system is accurate or not. c) Response to undesired Events: The system that will be generated will never fail in spite of inputting wrong data. This system will be able to generate error message whenever wrong information is input or an undesired event occurs.

Software Used Hardware Requirements Software Requirements Page 16 of 227

Software used: Programming: VB.NET 2003 Platform: Microsoft.Net Framework 2.0 Report Generation: Crystal reports 10 Database: SQL Server for Windows Server 2003 with SQL * Plus Components: ActiveX OS: Windows XP with Service Pack 2 Overview of the .NET Framework The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives:

To provide a consistent object-oriented programming environment

whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely.

To provide a code-execution environment that minimizes software

deployment and versioning conflicts.

To provide a code-execution environment that promotes safe execution of

code, including code created by an unknown or semi-trusted third party.

To provide a code-execution environment that eliminates the performance

problems of scripted or interpreted environments.

To make the developer experience consistent across widely varying types

of applications, such as Windows-based applications and Web-based applications.

To build all communication on industry standards to ensure that code

based on the .NET Framework can integrate with any other code.

Page 17 of 227

Oracle9i contains important new features that optimize traditional business applications, facilitate critical advancement for internet-based business, and stimulate the emerging hosted application market. New Oracle9i Database features deliver the performance, scalability, and availability essential to hosted service software made available to anyone, anywhere. The Oracle9i Database offers new transparent, rapid growth clustering capabilities, along with powerful and cost-effective security measures, zerodata-loss safeguards, and real-time intelligence to deliver the power needed in today's dynamic marketplace, like: Availability, Scalability, Performance, Security, Manageability, E-Business Application, E-Business Integration, Content Management, Windows Integration, Packaged Applications, Business Intelligence Other New Features: Oracle9i includes a number of miscellaneous features that increase the power and usability of the database server. Heterogeneous Services Oracle Net Services Replication Oracle Spatial The 18-character limit for spatial index names is removed Oracle Text, formerly inter-Media Text, includes new features that provide greater flexibility in building text query applications

Page 18 of 227

Crystal Reports for Visual Studio .NET is the standard reporting tool for Visual Studio .NET; it brings the ability to create interactive, presentation-quality content which has been the strength of Crystal Reports for years to the .NET platform. With Crystal Reports for Visual Studio .NET, you can host reports on Web and Windows platforms and publish Crystal reports as Report Web Services

Page 19 of 227

on a Web server. Though the Web Forms Viewer is used for Web programming and the Windows Forms Viewer is used for Windows programming, their basic functionality is the same; that is, they are both used to view reports. The Viewer controls' main purpose is to view reports within your application. They can be passed a path either to a report file, or to a Report-Document object. Besides displaying reports, the Viewer controls only have a limited amount of control over the report. They have the ability to set logon information and set parameters. They also have limited exporting capabilities. The Report Document object offers the most control over your reports. It has many different properties and methods that let you control the look of your report through code. The Report-Document object can be used in either a Windows application or a Web application; however, it cannot view your reports. This is where the Viewer controls and the Report-Document object fit together.

2.7.

Software Engineering Paradigm

To solve actual problem in an industry setting, a software engineer must incorporate a development strategy that encompasses the process, methods and tool layers and the generic phases. This strategy is known as Software Engineering Paradigm of Process Model. A software engineering paradigm is chosen based on the nature of the project and application, the methods and tools to be used, and the controls and deliverables that are required. The Software Requirement Paradigm applied here is Waterfall Model or Linear Sequential Model Waterfall Model The common metaphor of building a house is often used to describe the traditional approach to application development. The builder first gathers information from the Consignee about his or her needs and desires, determines Page 20 of 227

what needs to be built, designs the structure, and constructs it from the plans. The builder must ensure that the building holds together and that all the components, from the electricity and plumbing to the doorbell, are fully functional. The Consignee then tests everything to ensure that all elements meet expectations. Even after the Consignee moves into the new home, the builder must occasionally come back to fix minor problems. The stages of building a house are similar to the stages of the Waterfall Model of application development. As shown in Figure 4.1, the tightly defined Waterfall Model is an orderly, highly structured process based on the following well-defined development steps:

Gathering system and software requirements Analysis Program design Coding and unit testing System integration System testing Operation acceptance

Each step is completed and thoroughly documented before the next step can begin.

Page 21 of 227

Strict use of the Waterfall Model is declining. Following this model causes several problems throughout the product life cycle, which are summarized below.

Extra time Typically more time than was initially scheduled is needed to integrate subsystems into a complete, working application. Late design changes Design flaws that require significant changes to the product are discovered late in the software coding process. Rarely is tangible design validation performed in the project's early stages.

Inadequate risk resolution The project's risks are not resolved until late in the product life cycle. Lack of requirement revisions The project's requirements must be stated and frozen at the first stages of the development process. Often, the project's stakeholders don't completely understand the business and product requirements at the beginning of project. With most software projects, requirements are clarified and changed throughout the project, which dramatically increases product cost and delays ship times. If the changes are not integrated into the product, the stakeholders don't think the product they receive is the one they requested.

Page 22 of 227

Limited opportunities for input The traditional practice allows a single review process to finalize each project stage. This single opportunity to voice concerns and suggest changes produces an over-sensitized focus on details that can lead to adversarial relationships between project stakeholders.

Lack of review The first four stages of the Waterfall Model are paperbased exercises, and to prove that the project is progressing, reams of paper may be produced as each stage is completed. As volumes of system documentation are presented, the most understood portions are often the ones that are reviewed, while the more complex portions are simply assumed to be correct.

2.8.

Data model, Control Flow diagram

DATA FLOW DIAGRAM


The data flow diagram is used to represent a system or software at any level of abstraction. DFDs may be portioned into levels that represent increasing information flow and functional detail. Thus, the DFD offers a mechanism for functional modeling as well as information flow modeling. And, it satisfies the second operational analysis principle. A data flow diagram (DFD) is graphical technique that shows information flow and the transforms that are used as data move from input to output. The DFD is also know as a data flow graph or a bubble chart.

Page 23 of 227

DFD Level 0

DFD Level 1 Level 1: represents the verification of the system as to login by giving the Correct Login and password.

Page 24 of 227

User
Lo gin

Lo gin

Re spo

nse

r Ve

se pon s Re ied if

Password

Re qu

1.1
est

Login System
DFD Level 2

s que Re ata nD i Log

Page 25 of 227

DFD Level 3 User Data


Data Request Data Request

3.1 Add Records


ue Req st

Database

Dat a

Req uest

Da ta

3.2 Modify Records

a Dat

Da t

aR esp

on se

Re qu es t

3.3 Delete Records

eq aR at D

ue

st

3.4 Display Records

ER-DIAGRAM:
Database will be consisting of number of tables. First of all an ER-diagram showing the entity and their relationships is created. Then entity sets and relations are converted into tables as per requirement. Careful study of the input-output requirements reveals the attributes of the tables. Finally the table structures are refined applying normalization. Here, normalization up to 3NF has been adopted. But, in some cases for ease of operation and faster response redundancy have been allowed.

Page 26 of 227

Da ta

R eq u

es t

Display results

ta Da e ue ue ue ue qu Re t t t t st

Route Id Source Destination Vehicle Id

Route Id Vehicle Name

Choose Con Id Name

Route

Covered by Cons Id ConID Value Books Consignment Route Id Date Amount Paid for

Vehicle

Conducted on

Address Consignor Booking Id Vehicle Id Consignment ID

Tariff Id Distance Cost

Pays

Tariff

3. System Design 3.1. Modularization details

1) Routes Module:

Page 27 of 227

a) Take details of route of the Source & Destination. This includes the Name, Address, of the place. b) Assign source and destination. c) Assign a route id. d) Save the details into the database. e) Generate report of the Route according to the needs.

2) Vehicles Module: a) Take details of the vehicle. This includes the registration no. of vehicle, manufacturer, no. of seat capacity of the vehicle etc. b) Assign a route to the vehicle. c) Assign a vehicle id. d) Assign time to leave the station. e) Assign the fare. f) Save every record to the database. g) Generate report of the vehicle according to the needs.

3) Bookings Module: a) Get details of the Consignment package. b) Get details of the Consignor. c) Check the availability of the package. d) Check the availability of the vehicle on the chosen route. e) Give ticket to the customer with a transaction id. f) Save record into the database g) Generate report according to the need.

Page 28 of 227

3.2. Data integrity and consVehiclets

Data integrity means that the data contained in the database is both accurate and consistent. Therefore, data values being entered for storage could be checked to ensure that they fall within a specified range and are of the correct format. For example, the value of the employee of Shipping Company may be in the range of 18 to 60. Another integrity check that should be incorporated in the database is to ensure that if there is a reference to certain object, that object must exist. In the case of Automatic Teller Machine (ATM), for example, a user is not allowed to transfer funds from a nonexistent savings account to a checking account.

Types of Data Integrity


ORACLE 9i supports four types of data integrity: entity integrity, domain integrity, Referential integrity, and user-defined integrity.

Entity Integrity
Entity integrity defines a row as a unique instance of an entity for a particular table. Entity integrity enforces the integrity of the identifier column or the primary key of a table (through indexes, UNIQUE consVehiclets, PRIMARY KEY consVehiclets, or IDENTITY properties).

Domain Integrity
Domain integrity is the validity of entries for a given column. You can enforce domain integrity by restricting the type (through data types), the format (through CHECK consVehiclets and rules), or the range of possible values (through

Page 29 of 227

FOREIGN KEY consVehiclets, CHECK consVehiclets, DEFAULT definitions, NOT NULL definitions, and rules).

Referential Integrity
Referential integrity preserves the defined relationships between tables when records are entered or deleted. In SQL Server, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys (through FOREIGN KEY and CHECK consVehiclets). Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to non-existent values and that, if a key value changes, all references to it change consistently throughout the database. When we enforce referential integrity, SQL Server prevents users from doing any of the following: Adding records to a related table if there is no associated record in the primary table Changing values in a primary table that result in orphaned records in a related table Deleting records from a primary table if there are related records in the foreign table

User-Defined Integrity
User-defined integrity enables us to define specific business rules that do not fall into one of the other integrity categories. All of the integrity categories support user-defined integrity (all column-level and table-level consVehiclets in the CREATE TABLE statement, stored procedures, and triggers).

Integrity ConsVehiclets

Page 30 of 227

ConsVehiclets enable us to define the way SQL Server 2000 automatically enforces the integrity of a database. ConsVehiclets define rules regarding the values allowed in columns and are the standard mechanisms for enforcing integrity. Using consVehiclets is preferred to using triggers, rules, or defaults. The query optimizer also uses consVehiclet definitions to build high-performance query execution plans. ConsVehiclets can be column consVehiclets or table consVehiclets: A column consVehiclet is specified as part of a column definition and applies only to that column. A table consVehiclet is declared independently from a column definition and can apply to more than one column in a table. Table consVehiclets must be used when more than one column is included in a consVehiclet. For example, if a table has two or more columns in the primary key, we must use a table consVehiclet to include both columns in the primary key. Consider a table that records events happening in a computer in a factory. Assume that events of several types can happen at the same time, but no two events happening at the same time can be of the same type. This rule can be enforced in the table by including both the type and time columns in a twocolumn primary key, as shown in the following CREATE TABLE statement: CREATE TABLE FactoryProcess ( EventType INT, EventTime DATETIME, EventSite CHAR(50), EventDesc CHAR(1024), CONSVEHICLET event_key PRIMARY KEY (EventType, EventTime) )

Page 31 of 227

SQL Server supports four main classes of consVehiclets: PRIMARY KEY consVehiclets, UNIQUE consVehiclets, FOREIGN KEY consVehiclets, and CHECK consVehiclets.

PRIMARY KEY ConsVehiclets


A table usually has a column (or combination of columns) whose values uniquely identify each row in the table. This column (or columns) is called the primary key of the table and enforces the entity integrity of the table. You can create a primary key by defining a PRIMARY KEY consVehiclet when you create or alter a table.

UNIQUE ConsVehiclets
We can use UNIQUE consVehiclets to ensure that no duplicate values are entered in specific columns that do not participate in a primary key. Although both a UNIQUE consVehiclet and a PRIMARY KEY consVehiclet enforce uniqueness, you should use a UNIQUE consVehiclet instead of a PRIMARY KEY consVehiclet in the following situations: If a column (or combination of columns) is not the primary key. Multiple UNIQUE consVehiclets can be defined on a table, whereas only one PRIMARY KEY consVehiclet can be defined on a table. If a column allows null values. UNIQUE consVehiclets can be defined for columns that allow null values, whereas PRIMARY KEY consVehiclets can be defined only on columns that do not allow null values. A UNIQUE consVehiclet can also be referenced by a FOREIGN KEY consVehiclet.

FOREIGN KEY ConsVehiclets


A foreign key is a column or combination of columns used to establish and enforce a link between the data in two tables. Create a link between two tables by adding a column (or columns) to one of the tables and defining those columns

Page 32 of 227

with a FOREIGN KEY consVehiclet. The columns will hold the primary key values from the second table. A table can contain multiple FOREIGN KEY consVehiclets.

CHECK ConsVehiclets
CHECK consVehiclets enforce domain integrity by limiting the values that are accepted by a column. They are similar to FOREIGN KEY consVehiclets in that they control the values that are placed in a column. The difference is in how they determine which values are valid. FOREIGN KEY consVehiclets get the list of valid values from another table, and CHECK consVehiclets determine the valid values from a logical expression that is not based on data in another column. For example, it is possible to limit the range of values for a salary column by creating a CHECK consVehiclet that allows only data ranging from $15,000 through $100,000. This feature prevents the entering of salaries from outside the normal salary range.

3.3.

Database design

Using the relational model, each of the entities can be represented by a relation. Each relation scheme is named and indicated by boldface capital letters. Here, we have a relation scheme STAFF, for SHIPPING CONSIGNEE, AUTHORITY, SHIFT, CONSIGNMENT_MASTER,

CONSIGNMENT_TRANS, MEDICALS and INVOICE relations. From the ER model we find the following relation tables: Proposed tables Database Schema Table: SMS_SHIPMODES (contains information about the various shipping modes available)
Column Name Data Type Description

Page 33 of 227

Id Name Description

INTEGER VARCHAR(25) VARCHAR(50)

shipping mode Name of the shipping mode e.g. Air, Sea, Land, Courier, etc. Detailed description if any
Unique identification for every

Table: SMS_TARIFFS (contains information about the various tariff schemes available)
Column Name Data Type Description

ShipModeId StartDistan ce EndDistanc e Tariff

INTEGER VARCHAR(25) VARCHAR(50) NUMERIC(9,2)

Refers ID column of SMS_SHIPMODES table Starting distance for this class of tariffs ex. 0 Ending distance for this category of tariffs ex. 250 Rate for 0 to 250 kilometers ex. 1500 rupees

Table: SMS_CONSIGNMENTTYPES (contains information about the various types of


consignments) Column Name Data Type Description

Id Name Description

INTEGER VARCHAR(25) VARCHAR(50)

type of consignment Name of the consignment type ex. Parcel, Package, Container Detailed description if any
Unique identification for every

Table: SMS_CONSIGNORS (contains information about customers)


Column Name Data Type Description

Id Name Address1 Address2 Address3 PIN Phone1 Phone2 Fax Email ContactPers on Notes

INTEGER VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(15) VARCHAR(25) VARCHAR(25) VARCHAR(25) VARCHAR(50) VARCHAR(50) TEXT

customer Name of the customer. You can also put FirstName, LastName, etc. Address of the customer Address of the customer Address of the customer PIN Code of the customer Phone of the customer Phone of the customer Fax of the customer Email Id of the customer Contact Person of the customer
Unique identification for every

Any detailed description about the customer

Table: SMS_CONSIGNMENTS (contains information about consignments)


Column Name Data Type Description

Id Name

INTEGER VARCHAR(25)

shipping mode Name of the shipping mode e.g. Air, Sea, Land, Courier, etc.
Unique identification for every

Page 34 of 227

Description Type ConsignorId TotalWeight FromAddres s1 FromAddres s2 ToName ToAddress1 ToAddress2 ToAddress3 ToPIN DispatchDat e DeliveryDat e

VARCHAR(50) INTEGER INTEGER NUMERIC(9,2) VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(50) VARCHAR(15) DATETIME DATETIME

Detailed description if any Whether Luggage, Parcel or Heavy Package. Store 1, 2 or 3 only Refers ID column of CONSIGNORS table Total weight of the consignment From Address of the consignment From Address of the consignment To Address of the consignment To Address of the consignment To Address of the consignment To Address of the consignment To PIN Code of the consignment Dispatch date of the consignment Prospective delivery date of the consignment

Table: SMS_HALTS (contains information about the various way stations covered in all routes)
Column Name Data Type Description

Id Name Description

INTEGER VARCHAR(25)

Unique identification for every

way station

Name of the way station viz. Pune, Vijayawada, Bellary, etc. Detailed description if any

VARCHAR(50)

Table: SMS_ROUTEMASTER (contains information about the various routes taken)


Column Name Data Type Description

Id Name StartingPoint Id EndingPointI d TotalDistanc e

INTEGER VARCHAR(25) INTEGER

Unique identification for every

route

Name of the route if any Refers ID column of SMS_HALTS table Refers ID column of SMS_HALTS table Total distance covered by the consignment

INTEGER

NUMERIC(9,2)

Table: SMS_ROUTEDETAILS (contains information about the halts on every route)


Column Name Data Type Description

RouteId

INTEGER

Unique identification for every

route

Page 35 of 227

StartingPoint Id EndingPointI d HaltNo Distance TimeTaken ClearanceTi me

INTEGER

Refers ID column of SMS_HALTS table (Madras


has an ID of 23)

INTEGER

Refers ID column of SMS_HALTS table


(Hyderabad has an ID of 97)

INTEGER NUMERIC(9,2)

A serial number (Gudur is halt no.1, Nellore is halt no.2,


Ongole is halt no.3)

Distance between the above starting point and ending point Time taken to Shipping from above starting point to above end point Time taken for the consignment to arrive at this ending point

NUMERIC(9,2)

NUMERIC(9,2)

Table: SMS_ITEMS (contains information about the items shipped)


Column Name Data Type Description

Consignment Id ItemId ItemDesc Weight Length Breadth Height Composition PiecesPerBo x BoxesPerPac k RouteId DispatchDat e

INTEGER

Unique identification for every

item

INTEGER VARCHAR(50) NUMERIC(5,2) NUMERIC(5,2) NUMERIC(5,2) NUMERIC(5,2) VARCHAR(50) INTEGER

Refers ID column of SMS_ITEMS table (Madras


has an ID of 23)

Description A serial number (Gudur is halt no.1, Nellore is halt no.2,


Ongole is halt no.3)

Length of the item Breadth of the item Height of the item Composition of the item (Cardboard, Thermocol,
Paper Mache, Coir)

Number of pieces that can be accommodated in a box Number of boxes that can be accommodated in a pack Refers ID column of SMS_ROUTEMASTER table Date on which the package was dispatched

INTEGER

INTEGER

DATETIME

SQL CODE FOR GENERATING TABLES & STORED PROCEDURES

Page 36 of 227

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo]. [ConsignmentDetails]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[ConsignmentDetails] GO CREATE TABLE [dbo].[ConsignmentDetails] ( [ConSignmentID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Description] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [ConsignmentTypeID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Quantity] [int] NOT NULL , [ArrivalDate] [datetime] NOT NULL , [ArrivalTime] [datetime] NOT NULL , [Length] [numeric](18, 0) NOT NULL , [Breadth] [numeric](18, 0) NOT NULL , [Height] [numeric](18, 0) NOT NULL , [Weight] [numeric](18, 0) NOT NULL , [DestinationStationID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [DeliveryDate] [datetime] NOT NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo]. [ConsignmentTypes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[ConsignmentTypes] GO

Page 37 of 227

CREATE TABLE [dbo].[ConsignmentTypes] ( [ConsignmentTypeID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ConsignmentTypeName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Description] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Consignor]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Consignor] GO CREATE TABLE [dbo].[Consignor] ( [ConsignorID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ConsignorName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [CompanyName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Address] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [EmailID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Fax] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Notes] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO

Page 38 of 227

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo]. [ConsingmentMaster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[ConsingmentMaster] GO CREATE TABLE [dbo].[ConsingmentMaster] ( [ConsignmentID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ConsignorID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [StationID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [NoOfItems] [int] NOT NULL , [ConsignmentDate] [datetime] NOT NULL , [ItemValue] [numeric](18, 0) NOT NULL , [BillAmount] [numeric](18, 0) NOT NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RouteDetails]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[RouteDetails] GO CREATE TABLE [dbo].[RouteDetails] ( [RouteID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [StartingPointID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [EndingPointID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,

Page 39 of 227

[StopNo] [int] NOT NULL , [Distance] [numeric](18, 0) NOT NULL , [TrainNo] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ArrivalTime] [datetime] NOT NULL , [DepartureTime] [datetime] NOT NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[RouteMaster]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[RouteMaster] GO CREATE TABLE [dbo].[RouteMaster] ( [RouteID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [RouteName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [StartingPointID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [EndingPointingID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [TotalDistance] [numeric](18, 0) NOT NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Shipmodes]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Shipmodes] GO

Page 40 of 227

CREATE TABLE [dbo].[Shipmodes] ( [ShipmodeID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [ShipmodeName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Description] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Station]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Station] GO CREATE TABLE [dbo].[Station] ( [StationID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [StationName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Description] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Tariff]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[Tariff] GO

Page 41 of 227

CREATE TABLE [dbo].[Tariff] ( [ShipmodeID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [StartDistance] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [EndDistance] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [Tariff] [numeric](18, 0) NOT NULL ) ON [PRIMARY] GO

CREATE PROCEDURE dbo.DeleteConsignmentDetails ( @Original_ConSignmentID varchar(10), @Original_ArrivalDate datetime, @Original_ArrivalTime datetime, @Original_Breadth numeric(18), @Original_ConsignmentTypeID varchar(10), @Original_DeliveryDate datetime, @Original_Description varchar(100), @Original_DestinationStationID varchar(10), @Original_Height numeric(18), @Original_Length numeric(18), @Original_Quantity int, @Original_Weight numeric(18) ) AS SET NOCOUNT OFF; DELETE FROM ConsignmentDetails WHERE (ConSignmentID = @Original_ConSignmentID) AND (ArrivalDate = @Original_ArrivalDate) AND

Page 42 of 227

(ArrivalTime = @Original_ArrivalTime) AND (Breadth = @Original_Breadth) AND (ConsignmentTypeID = @Original_ConsignmentTypeID) AND (DeliveryDate = @Original_DeliveryDate) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (DestinationStationID = @Original_DestinationStationID) AND (Height = @Original_Height) AND (Length = @Original_Length) AND (Quantity = @Original_Quantity) AND (Weight = @Original_Weight) GO CREATE PROCEDURE dbo.DeleteConsignmentMaster ( @Original_ConsignmentID varchar(10), @Original_BillAmount numeric(18), @Original_ConsignmentDate datetime, @Original_ConsignorID varchar(10), @Original_ItemValue numeric(18), @Original_NoOfItems int, @Original_StationID varchar(10) ) AS SET NOCOUNT OFF; DELETE FROM ConsignmentMaster WHERE (ConsignmentID = @Original_ConsignmentID) AND (BillAmount = @Original_BillAmount) AND (ConsignmentDate = @Original_ConsignmentDate) AND (ConsignorID = @Original_ConsignorID) AND (ItemValue = @Original_ItemValue) AND (NoOfItems = @Original_NoOfItems) AND (StationID = @Original_StationID) GO CREATE PROCEDURE dbo.DeleteConsignor ( @Original_ConsignorID varchar(10), @Original_Address varchar(100), @Original_CompanyName varchar(50),

Page 43 of 227

@Original_ConsignorName varchar(50), @Original_EmailID varchar(50), @Original_Fax varchar(20), @Original_Notes varchar(50) ) AS SET NOCOUNT OFF; DELETE FROM Consignor WHERE (ConsignorID = @Original_ConsignorID) AND (Address = @Original_Address) AND (CompanyName = @Original_CompanyName) AND (ConsignorName = @Original_ConsignorName) AND (EmailID = @Original_EmailID) AND (Fax = @Original_Fax OR @Original_Fax IS NULL AND Fax IS NULL) AND (Notes = @Original_Notes OR @Original_Notes IS NULL AND Notes IS NULL) GO CREATE PROCEDURE dbo.DeleteConsignorTypes ( @Original_ConsignmentTypeID varchar(10), @Original_ConsignmentTypeName varchar(50), @Original_Description varchar(100) ) AS SET NOCOUNT OFF; DELETE FROM ConsignmentTypes WHERE (ConsignmentTypeID = @Original_ConsignmentTypeID) AND (ConsignmentTypeName = @Original_ConsignmentTypeName) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) GO CREATE PROCEDURE dbo.DeleteRouteDetails ( @Original_EndingPointID varchar(10), @Original_RouteID varchar(10),

Page 44 of 227

@Original_StartingPointID varchar(10), @Original_ArrivalTime datetime, @Original_DepartureTime datetime, @Original_Distance numeric(18), @Original_StopNo int, @Original_VehicleNo varchar(10) ) AS SET NOCOUNT OFF; DELETE FROM RouteDetails WHERE (EndingPointID = @Original_EndingPointID) AND (RouteID = @Original_RouteID) AND (StartingPointID = @Original_StartingPointID) AND (ArrivalTime = @Original_ArrivalTime) AND (DepartureTime = @Original_DepartureTime) AND (Distance = @Original_Distance) AND (StopNo = @Original_StopNo) AND (VehicleNo = @Original_VehicleNo) GO CREATE PROCEDURE dbo.DeleteRouteMaster ( @Original_RouteID varchar(10), @Original_EndingPointingID varchar(10), @Original_RouteName varchar(50), @Original_StartingPointID varchar(10), @Original_TotalDistance numeric(18) ) AS SET NOCOUNT OFF; DELETE FROM RouteMaster WHERE (RouteID = @Original_RouteID) AND (EndingPointingID = @Original_EndingPointingID) AND (RouteName = @Original_RouteName) AND (StartingPointID = @Original_StartingPointID) AND (TotalDistance = @Original_TotalDistance) GO

Page 45 of 227

CREATE PROCEDURE dbo.DeleteStation ( @Original_StationID varchar(10), @Original_Description varchar(100), @Original_StationName varchar(50) ) AS SET NOCOUNT OFF; DELETE FROM Station WHERE (StationID = @Original_StationID) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (StationName = @Original_StationName) GO CREATE PROCEDURE dbo.DeleteTariffs ( @Original_ConsingmentTypeID varchar(10), @Original_Class varchar(50), @Original_EndDistance numeric(18), @Original_Rate numeric(18), @Original_StartDistance numeric(18) ) AS SET NOCOUNT OFF; DELETE FROM Tariffs WHERE (ConsingmentTypeID = @Original_ConsingmentTypeID) AND (Class = @Original_Class) AND (EndDistance = @Original_EndDistance) AND (Rate = @Original_Rate) AND (StartDistance = @Original_StartDistance) GO CREATE PROCEDURE dbo.InsertConsignmentDetails ( @ConSignmentID varchar(10), @Description varchar(100),

Page 46 of 227

@ConsignmentTypeID varchar(10), @Quantity int, @ArrivalDate datetime, @ArrivalTime datetime, @Length numeric(18), @Breadth numeric(18), @Height numeric(18), @Weight numeric(18), @DestinationStationID varchar(10), @DeliveryDate datetime ) AS SET NOCOUNT OFF; INSERT INTO ConsignmentDetails(ConSignmentID, Description, ConsignmentTypeID, Quantity, ArrivalDate, ArrivalTime, Length, Breadth, Height, Weight, DestinationStationID, DeliveryDate) VALUES (@ConSignmentID, @Description, @ConsignmentTypeID, @Quantity, @ArrivalDate, @ArrivalTime, @Length, @Breadth, @Height, @Weight, @DestinationStationID, @DeliveryDate); SELECT ConSignmentID, Description, ConsignmentTypeID, Quantity, ArrivalDate, ArrivalTime, Length, Breadth, Height, Weight, DestinationStationID, DeliveryDate FROM ConsignmentDetails WHERE (ConSignmentID = @ConSignmentID) GO CREATE PROCEDURE dbo.InsertConsignmentMaster ( @ConsignmentID varchar(10), @ConsignorID varchar(10), @StationID varchar(10), @NoOfItems int, @ConsignmentDate datetime, @ItemValue numeric(18),

Page 47 of 227

@BillAmount numeric(18) ) AS SET NOCOUNT OFF; INSERT INTO ConsignmentMaster(ConsignmentID, ConsignorID, StationID, NoOfItems, ConsignmentDate, ItemValue, BillAmount) VALUES (@ConsignmentID, @ConsignorID, @StationID, @NoOfItems, @ConsignmentDate, @ItemValue, @BillAmount); SELECT ConsignmentID, ConsignorID, StationID, NoOfItems, ConsignmentDate, ItemValue, BillAmount FROM ConsignmentMaster WHERE (ConsignmentID = @ConsignmentID) GO CREATE PROCEDURE dbo.InsertConsignmentTypes ( @ConsignmentTypeID varchar(10), @ConsignmentTypeName varchar(50), @Description varchar(100) ) AS SET NOCOUNT OFF; INSERT INTO ConsignmentTypes(ConsignmentTypeID, ConsignmentTypeName, Description) VALUES (@ConsignmentTypeID, @ConsignmentTypeName, @Description); SELECT ConsignmentTypeID, ConsignmentTypeName, Description FROM ConsignmentTypes WHERE (ConsignmentTypeID = @ConsignmentTypeID) GO CREATE PROCEDURE dbo.InsertConsignor ( @ConsignorID varchar(10), @ConsignorName varchar(50), @CompanyName varchar(50),

Page 48 of 227

@Address varchar(100), @EmailID varchar(50), @Fax varchar(20), @Notes varchar(50) ) AS SET NOCOUNT OFF; INSERT INTO Consignor(ConsignorID, ConsignorName, CompanyName, Address, EmailID, Fax, Notes) VALUES (@ConsignorID, @ConsignorName, @CompanyName, @Address, @EmailID, @Fax, @Notes); SELECT ConsignorID, ConsignorName, CompanyName, Address, EmailID, Fax, Notes FROM Consignor WHERE (ConsignorID = @ConsignorID) GO CREATE PROCEDURE dbo.InsertRouteDetails ( @RouteID varchar(10), @StartingPointID varchar(10), @EndingPointID varchar(10), @StopNo int, @Distance numeric(18), @VehicleNo varchar(10), @ArrivalTime datetime, @DepartureTime datetime ) AS SET NOCOUNT OFF; INSERT INTO RouteDetails(RouteID, StartingPointID, EndingPointID, StopNo, Distance, VehicleNo, ArrivalTime, DepartureTime) VALUES (@RouteID, @StartingPointID, @EndingPointID, @StopNo, @Distance, @VehicleNo, @ArrivalTime, @DepartureTime);

Page 49 of 227

SELECT RouteID, StartingPointID, EndingPointID, StopNo, Distance, VehicleNo, ArrivalTime, DepartureTime FROM RouteDetails WHERE (EndingPointID = @EndingPointID) AND (RouteID = @RouteID) AND (StartingPointID = @StartingPointID) GO CREATE PROCEDURE dbo.InsertRouteMaster ( @RouteID varchar(10), @RouteName varchar(50), @StartingPointID varchar(10), @EndingPointingID varchar(10), @TotalDistance numeric(18) ) AS SET NOCOUNT OFF; INSERT INTO RouteMaster(RouteID, RouteName, StartingPointID, EndingPointingID, TotalDistance) VALUES (@RouteID, @RouteName, @StartingPointID, @EndingPointingID, @TotalDistance); SELECT RouteID, RouteName, StartingPointID, EndingPointingID, TotalDistance FROM RouteMaster WHERE (RouteID = @RouteID) GO CREATE PROCEDURE dbo.InsertStation ( @StationID varchar(10), @StationName varchar(50), @Description varchar(100) ) AS SET NOCOUNT OFF; INSERT INTO Station(StationID, StationName, Description) VALUES (@StationID, @StationName, @Description);

Page 50 of 227

SELECT StationID, StationName, Description FROM Station WHERE (StationID = @StationID) GO CREATE PROCEDURE dbo.InsertTariffs ( @ConsingmentTypeID varchar(10), @Class varchar(50), @StartDistance numeric(18), @EndDistance numeric(18), @Rate numeric(18) ) AS SET NOCOUNT OFF; INSERT INTO Tariffs(ConsingmentTypeID, Class, StartDistance, EndDistance, Rate) VALUES (@ConsingmentTypeID, @Class, @StartDistance, @EndDistance, @Rate); SELECT ConsingmentTypeID, Class, StartDistance, EndDistance, Rate FROM Tariffs WHERE (ConsingmentTypeID = @ConsingmentTypeID) GO CREATE PROCEDURE dbo.SelectConsignmentDetails AS SET NOCOUNT ON; SELECT ConSignmentID, Description, ConsignmentTypeID, Quantity, ArrivalDate, ArrivalTime, Length, Breadth, Height, Weight, DestinationStationID, DeliveryDate FROM ConsignmentDetails GO CREATE PROCEDURE dbo.SelectConsignmentMaster AS SET NOCOUNT ON; SELECT ConsignmentID, ConsignorID, StationID, NoOfItems, ConsignmentDate, ItemValue, BillAmount FROM ConsignmentMaster

Page 51 of 227

GO CREATE PROCEDURE dbo.SelectConsignmentTypes AS SET NOCOUNT ON; SELECT ConsignmentTypeID, ConsignmentTypeName, Description FROM ConsignmentTypes GO CREATE PROCEDURE dbo.SelectConsignor AS SET NOCOUNT ON; SELECT ConsignorID, ConsignorName, CompanyName, Address, EmailID, Fax, Notes FROM Consignor GO CREATE PROCEDURE dbo.SelectRouteDetails AS SET NOCOUNT ON; SELECT RouteID, StartingPointID, EndingPointID, StopNo, Distance, VehicleNo, ArrivalTime, DepartureTime FROM RouteDetails GO CREATE PROCEDURE dbo.SelectRouteMaster AS SET NOCOUNT ON; SELECT RouteID, RouteName, StartingPointID, EndingPointingID, TotalDistance FROM RouteMaster GO CREATE PROCEDURE dbo.SelectStation AS SET NOCOUNT ON; SELECT StationID, StationName, Description FROM Station GO CREATE PROCEDURE dbo.SelectTariffs

Page 52 of 227

AS SET NOCOUNT ON; SELECT ConsingmentTypeID, Class, StartDistance, EndDistance, Rate FROM Tariffs GO CREATE PROCEDURE dbo.UpdateConsignmentDetails ( @ConSignmentID varchar(10), @Description varchar(100), @ConsignmentTypeID varchar(10), @Quantity int, @ArrivalDate datetime, @ArrivalTime datetime, @Length numeric(18), @Breadth numeric(18), @Height numeric(18), @Weight numeric(18), @DestinationStationID varchar(10), @DeliveryDate datetime, @Original_ConSignmentID varchar(10), @Original_ArrivalDate datetime, @Original_ArrivalTime datetime, @Original_Breadth numeric(18), @Original_ConsignmentTypeID varchar(10), @Original_DeliveryDate datetime, @Original_Description varchar(100), @Original_DestinationStationID varchar(10), @Original_Height numeric(18), @Original_Length numeric(18), @Original_Quantity int, @Original_Weight numeric(18)

Page 53 of 227

) AS SET NOCOUNT OFF; UPDATE ConsignmentDetails SET ConSignmentID = @ConSignmentID, Description = @Description, ConsignmentTypeID = @ConsignmentTypeID, Quantity = @Quantity, ArrivalDate = @ArrivalDate, ArrivalTime = @ArrivalTime, Length = @Length, Breadth = @Breadth, Height = @Height, Weight = @Weight, DestinationStationID = @DestinationStationID, DeliveryDate = @DeliveryDate WHERE (ConSignmentID = @Original_ConSignmentID) AND (ArrivalDate = @Original_ArrivalDate) AND (ArrivalTime = @Original_ArrivalTime) AND (Breadth = @Original_Breadth) AND (ConsignmentTypeID = @Original_ConsignmentTypeID) AND (DeliveryDate = @Original_DeliveryDate) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (DestinationStationID = @Original_DestinationStationID) AND (Height = @Original_Height) AND (Length = @Original_Length) AND (Quantity = @Original_Quantity) AND (Weight = @Original_Weight); SELECT ConSignmentID, Description, ConsignmentTypeID, Quantity, ArrivalDate, ArrivalTime, Length, Breadth, Height, Weight, DestinationStationID, DeliveryDate FROM ConsignmentDetails WHERE (ConSignmentID = @ConSignmentID) GO CREATE PROCEDURE dbo.UpdateConsignmentMaster ( @ConsignmentID varchar(10), @ConsignorID varchar(10), @StationID varchar(10), @NoOfItems int, @ConsignmentDate datetime, @ItemValue numeric(18), @BillAmount numeric(18),

Page 54 of 227

@Original_ConsignmentID varchar(10), @Original_BillAmount numeric(18), @Original_ConsignmentDate datetime, @Original_ConsignorID varchar(10), @Original_ItemValue numeric(18), @Original_NoOfItems int, @Original_StationID varchar(10) ) AS SET NOCOUNT OFF; UPDATE ConsignmentMaster SET ConsignmentID = @ConsignmentID, ConsignorID = @ConsignorID, StationID = @StationID, NoOfItems = @NoOfItems, ConsignmentDate = @ConsignmentDate, ItemValue = @ItemValue, BillAmount = @BillAmount WHERE (ConsignmentID = @Original_ConsignmentID) AND (BillAmount = @Original_BillAmount) AND (ConsignmentDate = @Original_ConsignmentDate) AND (ConsignorID = @Original_ConsignorID) AND (ItemValue = @Original_ItemValue) AND (NoOfItems = @Original_NoOfItems) AND (StationID = @Original_StationID); SELECT ConsignmentID, ConsignorID, StationID, NoOfItems, ConsignmentDate, ItemValue, BillAmount FROM ConsignmentMaster WHERE (ConsignmentID = @ConsignmentID) GO CREATE PROCEDURE dbo.UpdateConsignmentTypes ( @ConsignmentTypeID varchar(10), @ConsignmentTypeName varchar(50), @Description varchar(100), @Original_ConsignmentTypeID varchar(10), @Original_ConsignmentTypeName varchar(50), @Original_Description varchar(100) )

Page 55 of 227

AS SET NOCOUNT OFF; UPDATE ConsignmentTypes SET ConsignmentTypeID = @ConsignmentTypeID, ConsignmentTypeName = @ConsignmentTypeName, Description = @Description WHERE (ConsignmentTypeID = @Original_ConsignmentTypeID) AND (ConsignmentTypeName = @Original_ConsignmentTypeName) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL); SELECT ConsignmentTypeID, ConsignmentTypeName, Description FROM ConsignmentTypes WHERE (ConsignmentTypeID = @ConsignmentTypeID) GO CREATE PROCEDURE dbo.UpdateConsignor ( @ConsignorID varchar(10), @ConsignorName varchar(50), @CompanyName varchar(50), @Address varchar(100), @EmailID varchar(50), @Fax varchar(20), @Notes varchar(50), @Original_ConsignorID varchar(10), @Original_Address varchar(100), @Original_CompanyName varchar(50), @Original_ConsignorName varchar(50), @Original_EmailID varchar(50), @Original_Fax varchar(20), @Original_Notes varchar(50) ) AS SET NOCOUNT OFF;

Page 56 of 227

UPDATE Consignor SET ConsignorID = @ConsignorID, ConsignorName = @ConsignorName, CompanyName = @CompanyName, Address = @Address, EmailID = @EmailID, Fax = @Fax, Notes = @Notes WHERE (ConsignorID = @Original_ConsignorID) AND (Address = @Original_Address) AND (CompanyName = @Original_CompanyName) AND (ConsignorName = @Original_ConsignorName) AND (EmailID = @Original_EmailID) AND (Fax = @Original_Fax OR @Original_Fax IS NULL AND Fax IS NULL) AND (Notes = @Original_Notes OR @Original_Notes IS NULL AND Notes IS NULL); SELECT ConsignorID, ConsignorName, CompanyName, Address, EmailID, Fax, Notes FROM Consignor WHERE (ConsignorID = @ConsignorID) GO CREATE PROCEDURE dbo.UpdateRouteDetails ( @RouteID varchar(10), @StartingPointID varchar(10), @EndingPointID varchar(10), @StopNo int, @Distance numeric(18), @VehicleNo varchar(10), @ArrivalTime datetime, @DepartureTime datetime, @Original_EndingPointID varchar(10), @Original_RouteID varchar(10), @Original_StartingPointID varchar(10), @Original_ArrivalTime datetime, @Original_DepartureTime datetime, @Original_Distance numeric(18), @Original_StopNo int, @Original_VehicleNo varchar(10) ) AS

Page 57 of 227

SET NOCOUNT OFF; UPDATE RouteDetails SET RouteID = @RouteID, StartingPointID = @StartingPointID, EndingPointID = @EndingPointID, StopNo = @StopNo, Distance = @Distance, VehicleNo = @VehicleNo, ArrivalTime = @ArrivalTime, DepartureTime = @DepartureTime WHERE (EndingPointID = @Original_EndingPointID) AND (RouteID = @Original_RouteID) AND (StartingPointID = @Original_StartingPointID) AND (ArrivalTime = @Original_ArrivalTime) AND (DepartureTime = @Original_DepartureTime) AND (Distance = @Original_Distance) AND (StopNo = @Original_StopNo) AND (VehicleNo = @Original_VehicleNo); SELECT RouteID, StartingPointID, EndingPointID, StopNo, Distance, VehicleNo, ArrivalTime, DepartureTime FROM RouteDetails WHERE (EndingPointID = @EndingPointID) AND (RouteID = @RouteID) AND (StartingPointID = @StartingPointID) GO CREATE PROCEDURE dbo.UpdateRouteMaster ( @RouteID varchar(10), @RouteName varchar(50), @StartingPointID varchar(10), @EndingPointingID varchar(10), @TotalDistance numeric(18), @Original_RouteID varchar(10), @Original_EndingPointingID varchar(10), @Original_RouteName varchar(50), @Original_StartingPointID varchar(10), @Original_TotalDistance numeric(18) ) AS SET NOCOUNT OFF;

Page 58 of 227

UPDATE RouteMaster SET RouteID = @RouteID, RouteName = @RouteName, StartingPointID = @StartingPointID, EndingPointingID = @EndingPointingID, TotalDistance = @TotalDistance WHERE (RouteID = @Original_RouteID) AND (EndingPointingID = @Original_EndingPointingID) AND (RouteName = @Original_RouteName) AND (StartingPointID = @Original_StartingPointID) AND (TotalDistance = @Original_TotalDistance); SELECT RouteID, RouteName, StartingPointID, EndingPointingID, TotalDistance FROM RouteMaster WHERE (RouteID = @RouteID) GO CREATE PROCEDURE dbo.UpdateStation ( @StationID varchar(10), @StationName varchar(50), @Description varchar(100), @Original_StationID varchar(10), @Original_Description varchar(100), @Original_StationName varchar(50) ) AS SET NOCOUNT OFF; UPDATE Station SET StationID = @StationID, StationName = @StationName, Description = @Description WHERE (StationID = @Original_StationID) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (StationName = @Original_StationName); SELECT StationID, StationName, Description FROM Station WHERE (StationID = @StationID) GO CREATE PROCEDURE dbo.UpdateTariffs ( @ConsingmentTypeID varchar(10), @Class varchar(50),

Page 59 of 227

@StartDistance numeric(18), @EndDistance numeric(18), @Rate numeric(18), @Original_ConsingmentTypeID varchar(10), @Original_Class varchar(50), @Original_EndDistance numeric(18), @Original_Rate numeric(18), @Original_StartDistance numeric(18) ) AS SET NOCOUNT OFF; UPDATE Tariffs SET ConsingmentTypeID = @ConsingmentTypeID, Class = @Class, StartDistance = @StartDistance, EndDistance = @EndDistance, Rate = @Rate WHERE (ConsingmentTypeID = @Original_ConsingmentTypeID) AND (Class = @Original_Class) AND (EndDistance = @Original_EndDistance) AND (Rate = @Original_Rate) AND (StartDistance = @Original_StartDistance); SELECT ConsingmentTypeID, Class, StartDistance, EndDistance, Rate FROM Tariffs WHERE (ConsingmentTypeID = @ConsingmentTypeID) GO

Page 60 of 227

3.4.

User Interface design

Input/Output Design

Fig1: Login Screen of Shipping Management System


The above Login Screen is the gateway of the Shipping Management System. When the Administrator starts using Shipping Management System the above screen will appear and whenever the administrator puts the proper Password he will be able to enter into this system. This splash screen is meant for preventing unauthorized people form entering into the system.

Page 61 of 227

Fig2: Main Screen of Shipping Management System


This is the main screen of Shipping Management System. User has to click on the menu to work for a specific work.

Page 62 of 227

Fig3: Screen to add a Consignor details


This is the screen to add a Consignor of the Shipping. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 63 of 227

Fig4: Screen to edit a Consignor details This is the screen to edit a Consignor of the Shipping. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 64 of 227

Fig5: Screen to add a Vehicle detail This is the screen to add a vehicle of the Shipping. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 65 of 227

Fig6: Screen to edit Vehicle details This is the screen to edit a vehicle of the Shipping. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 66 of 227

Fig7: Screen to add a Route detail This is the screen to add a Route. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 67 of 227

Fig8: Screen to edit a Route details This is the screen to edit a route. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 68 of 227

Fig9: Screen to add Consignment This is the screen to add a Consignment. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 69 of 227

Fig10: Screen to edit Consignment details This is the screen to edit a Consignment. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 70 of 227

Fig11: Screen to Change Password This is the screen to change the password. User has to input all the data fields and click on the ok button to change the data. The exit button will help to exit from this window and return to main menu.

Page 71 of 227

Fig12: Screen to add Tariff detail This is the screen to add Tariff. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 72 of 227

Fig13: Screen to edit Tariff details This is the screen to edit Tariff of the Shipping. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 73 of 227

Fig14: Screen to add Station detail This is the screen to add Station. User has to input all the data fields and click on the save button to save the data. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Fig15: Screen to edit Station details This is the screen to edit Station of the Shipping. User has to modify the data fields and click on the update button to save the data. User can delete the record by clicking on the delete button. The cancel button is to cancel the data inputted in the fields. The exit button will help to exit from this window and return to main menu.

Page 74 of 227

4. Coding

4.1.

Complete Project Coding BACKEND ARCHITECTURE

DAShippingBaseClass.vb
Imports Microsoft.Win32 Imports System.Configuration Imports System.Data.sqlclient Public Class DAShippingBaseClass Implements IDisposable Public Connection As OracleConnection Public Command As SqlCommand Public DataAdapter As OracleDataAdapter Public SQL As String Public Sub New() Try Connection = New OracleConnection("Server=SERVER;UID=Scott;Pwd=Tiger) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally End Try End Sub Public Sub Dispose() Implements System.IDisposable.Dispose If Not DataAdapter Is Nothing Then DataAdapter.Dispose() DataAdapter = Nothing End If If Not Connection Is Nothing Then Connection.Close() Connection.Dispose()

Page 75 of 227

Connection = Nothing End If End Sub Public Sub InitializeCommand() If Command Is Nothing Then Try Command = New SqlCommand(SQL, Connection) If Not SQL.ToUpper.StartsWith("SELECT ") _ And Not SQL.ToUpper.StartsWith("INSERT ") _ And Not SQL.ToUpper.StartsWith("UPDATE ") _ And Not SQL.ToUpper.StartsWith("DELETE ") Then Command.CommandType = CommandType.StoredProcedure End If Catch ex As SqlException Throw New System.Exception(ex.Message, ex.InnerException) End Try End If End Sub Private Sub InitializeDataAdapter() Try DataAdapter = New OracleDataAdapter DataAdapter.SelectCommand = Command Catch ex As SqlException Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Public Sub FillDataSet(ByRef oDataSet As DataSet, ByVal TableName As String) Try InitializeCommand() InitializeDataAdapter() DataAdapter.Fill(oDataSet, TableName) Catch ex As SqlException Throw New System.Exception(ex.Message, ex.InnerException) Finally Command.Dispose() Command = Nothing DataAdapter.Dispose() DataAdapter = Nothing End Try End Sub Public Sub AddParameter(ByVal Name As String, ByVal Type As SqlDbType, ByVal Size As Integer, ByVal Value As Object) Try Command.Parameters.Add(Name, Type, Size).Value = Value Catch ex As SqlException Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Public Sub OpenConnection()

Page 76 of 227

Try

Connection.Open() Catch ex As SqlException Throw New System.Exception(ex.Message, ex.InnerException) Catch InvalidEx As InvalidOperationException Throw New System.Exception(InvalidEx.Message, InvalidEx.InnerException) End Try End Sub Public Sub CloseConnection() Connection.Close() End Sub Public Function ExecuteStoredProcedure() As Integer Try OpenConnection() ExecuteStoredProcedure = Command.ExecuteNonQuery Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally CloseConnection() End Try End Function End Class

DAConsignmentDetails.vb
Public Class DAConsignmentDetails Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetConsignmentDetails() As DataSet Try GetConsignmentDetails = New DataSet MyBase.SQL = "SelectConsignmentDetails" MyBase.FillDataSet(GetConsignmentDetails, "ConsignmentDetails") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentDetails(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentDetails = New DataSet

Page 77 of 227

MyBase.SQL = "SelectConsignmentDetails" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentDetailsID", SqlDbType.VarChar, 10, ConsignmentTypeID) MyBase.FillDataSet(GetConsignmentDetails, "ConsignmentDetails") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignmentDetails(ByVal ConsignmentDetails As DataSet) As Boolean Try MyBase.SQL = "InsertConsignmentDetails" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Consignme ntTypeID")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Descripti on")) MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Consignme ntTypeID")) MyBase.AddParameter("@Quantity", SqlDbType.Int, 4, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Quantity" )) MyBase.AddParameter("@ArrivalDate", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("ArrivalDa te")) MyBase.AddParameter("@ArrivalTime", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("ArrivalTi me")) MyBase.AddParameter("@Length", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Length")) MyBase.AddParameter("@Breadth", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Breadth")) MyBase.AddParameter("@Height", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Height")) MyBase.AddParameter("@Weigth", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Weight")) MyBase.AddParameter("@DestinationStationID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Destinati onStatioinID")) MyBase.AddParameter("@DeliveryDate", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("DeliveryD ate")) AddConsignmentDetails = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try

Page 78 of 227

End Function Public Function DeleteConsignmentDetails(ByVal ConsignmentDetailsID As String) As Boolean MyBase.SQL = "DeleteConsignmentDetails" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentDetailsID", SqlDbType.VarChar, 10, ConsignmentDetailsID) DeleteConsignmentDetails = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentDetails(ByVal ConsignmentDetails As DataSet) As Boolean Try MyBase.SQL = "UpdateConsignmentDetails" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Consignme ntTypeID")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Descripti on")) MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Consignme ntTypeID")) MyBase.AddParameter("@Quantity", SqlDbType.Int, 4, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Quantity" )) MyBase.AddParameter("@ArrivalDate", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("ArrivalDa te")) MyBase.AddParameter("@ArrivalTime", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("ArrivalTi me")) MyBase.AddParameter("@Length", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Length")) MyBase.AddParameter("@Breadth", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Breadth")) MyBase.AddParameter("@Height", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Height")) MyBase.AddParameter("@Weigth", SqlDbType.Float, 18, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Weight")) MyBase.AddParameter("@DestinationStationID", SqlDbType.VarChar, 10, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Destinati onStatioinID")) MyBase.AddParameter("@DeliveryDate", SqlDbType.DateTime, 8, ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("DeliveryD ate")) UpdateConsignmentDetails = ExecuteStoredProcedure() Try

Page 79 of 227

Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DAConsignmentMaster.vb
Public Class DAConsignmentMaster Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetConsignmentMaster() As DataSet Try GetConsignmentMaster = New DataSet MyBase.SQL = "SelectConsignmentMaster" MyBase.FillDataSet(GetConsignmentMaster, "ConsignmentMaster") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentMaster(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentMaster = New DataSet MyBase.SQL = "SelectConsignmentMaster" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentMasterID", SqlDbType.VarChar, 10, ConsignmentTypeID) MyBase.FillDataSet(GetConsignmentMaster, "ConsignmentMaster") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignmentMaster(ByVal ConsignmentMaster As DataSet) As Boolean Try MyBase.SQL = "InsertConsignmentMaster" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("Consignment TypeID"))

Page 80 of 227

MyBase.AddParameter("@ConsignorID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("ConsignorID ")) MyBase.AddParameter("@StationID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("StationID")) MyBase.AddParameter("@NoofItems", SqlDbType.Int, 4, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("NoOfItems")) MyBase.AddParameter("@ConsignmentDate", SqlDbType.DateTime, 8, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("Consignment Date")) MyBase.AddParameter("@ItemValue", SqlDbType.Float, 18, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("ItemValue")) MyBase.AddParameter("@BillAmount", SqlDbType.Float, 18, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("BillAmount" )) AddConsignmentMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignmentMaster(ByVal ConsignmentMasterID As String) As Boolean Try MyBase.SQL = "DeleteConsignmentMaster" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentMasterID", SqlDbType.VarChar, 10, ConsignmentMasterID) DeleteConsignmentMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentMaster(ByVal ConsignmentMaster As DataSet) As Boolean Try MyBase.SQL = "UpdateConsignmentMaster" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("Consignment TypeID")) MyBase.AddParameter("@ConsignorID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("ConsignorID ")) MyBase.AddParameter("@StationID", SqlDbType.VarChar, 10, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("StationID")) MyBase.AddParameter("@NoofItems", SqlDbType.Int, 4, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("NoOfItems")) MyBase.AddParameter("@ConsignmentDate", SqlDbType.DateTime, 8, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("Consignment Date"))

Page 81 of 227

MyBase.AddParameter("@ItemValue", SqlDbType.Float, 18, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("ItemValue")) MyBase.AddParameter("@BillAmount", SqlDbType.Float, 18, ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("BillAmount" )) UpdateConsignmentMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DAConsignmentTypes.vb
Public Class DAConsignmentTypes Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetConsignmentTypes() As DataSet Try GetConsignmentTypes = New DataSet MyBase.SQL = "SelectConsignmentTypes" MyBase.FillDataSet(GetConsignmentTypes, "ConsignmentTypes") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentTypes(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentTypes = New DataSet MyBase.SQL = "SelectConsignmentTypes" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypesID", SqlDbType.VarChar, 10, ConsignmentTypeID) MyBase.FillDataSet(GetConsignmentTypes, "ConsignmentTypes") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignmentTypes(ByVal ConsignmentTypes As DataSet) As Boolean Try MyBase.SQL = "InsertConsignmentTypes"

Page 82 of 227

MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("ConsignmentTy peID")) MyBase.AddParameter("@ConsignmentTypeName", SqlDbType.VarChar, 50, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("ConsignmentTy peName")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("Description")) AddConsignmentTypes = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignmentTypes(ByVal ConsignmentTypesID As String) As Boolean Try MyBase.SQL = "DeleteConsignmentTypes" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypesID", SqlDbType.VarChar, 10, ConsignmentTypesID) DeleteConsignmentTypes = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentTypes(ByVal ConsignmentTypes As DataSet) As Boolean Try MyBase.SQL = "UpdateConsignmentTypes" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("ConsignmentTy peID")) MyBase.AddParameter("@ConsignmentTypeName", SqlDbType.VarChar, 50, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("ConsignmentTy peName")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("Description")) UpdateConsignmentTypes = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Page 83 of 227

DAConsignor.vb
Public Class DAConsignor Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetConsignors() As DataSet Try GetConsignors = New DataSet MyBase.SQL = "SelectConsignors" MyBase.FillDataSet(GetConsignors, "Consignor") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignor(ByVal ConsignorID As String) As DataSet Try GetConsignor = New DataSet MyBase.SQL = "SelectConsignor" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignorID", SqlDbType.VarChar, 10, ConsignorID) MyBase.FillDataSet(GetConsignor, "Consignor") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignor(ByVal Consignor As DataSet) As Boolean Try MyBase.SQL = "InsertConsignor" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignorID", SqlDbType.VarChar, 10, Consignor.Tables("Consignor").Rows(0).Item("ConsignorID")) MyBase.AddParameter("@ConsignorNAME", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("ConsignorNAME")) MyBase.AddParameter("@CompanyName", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("CompanyName")) MyBase.AddParameter("@Address", SqlDbType.VarChar, 100, Consignor.Tables("Consignor").Rows(0).Item("Address")) MyBase.AddParameter("@EmailID", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("EmailID")) MyBase.AddParameter("@Fax", SqlDbType.VarChar, 20, Consignor.Tables("Consignor").Rows(0).Item("Fax")) MyBase.AddParameter("@Notes", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("Notes"))

Page 84 of 227

AddConsignor = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignor(ByVal ConsignorID As String) As Boolean Try MyBase.SQL = "DeleteConsignor" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignorID", SqlDbType.Char, 10,

ConsignorID)

DeleteConsignor = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignor(ByVal Consignor As DataSet) As Boolean Try MyBase.SQL = "UpdateConsignor" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignorID", SqlDbType.VarChar, 10, Consignor.Tables("Consignor").Rows(0).Item("ConsignorID")) MyBase.AddParameter("@ConsignorNAME", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("ConsignorNAME")) MyBase.AddParameter("@CompanyName", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("CompanyName")) MyBase.AddParameter("@Address", SqlDbType.VarChar, 100, Consignor.Tables("Consignor").Rows(0).Item("Address")) MyBase.AddParameter("@EmailID", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("EmailID")) MyBase.AddParameter("@Fax", SqlDbType.VarChar, 20, Consignor.Tables("Consignor").Rows(0).Item("Fax")) MyBase.AddParameter("@Notes", SqlDbType.VarChar, 50, Consignor.Tables("Consignor").Rows(0).Item("Notes")) UpdateConsignor = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DAPwdInfo.vb
Public Class DAPwdInfo Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub

Page 85 of 227

Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetPwdInfo() As DataSet Try GetPwdInfo = New DataSet MyBase.SQL = "SelectPwdInfo" MyBase.FillDataSet(GetPwdInfo, "PwdInfo") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetPwdInfo(ByVal EmpID As String) As DataSet Try GetPwdInfo = New DataSet MyBase.SQL = "SelectPwdInfo" MyBase.InitializeCommand() MyBase.AddParameter("@EmpID", SqlDbType.Char, 16, EmpID) MyBase.FillDataSet(GetPwdInfo, "PwdInfo") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddPwdInfo(ByVal PwdInfo As DataSet) As Boolean Try MyBase.SQL = "InsertPwdInfo" MyBase.InitializeCommand() MyBase.AddParameter("@EmpID", SqlDbType.Char, 16, PwdInfo.Tables("PwdInfo").Rows(0).Item("EmpID")) MyBase.AddParameter("@UserName", SqlDbType.Decimal, 10, PwdInfo.Tables("PwdInfo").Rows(0).Item("UserName")) MyBase.AddParameter("@Password", SqlDbType.Decimal, 10, PwdInfo.Tables("PwdInfo").Rows(0).Item("Password")) AddPwdInfo = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeletePwdInfo(ByVal EmpID As String) As Boolean Try MyBase.SQL = "DeletePwdInfo" MyBase.InitializeCommand() MyBase.AddParameter("@EmpID", SqlDbType.Char, 16, EmpID) DeletePwdInfo = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdatePwdInfo(ByVal PwdInfo As DataSet) As Boolean

Page 86 of 227

MyBase.SQL = "UpdatePwdInfo" MyBase.InitializeCommand() MyBase.AddParameter("@EmpID", SqlDbType.Char, 16, PwdInfo.Tables("PwdInfo").Rows(0).Item("EmpID")) MyBase.AddParameter("@UserName", SqlDbType.Decimal, 10, PwdInfo.Tables("PwdInfo").Rows(0).Item("UserName")) MyBase.AddParameter("@Password", SqlDbType.Decimal, 10, PwdInfo.Tables("PwdInfo").Rows(0).Item("Password")) UpdatePwdInfo = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Try

DARouteDetails.vb
Public Class DARouteDetails Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetRouteDetails() As DataSet Try GetRouteDetails = New DataSet MyBase.SQL = "SelectRouteDetails" MyBase.FillDataSet(GetRouteDetails, "RouteDetails") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetRouteDetails(ByVal RouteID As String) As DataSet Try GetRouteDetails = New DataSet MyBase.SQL = "SelectRouteDetails" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteID) MyBase.FillDataSet(GetRouteDetails, "RouteDetails") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function

Page 87 of 227

Public Function AddRouteDetails(ByVal RouteDetails As DataSet) As Boolean Try MyBase.SQL = "InsertRouteDetails" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("RouteID")) MyBase.AddParameter("@StartingPointID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("StartingPointID")) MyBase.AddParameter("@EndingPointID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("EndingPointID")) MyBase.AddParameter("@StopNo", SqlDbType.Int, 4, RouteDetails.Tables("RouteDetails").Rows(0).Item("StopNo")) MyBase.AddParameter("@Distance", SqlDbType.Float, 18, RouteDetails.Tables("RouteDetails").Rows(0).Item("Distance")) MyBase.AddParameter("@VehicleNo", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("VehicleNo")) MyBase.AddParameter("@ArrivalTime", SqlDbType.DateTime, 8, RouteDetails.Tables("RouteDetails").Rows(0).Item("ArrivalTime")) MyBase.AddParameter("@DepartureTime", SqlDbType.DateTime, 8, RouteDetails.Tables("RouteDetails").Rows(0).Item("DepartureTime")) AddRouteDetails = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteRouteDetails(ByVal RouteID As String) As Boolean Try MyBase.SQL = "DeleteRouteDetails" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10,

RouteID)

DeleteRouteDetails = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try

End Function Public Function UpdateRouteDetails(ByVal RouteDetails As DataSet) As Boolean Try MyBase.SQL = "UpdateRouteDetails" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("RouteID")) MyBase.AddParameter("@StartingPointID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("StartingPointID")) MyBase.AddParameter("@EndingPointID", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("EndingPointID")) MyBase.AddParameter("@StopNo", SqlDbType.Int, 4, RouteDetails.Tables("RouteDetails").Rows(0).Item("StopNo")) MyBase.AddParameter("@Distance", SqlDbType.Float, 18, RouteDetails.Tables("RouteDetails").Rows(0).Item("Distance"))

Page 88 of 227

MyBase.AddParameter("@VehicleNo", SqlDbType.VarChar, 10, RouteDetails.Tables("RouteDetails").Rows(0).Item("VehicleNo")) MyBase.AddParameter("@ArrivalTime", SqlDbType.DateTime, 8, RouteDetails.Tables("RouteDetails").Rows(0).Item("ArrivalTime")) MyBase.AddParameter("@DepartureTime", SqlDbType.DateTime, 8, RouteDetails.Tables("RouteDetails").Rows(0).Item("DepartureTime")) UpdateRouteDetails = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DARouteMaster.vb
Public Class DARouteMaster Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetRouteMaster() As DataSet Try GetRouteMaster = New DataSet MyBase.SQL = "SelectRouteMaster" MyBase.FillDataSet(GetRouteMaster, "RouteMaster") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetRouteMaster(ByVal RouteID As String) As DataSet Try GetRouteMaster = New DataSet MyBase.SQL = "SelectRouteMaster" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteID) MyBase.FillDataSet(GetRouteMaster, "RouteMaster") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddRouteMaster(ByVal RouteMaster As DataSet) As Boolean Try

Page 89 of 227

MyBase.SQL = "InsertRouteMaster" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("RouteID")) MyBase.AddParameter("@RouteNAME", SqlDbType.VarChar, 50, RouteMaster.Tables("RouteMaster").Rows(0).Item("RouteNAME")) MyBase.AddParameter("@StartingPointID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("StartingPointID")) MyBase.AddParameter("@EndingPointID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("EndingPointID")) MyBase.AddParameter("@TotalDistance", SqlDbType.Float, 18, RouteMaster.Tables("RouteMaster").Rows(0).Item("TotalDistance")) AddRouteMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteRouteMaster(ByVal RouteID As String) As Boolean Try MyBase.SQL = "DeleteRouteMaster" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, DeleteRouteMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateRouteMaster(ByVal RouteMaster As DataSet) As Boolean Try MyBase.SQL = "UpdateRouteMaster" MyBase.InitializeCommand() MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("RouteID")) MyBase.AddParameter("@RouteNAME", SqlDbType.VarChar, 50, RouteMaster.Tables("RouteMaster").Rows(0).Item("RouteNAME")) MyBase.AddParameter("@StartingPointID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("StartingPointID")) MyBase.AddParameter("@EndingPointID", SqlDbType.VarChar, 10, RouteMaster.Tables("RouteMaster").Rows(0).Item("EndingPointID")) MyBase.AddParameter("@TotalDistance", SqlDbType.Float, 18, RouteMaster.Tables("RouteMaster").Rows(0).Item("TotalDistance")) UpdateRouteMaster = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

RouteID)

DAStation.vb Page 90 of 227

Public Class DAStation Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetStation() As DataSet Try GetStation = New DataSet MyBase.SQL = "SelectStation" MyBase.FillDataSet(GetStation, "Station") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetStation(ByVal StationID As String) As DataSet Try GetStation = New DataSet MyBase.SQL = "SelectStation" MyBase.InitializeCommand() MyBase.AddParameter("@StationID", SqlDbType.Char, 10, StationID) MyBase.FillDataSet(GetStation, "Station") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddStation(ByVal Station As DataSet) As Boolean Try MyBase.SQL = "InsertStation" MyBase.InitializeCommand() MyBase.AddParameter("@StationID", SqlDbType.VarChar, 10, Station.Tables("Station").Rows(0).Item("StationID")) MyBase.AddParameter("@StationName", SqlDbType.VarChar, 50, Station.Tables("Station").Rows(0).Item("StationName")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, Station.Tables("Station").Rows(0).Item("Description")) AddStation = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteStation(ByVal StationID As String) As Boolean Try MyBase.SQL = "DeleteStation"

Page 91 of 227

MyBase.InitializeCommand() MyBase.AddParameter("@StationID", SqlDbType.VarChar, 10, StationID) DeleteStation = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try

End Function Public Function UpdateStation(ByVal Station As DataSet) As Boolean Try MyBase.SQL = "UpdateStation" MyBase.InitializeCommand() MyBase.AddParameter("@StationID", SqlDbType.VarChar, 10, Station.Tables("Station").Rows(0).Item("StationID")) MyBase.AddParameter("@StationName", SqlDbType.VarChar, 50, Station.Tables("Station").Rows(0).Item("StationName")) MyBase.AddParameter("@Description", SqlDbType.VarChar, 100, Station.Tables("Station").Rows(0).Item("Description")) UpdateStation = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DATariff.vb
Public Class DATariffs Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Function GetTariffs() As DataSet Try GetTariffs = New DataSet MyBase.SQL = "SelectTariffs" MyBase.FillDataSet(GetTariffs, "Tariffs") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetTariffs(ByVal ConsignmentTypeID As String) As DataSet

Page 92 of 227

GetTariffs = New DataSet MyBase.SQL = "SelectTariffs" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.Char, 10, ConsignmentTypeID) MyBase.FillDataSet(GetTariffs, "Tariffs") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddTariffs(ByVal Tariffs As DataSet) As Boolean Try MyBase.SQL = "InsertTariffs" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, Tariffs.Tables("Tariffs").Rows(0).Item("ConsignmentTypeID")) MyBase.AddParameter("@Class", SqlDbType.VarChar, 50, Tariffs.Tables("Tariffs").Rows(0).Item("Class")) MyBase.AddParameter("@StartDistance", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("StartDistance")) MyBase.AddParameter("@EndDistance", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("EndDistance")) MyBase.AddParameter("@Rate", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("Rate")) AddTariffs = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteTariffs(ByVal ConsignmentTypeID As String) As Boolean Try MyBase.SQL = "DeleteTariffs" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, ConsignmentTypeID) DeleteTariffs = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateTariffs(ByVal Tariffs As DataSet) As Boolean Try MyBase.SQL = "UpdateTariffs" MyBase.InitializeCommand() MyBase.AddParameter("@ConsignmentTypeID", SqlDbType.VarChar, 10, Tariffs.Tables("Tariffs").Rows(0).Item("ConsignmentTypeID")) MyBase.AddParameter("@Class", SqlDbType.VarChar, 50, Tariffs.Tables("Tariffs").Rows(0).Item("Class"))

Try

Page 93 of 227

MyBase.AddParameter("@StartDistance", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("StartDistance")) MyBase.AddParameter("@EndDistance", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("EndDistance")) MyBase.AddParameter("@Rate", SqlDbType.Float, 18, Tariffs.Tables("Tariffs").Rows(0).Item("Rate")) UpdateTariffs = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

DAVehicles.vb
Public Class DAVehicles Inherits ShippingDataAccess.DAShippingBaseClass Public Sub New() MyBase.New() End Sub Public Shadows Sub Dispose() MyBase.Dispose() End Sub Public Overloads Function GetVehicles() As DataSet Try GetVehicles = New DataSet MyBase.SQL = "SelectVehicles" MyBase.FillDataSet(GetVehicles, "Vehicles") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Overloads Function GetVehicles(ByVal VehicleNo As String) As DataSet Try GetVehicles = New DataSet MyBase.SQL = "SelectVehicles" MyBase.InitializeCommand() MyBase.AddParameter("@VehicleNo", SqlDbType.Char, 10, VehicleNo) MyBase.FillDataSet(GetVehicles, "Vehicles") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function

Page 94 of 227

Public Function AddVehicles(ByVal Vehicles As DataSet) As Boolean Try MyBase.SQL = "InsertVehicles" MyBase.InitializeCommand() MyBase.AddParameter("@VehicleNo", SqlDbType.VarChar, 10, Vehicles.Tables("Vehicles").Rows(0).Item("VehicleNo")) MyBase.AddParameter("@VehicleName", SqlDbType.VarChar, 50, Vehicles.Tables("Vehicles").Rows(0).Item("VehicleName")) MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, Vehicles.Tables("Vehicles").Rows(0).Item("RouteID")) AddVehicles = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteVehicles(ByVal VehicleNo As String) As Boolean Try MyBase.SQL = "DeleteVehicles" MyBase.InitializeCommand() MyBase.AddParameter("@VehicleNo", SqlDbType.VarChar, 10,

VehicleNo)

DeleteVehicles = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateVehicles(ByVal Vehicles As DataSet) As Boolean Try MyBase.SQL = "UpdateVehicles" MyBase.InitializeCommand() MyBase.AddParameter("@VehicleNo", SqlDbType.VarChar, 10, Vehicles.Tables("Vehicles").Rows(0).Item("VehicleNo")) MyBase.AddParameter("@VehicleName", SqlDbType.VarChar, 50, Vehicles.Tables("Vehicles").Rows(0).Item("VehicleName")) MyBase.AddParameter("@RouteID", SqlDbType.VarChar, 10, Vehicles.Tables("Vehicles").Rows(0).Item("RouteID")) UpdateVehicles = ExecuteStoredProcedure() Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Middle Level Architecture


DAConsignmentDetails.vb
Public Class BLConsignmentDetails

Page 95 of 227

Implements IDisposable Private DAConsignmentDetails As ShippingDataAccess.DAConsignmentDetails Public Sub New() DAConsignmentDetails = New ShippingDataAccess.DAConsignmentDetails End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAConsignmentDetails.Dispose() DAConsignmentDetails = Nothing End Sub Public Function GetConsignmentDetails() As DataSet Try GetConsignmentDetails = DAConsignmentDetails.GetConsignmentDetails Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentDetails(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentDetails = DAConsignmentDetails.GetConsignmentDetails(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignmentDetails(ByVal ConsignmentDetails As DataSet) As Boolean Try If ConsignmentDetails.Tables("ConsignmentDetails").Rows(0).Item("Consignme ntTypeID").ToString.Trim.Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DAConsignmentDetails.AddConsignmentDetails(ConsignmentDetails) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignmentDetails(ByVal ConsignmentTypeID As String) As Boolean Try Return DAConsignmentDetails.DeleteConsignmentDetails(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentDetails(ByVal ConsignmentDetails As DataSet) As Boolean

Page 96 of 227

Return DAConsignmentDetails.UpdateConsignmentDetails(ConsignmentDetails) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Try

BLConsignmentMaster.vb
Public Class BLConsignmentMaster Implements IDisposable Private DAConsignmentMaster As ShippingDataAccess.DAConsignmentMaster Public Sub New() DAConsignmentMaster = New ShippingDataAccess.DAConsignmentMaster End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAConsignmentMaster.Dispose() DAConsignmentMaster = Nothing End Sub Public Function GetConsignmentMaster() As DataSet Try GetConsignmentMaster = DAConsignmentMaster.GetConsignmentMaster Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentMaster(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentMaster = DAConsignmentMaster.GetConsignmentMaster(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignmentMaster(ByVal ConsignmentMaster As DataSet) As Boolean Try If ConsignmentMaster.Tables("ConsignmentMaster").Rows(0).Item("Consignment TypeID").ToString.Trim.Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DAConsignmentMaster.AddConsignmentMaster(ConsignmentMaster) Catch ex As Exception

Page 97 of 227

Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignmentMaster(ByVal ConsignmentTypeID As String) As Boolean Try Return DAConsignmentMaster.DeleteConsignmentMaster(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentMaster(ByVal ConsignmentMaster As DataSet) As Boolean Try Return DAConsignmentMaster.UpdateConsignmentMaster(ConsignmentMaster) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLConsignmentTypes.vb
Public Class BLConsignmentTypes Implements IDisposable Private DAConsignmentTypes As ShippingDataAccess.DAConsignmentTypes Public Sub New() DAConsignmentTypes = New ShippingDataAccess.DAConsignmentTypes End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAConsignmentTypes.Dispose() DAConsignmentTypes = Nothing End Sub Public Function GetConsignmentTypes() As DataSet Try GetConsignmentTypes = DAConsignmentTypes.GetConsignmentTypes Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignmentTypes(ByVal ConsignmentTypeID As String) As DataSet Try GetConsignmentTypes = DAConsignmentTypes.GetConsignmentTypes(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException)

Page 98 of 227

End Try End Function Public Function AddConsignmentTypes(ByVal ConsignmentTypes As DataSet) As Boolean Try If ConsignmentTypes.Tables("ConsignmentTypes").Rows(0).Item("ConsignmentTy peID").ToString.Trim.Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DAConsignmentTypes.AddConsignmentTypes(ConsignmentTypes) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignmentTypes(ByVal ConsignmentTypeID As String) As Boolean Try Return DAConsignmentTypes.DeleteConsignmentTypes(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignmentTypes(ByVal ConsignmentTypes As DataSet) As Boolean Try Return DAConsignmentTypes.UpdateConsignmentTypes(ConsignmentTypes) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLConsignor.vb
Public Class BLConsignor Implements IDisposable Private DAConsignor As ShippingDataAccess.DAConsignor Public Sub New() DAConsignor = New ShippingDataAccess.DAConsignor End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAConsignor.Dispose() DAConsignor = Nothing End Sub

Page 99 of 227

Public Function GetConsignors() As DataSet Try GetConsignors = DAConsignor.GetConsignors Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetConsignor(ByVal ConsignorID As String) As DataSet Try GetConsignor = DAConsignor.GetConsignor(ConsignorID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddConsignor(ByVal Consignor As DataSet) As Boolean Try If Consignor.Tables("Consignor").Rows(0).Item("ConsignorID").ToString.Trim .Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DAConsignor.AddConsignor(Consignor) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteConsignor(ByVal ConsignorID As String) As Boolean Try Return DAConsignor.DeleteConsignor(ConsignorID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateConsignor(ByVal Consignor As DataSet) As Boolean Try Return DAConsignor.UpdateConsignor(Consignor) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLRouteDetails.vb
Public Class BLRouteDetails Implements IDisposable Private DARouteDetails As ShippingDataAccess.DARouteDetails Public Sub New() DARouteDetails = New ShippingDataAccess.DARouteDetails

Page 100 of 227

End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DARouteDetails.Dispose() DARouteDetails = Nothing End Sub Public Function GetRouteDetails() As DataSet Try GetRouteDetails = DARouteDetails.GetRouteDetails Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetRouteDetails(ByVal RouteID As String) As DataSet Try GetRouteDetails = DARouteDetails.GetRouteDetails(RouteID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddRouteDetails(ByVal RouteDetails As DataSet) As Boolean Try If RouteDetails.Tables("RouteDetails").Rows(0).Item("RouteID").ToString.Tr im.Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DARouteDetails.AddRouteDetails(RouteDetails) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteRouteDetails(ByVal RouteID As String) As Boolean Try Return DARouteDetails.DeleteRouteDetails(RouteID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateRouteDetails(ByVal RouteDetails As DataSet) As Boolean Try Return DARouteDetails.UpdateRouteDetails(RouteDetails) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLRouteMaster.vb

Page 101 of 227

Public Class BLRouteMaster Implements IDisposable Private DARouteMaster As ShippingDataAccess.DARouteMaster Public Sub New() DARouteMaster = New ShippingDataAccess.DARouteMaster End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DARouteMaster.Dispose() DARouteMaster = Nothing End Sub Public Function GetRouteMaster() As DataSet Try GetRouteMaster = DARouteMaster.GetRouteMaster Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetRouteMaster(ByVal RouteID As String) As DataSet Try GetRouteMaster = DARouteMaster.GetRouteMaster(RouteID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddRouteMaster(ByVal RouteMaster As DataSet) As Boolean Try If RouteMaster.Tables("RouteMaster").Rows(0).Item("RouteID").ToString.Trim .Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DARouteMaster.AddRouteMaster(RouteMaster) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteRouteMaster(ByVal RouteID As String) As Boolean Try Return DARouteMaster.DeleteRouteMaster(RouteID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateRouteMaster(ByVal RouteMaster As DataSet) As Boolean Try Return DARouteMaster.UpdateRouteMaster(RouteMaster) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function

Page 102 of 227

End Class

BLStation.vb
Public Class BLStation Implements IDisposable Private DAStation As ShippingDataAccess.DAStation Public Sub New() DAStation = New ShippingDataAccess.DAStation End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAStation.Dispose() DAStation = Nothing End Sub Public Function GetStation() As DataSet Try GetStation = DAStation.GetStation Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetStation(ByVal StationID As String) As DataSet Try GetStation = DAStation.GetStation(StationID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddStation(ByVal Station As DataSet) As Boolean Try If Station.Tables("Station").Rows(0).Item("StationID").ToString.Trim.Lengt h = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DAStation.AddStation(Station) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteStation(ByVal StationID As String) As Boolean Try Return DAStation.DeleteStation(StationID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateStation(ByVal Station As DataSet) As Boolean

Page 103 of 227

Return DAStation.UpdateStation(Station) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Try

BLTariffs.vb
Public Class BLTariffs Implements IDisposable Private DATariffs As ShippingDataAccess.DATariffs Public Sub New() DATariffs = New ShippingDataAccess.DATariffs End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DATariffs.Dispose() DATariffs = Nothing End Sub Public Function GetTariffs() As DataSet Try GetTariffs = DATariffs.GetTariffs Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetTariffs(ByVal ConsignmentTypeID As String) As DataSet Try GetTariffs = DATariffs.GetTariffs(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddTariffs(ByVal Tariffs As DataSet) As Boolean Try If Tariffs.Tables("Tariffs").Rows(0).Item("ConsignmentTypeID").ToString.Tr im.Length = 0 Then Throw New System.Exception("You should enter a Account No!") End If Return DATariffs.AddTariffs(Tariffs) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function

Page 104 of 227

Public Function DeleteTariffs(ByVal ConsignmentTypeID As String) As Boolean Try Return DATariffs.DeleteTariffs(ConsignmentTypeID) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateTariffs(ByVal Tariffs As DataSet) As Boolean Try Return DATariffs.UpdateTariffs(Tariffs) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLVehicles.vb
Public Class BLVehicles Implements IDisposable Private DAVehicles As ShippingDataAccess.DAVehicles Public Sub New() DAVehicles = New ShippingDataAccess.DAVehicles End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAVehicles.Dispose() DAVehicles = Nothing End Sub Public Function GetVehicles() As DataSet Try GetVehicles = DAVehicles.GetVehicles Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetVehicles(ByVal VehicleNo As String) As DataSet Try GetVehicles = DAVehicles.GetVehicles(VehicleNo) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function AddVehicles(ByVal Vehicles As DataSet) As Boolean Try If Vehicles.Tables("Vehicles").Rows(0).Item("VehicleNo").ToString.Trim.Len gth = 0 Then

Page 105 of 227

No!")

Throw New System.Exception("You should enter a Account

End If Return DAVehicles.AddVehicles(Vehicles) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeleteVehicles(ByVal VehicleNo As String) As Boolean Try Return DAVehicles.DeleteVehicles(VehicleNo) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdateVehicles(ByVal Vehicles As DataSet) As Boolean Try Return DAVehicles.UpdateVehicles(Vehicles) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

BLPwdInfo.vb
Public Class BLPwdInfo Implements IDisposable Dim Password() As String Private DAPwdInfo As ShippingDataAccess.DAPwdInfo Public Sub New() DAPwdInfo = New ShippingDataAccess.DAPwdInfo End Sub Public Sub Dispose() Implements System.IDisposable.Dispose DAPwdInfo.Dispose() DAPwdInfo = Nothing End Sub Public Function GetPwdInfos() As DataSet Try GetPwdInfos = DAPwdInfo.GetPwdInfo Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function GetPwdInfo(ByVal Uid As String) As DataSet Try GetPwdInfo = DAPwdInfo.GetPwdInfo(Uid) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function

Page 106 of 227

Public Function AddPwdInfo(ByVal PwdInfo As DataSet) As Boolean Try If PwdInfo.Tables("PwdInfo").Rows(0).Item("Uid").ToString.Trim.Length = 0 Then Throw New System.Exception("You should enter a Uid!") End If Return DAPwdInfo.AddPwdInfo(PwdInfo) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DeletePwdInfo(ByVal Uid As String) As Boolean Try Return DAPwdInfo.DeletePwdInfo(Uid) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function UpdatePwdInfo(ByVal PwdInfo As DataSet) As Boolean Try Return DAPwdInfo.UpdatePwdInfo(PwdInfo) Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function EncryptPassword(ByVal STR As String) As String Dim i As Integer ReDim Preserve Password(Len(STR)) Try For i = 1 To Len(STR) Password(i) = Chr((Asc(Mid(STR, i, 1)) + 15) Xor 34) Next Dim l As Integer l = Len(STR) STR = "" For i = 1 To l STR = STR + Password(i) Next EncryptPassword = STR Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function Public Function DecryptPassword(ByVal STR As String) As String Dim i As Integer ReDim Preserve Password(Len(STR)) Try For i = 1 To Len(STR) Password(i) = Chr((Asc(Mid(STR, i, 1)) Xor 34) - 15) Next Dim l As Integer l = Len(STR) STR = "" For i = 1 To l

Page 107 of 227

STR = STR + Password(i) Next DecryptPassword = STR Exit Function Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Function End Class

Front End Architecture


MainModule.vb
Imports System.Data.SqlClient Module MainModule Public Public Public Public Public Public Public Public SQLDA As OracleDataAdapter SQLConn As OracleConnection DS As DataSet DT As DataTable DR As DataRow SQL As String ConnString As String UserName As String

Sub Main() Application.Run(New frmMain) End Sub End Module

frmLogin.vb
Public Class frmLogin Inherits System.Windows.Forms.Form Dim objPwdInfo As ShippingDataLogic.BLPwdInfo Dim dsPwdInfo As DataSet #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer.

Page 108 of 227

InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label10 As System.Windows.Forms.Label Friend WithEvents txtPassword As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents cmbUserName As System.Windows.Forms.ComboBox Friend WithEvents btnOk As System.Windows.Forms.Button Friend WithEvents btnExit As System.Windows.Forms.Button <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.cmbUserName = New System.Windows.Forms.ComboBox Me.txtPassword = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.Label10 = New System.Windows.Forms.Label Me.Label11 = New System.Windows.Forms.Label Me.btnOk = New System.Windows.Forms.Button Me.btnExit = New System.Windows.Forms.Button Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'GroupBox1 ' Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmbUserName, Me.txtPassword, Me.Label1, Me.Label10}) Me.GroupBox1.Location = New System.Drawing.Point(16, 56) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(296, 72) Me.GroupBox1.TabIndex = 0 Me.GroupBox1.TabStop = False ' 'cmbUserName

Page 109 of 227

' Me.cmbUserName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbUserName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmbUserName.Items.AddRange(New Object() {"Administrator", "User"}) Me.cmbUserName.Location = New System.Drawing.Point(96, 16) Me.cmbUserName.Name = "cmbUserName" Me.cmbUserName.Size = New System.Drawing.Size(176, 21) Me.cmbUserName.TabIndex = 15 ' 'txtPassword ' Me.txtPassword.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtPassword.Location = New System.Drawing.Point(96, 40) Me.txtPassword.Name = "txtPassword" Me.txtPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42) Me.txtPassword.Size = New System.Drawing.Size(176, 20) Me.txtPassword.TabIndex = 13 Me.txtPassword.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 40) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(80, 24) Me.Label1.TabIndex = 14 Me.Label1.Text = "Password:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label10 ' Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label10.Location = New System.Drawing.Point(16, 16) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(80, 24) Me.Label10.TabIndex = 12 Me.Label10.Text = "User Name:" Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label11 ' Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 16.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label11.Location = New System.Drawing.Point(32, 16)

Page 110 of 227

Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(272, 24) Me.Label11.TabIndex = 35 Me.Label11.Text = "Please Login" Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'btnOk ' Me.btnOk.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnOk.Location = New System.Drawing.Point(56, 136) Me.btnOk.Name = "btnOk" Me.btnOk.Size = New System.Drawing.Size(88, 24) Me.btnOk.TabIndex = 36 Me.btnOk.Text = "&Ok" ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(160, 136) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(88, 24) Me.btnExit.TabIndex = 37 Me.btnExit.Text = "E&xit" ' 'frmLogin ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(328, 182) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnExit, Me.btnOk, Me.Label11, Me.GroupBox1}) Me.MaximizeBox = False Me.Name = "frmLogin" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "frmLogin" Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load cmbUserName.SelectedIndex = 0 End Sub Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click Dim MainForm As New frmMain Dim Pass As String objPwdInfo = New ShippingDataLogic.BLPwdInfo

Page 111 of 227

dsPwdInfo = objPwdInfo.GetPwdInfo(cmbUserName.Text.Trim) Pass = objPwdInfo.DecryptPassword(dsPwdInfo.Tables("PwdInfo").Rows(0).Item("Pw d")) If cmbUserName.Text.Trim = "Administrator" Then If Pass = txtPassword.Text.Trim Then UserName = cmbUserName.Text.Trim Me.Hide() MainForm.Show() Else MsgBox("Wrong Password! Try Again.", MsgBoxStyle.Critical) txtPassword.Focus() End If Else If Pass = txtPassword.Text.Trim Then UserName = cmbUserName.Text.Trim Me.Hide() MainForm.Show() Else MsgBox("Wrong Password! Try Again.", MsgBoxStyle.Critical) txtPassword.Focus() End If End If End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Application.Exit() End Sub End Class

frmMain.vb
Public Class frmMain Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent()

Page 112 of 227

'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents MainMenu As System.Windows.Forms.MainMenu Friend WithEvents mnuMaster As System.Windows.Forms.MenuItem Friend WithEvents mnuTrans As System.Windows.Forms.MenuItem Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem Friend WithEvents mnuReport As System.Windows.Forms.MenuItem Friend WithEvents mnuExit As System.Windows.Forms.MenuItem Friend WithEvents mnuConsignor As System.Windows.Forms.MenuItem Friend WithEvents mnuConsignorAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuConsignorEdit As System.Windows.Forms.MenuItem Friend WithEvents mnuConsignmentType As System.Windows.Forms.MenuItem Friend WithEvents mnuConTypeAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuConTypeEdit As System.Windows.Forms.MenuItem Friend WithEvents mnuRoute As System.Windows.Forms.MenuItem Friend WithEvents mnuRouteAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuRouteEdit As System.Windows.Forms.MenuItem Friend WithEvents mnuTariff As System.Windows.Forms.MenuItem Friend WithEvents mnuTraiffAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuTariffEdit As System.Windows.Forms.MenuItem Friend WithEvents mnuStation As System.Windows.Forms.MenuItem Friend WithEvents mnuStationAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuStationEdit As System.Windows.Forms.MenuItem Friend WithEvents mnuConsignment As System.Windows.Forms.MenuItem Friend WithEvents mnuConAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuConEdit As System.Windows.Forms.MenuItem Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem Friend WithEvents mnuVehicles As System.Windows.Forms.MenuItem Friend WithEvents mnuVehicleAdd As System.Windows.Forms.MenuItem Friend WithEvents mnuVehicleEdit As System.Windows.Forms.MenuItem <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.MainMenu = New System.Windows.Forms.MainMenu Me.mnuMaster = New System.Windows.Forms.MenuItem

Page 113 of 227

Me.mnuConsignor = New System.Windows.Forms.MenuItem Me.mnuConsignorAdd = New System.Windows.Forms.MenuItem Me.mnuConsignorEdit = New System.Windows.Forms.MenuItem Me.mnuConsignmentType = New System.Windows.Forms.MenuItem Me.mnuConTypeAdd = New System.Windows.Forms.MenuItem Me.mnuConTypeEdit = New System.Windows.Forms.MenuItem Me.mnuRoute = New System.Windows.Forms.MenuItem Me.mnuRouteAdd = New System.Windows.Forms.MenuItem Me.mnuRouteEdit = New System.Windows.Forms.MenuItem Me.mnuTariff = New System.Windows.Forms.MenuItem Me.mnuTraiffAdd = New System.Windows.Forms.MenuItem Me.mnuTariffEdit = New System.Windows.Forms.MenuItem Me.mnuVehicles = New System.Windows.Forms.MenuItem Me.mnuVehicleAdd = New System.Windows.Forms.MenuItem Me.mnuVehicleEdit = New System.Windows.Forms.MenuItem Me.mnuStation = New System.Windows.Forms.MenuItem Me.mnuStationAdd = New System.Windows.Forms.MenuItem Me.mnuStationEdit = New System.Windows.Forms.MenuItem Me.MenuItem4 = New System.Windows.Forms.MenuItem Me.mnuExit = New System.Windows.Forms.MenuItem Me.mnuTrans = New System.Windows.Forms.MenuItem Me.mnuConsignment = New System.Windows.Forms.MenuItem Me.mnuConAdd = New System.Windows.Forms.MenuItem Me.mnuConEdit = New System.Windows.Forms.MenuItem Me.mnuReport = New System.Windows.Forms.MenuItem Me.MenuItem1 = New System.Windows.Forms.MenuItem Me.MenuItem2 = New System.Windows.Forms.MenuItem ' 'MainMenu ' Me.MainMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuMaster, Me.mnuTrans, Me.mnuReport, Me.MenuItem1, Me.MenuItem2}) ' 'mnuMaster ' Me.mnuMaster.Index = 0 Me.mnuMaster.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuConsignor, Me.mnuConsignmentType, Me.mnuRoute, Me.mnuTariff, Me.mnuVehicles, Me.mnuStation, Me.MenuItem4, Me.mnuExit}) Me.mnuMaster.Text = "&Master" ' 'mnuConsignor ' Me.mnuConsignor.Index = 0 Me.mnuConsignor.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuConsignorAdd, Me.mnuConsignorEdit}) Me.mnuConsignor.Text = "&Consignor" ' 'mnuConsignorAdd ' Me.mnuConsignorAdd.Index = 0 Me.mnuConsignorAdd.Text = "&Add" ' 'mnuConsignorEdit

Page 114 of 227

' Me.mnuConsignorEdit.Index = 1 Me.mnuConsignorEdit.Text = "&Edit" ' 'mnuConsignmentType ' Me.mnuConsignmentType.Index = 1 Me.mnuConsignmentType.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuConTypeAdd, Me.mnuConTypeEdit}) Me.mnuConsignmentType.Text = "Consi&gnment Type" ' 'mnuConTypeAdd ' Me.mnuConTypeAdd.Index = 0 Me.mnuConTypeAdd.Text = "&Add" ' 'mnuConTypeEdit ' Me.mnuConTypeEdit.Index = 1 Me.mnuConTypeEdit.Text = "&Edit" ' 'mnuRoute ' Me.mnuRoute.Index = 2 Me.mnuRoute.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuRouteAdd, Me.mnuRouteEdit}) Me.mnuRoute.Text = "&Route" ' 'mnuRouteAdd ' Me.mnuRouteAdd.Index = 0 Me.mnuRouteAdd.Text = "&Add" ' 'mnuRouteEdit ' Me.mnuRouteEdit.Index = 1 Me.mnuRouteEdit.Text = "&Edit" ' 'mnuTariff ' Me.mnuTariff.Index = 3 Me.mnuTariff.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuTraiffAdd, Me.mnuTariffEdit}) Me.mnuTariff.Text = "&Tariff" ' 'mnuTraiffAdd ' Me.mnuTraiffAdd.Index = 0 Me.mnuTraiffAdd.Text = "&Add" ' 'mnuTariffEdit ' Me.mnuTariffEdit.Index = 1 Me.mnuTariffEdit.Text = "&Edit" ' 'mnuVehicles '

Page 115 of 227

Me.mnuVehicles.Index = 4 Me.mnuVehicles.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuVehicleAdd, Me.mnuVehicleEdit}) Me.mnuVehicles.Text = "&Vehicle" ' 'mnuVehicleAdd ' Me.mnuVehicleAdd.Index = 0 Me.mnuVehicleAdd.Text = "&Add" ' 'mnuVehicleEdit ' Me.mnuVehicleEdit.Index = 1 Me.mnuVehicleEdit.Text = "&Edit" ' 'mnuStation ' Me.mnuStation.Index = 5 Me.mnuStation.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuStationAdd, Me.mnuStationEdit}) Me.mnuStation.Text = "&Station" ' 'mnuStationAdd ' Me.mnuStationAdd.Index = 0 Me.mnuStationAdd.Text = "&Add" ' 'mnuStationEdit ' Me.mnuStationEdit.Index = 1 Me.mnuStationEdit.Text = "&Edit" ' 'MenuItem4 ' Me.MenuItem4.Index = 6 Me.MenuItem4.Text = "-" ' 'mnuExit ' Me.mnuExit.Index = 7 Me.mnuExit.Text = "E&xit" ' 'mnuTrans ' Me.mnuTrans.Index = 1 Me.mnuTrans.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuConsignment}) Me.mnuTrans.Text = "&Transaction" ' 'mnuConsignment ' Me.mnuConsignment.Index = 0 Me.mnuConsignment.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuConAdd, Me.mnuConEdit}) Me.mnuConsignment.Text = "&Consignment" ' 'mnuConAdd

Page 116 of 227

' Me.mnuConAdd.Index = 0 Me.mnuConAdd.Text = "&Add" ' 'mnuConEdit ' Me.mnuConEdit.Index = 1 Me.mnuConEdit.Text = "&Edit" ' 'mnuReport ' Me.mnuReport.Index = 2 Me.mnuReport.Text = "&Report" ' 'MenuItem1 ' Me.MenuItem1.Index = 3 Me.MenuItem1.Text = "&Window" ' 'MenuItem2 ' Me.MenuItem2.Index = 4 Me.MenuItem2.Text = "&Help" ' 'frmMain ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(808, 478) Me.IsMdiContainer = True Me.Menu = Me.MainMenu Me.Name = "frmMain" Me.Text = "Shipping Management System" End Sub #End Region Private Sub mnuConsignorAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConsignorAdd.Click Dim AddConsignor As frmConsignor AddConsignor = New frmConsignor AddConsignor.MdiParent = Me AddConsignor.btnSearch.Visible = False AddConsignor.btnDelete.Visible = False AddConsignor.btnSave.Left = AddConsignor.btnDelete.Left AddConsignor.Show() End Sub Private Sub mnuConsignorEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConsignorEdit.Click Dim EditConsignor As frmConsignor EditConsignor = New frmConsignor EditConsignor.btnSave.Text = "&Update" EditConsignor.MdiParent = Me EditConsignor.Show() End Sub

Page 117 of 227

Private Sub mnuNewTrans_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConsignment.Click End Sub Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click Me.Dispose() End Sub Private Sub mnuVehicleAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuVehicleAdd.Click Dim AddVehicle As frmVehicles AddVehicle = New frmVehicles AddVehicle.MdiParent = Me AddVehicle.btnSearch.Visible = False AddVehicle.btnDelete.Visible = False AddVehicle.btnSave.Left = AddVehicle.btnDelete.Left AddVehicle.Show() End Sub Private Sub mnuVehicleEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuVehicleEdit.Click Dim EditVehicle As frmVehicles EditVehicle = New frmVehicles EditVehicle.btnSave.Text = "&Update" EditVehicle.MdiParent = Me EditVehicle.Show() End Sub Private Sub mnuTraiffAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTraiffAdd.Click Dim AddTariff As frmTariff AddTariff = New frmTariff AddTariff.MdiParent = Me AddTariff.btnSearch.Visible = False AddTariff.btnDelete.Visible = False AddTariff.btnSave.Left = AddTariff.btnDelete.Left AddTariff.Show() End Sub Private Sub mnuTariffEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTariffEdit.Click Dim EditTariff As frmTariff EditTariff = New frmTariff EditTariff.btnSave.Text = "&Update" EditTariff.MdiParent = Me EditTariff.Show() End Sub Private Sub mnuConAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConAdd.Click Dim AddCon As frmConsignment AddCon = New frmConsignment

Page 118 of 227

AddCon.MdiParent = Me AddCon.btnSearch.Visible = False AddCon.btnDelete.Visible = False AddCon.btnSave.Left = AddCon.btnDelete.Left AddCon.Show() End Sub Private Sub mnuConEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuConEdit.Click Dim EditCon As frmConsignment EditCon = New frmConsignment EditCon.btnSave.Text = "&Update" EditCon.MdiParent = Me EditCon.Show() End Sub Private Sub mnuStationAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuStationAdd.Click Dim AddStation As frmStation AddStation = New frmStation AddStation.MdiParent = Me AddStation.btnSearch.Visible = False AddStation.btnDelete.Visible = False AddStation.btnSave.Left = AddStation.btnDelete.Left AddStation.Show() End Sub Private Sub mnuStationEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuStationEdit.Click Dim EditStation As frmStation EditStation = New frmStation EditStation.MdiParent = Me EditStation.btnSave.Text = "&Update" EditStation.Show() End Sub Private Sub mnuRouteAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRouteAdd.Click Dim AddRoute As frmRoute AddRoute = New frmRoute AddRoute.btnSearch.Visible = False AddRoute.btnDelete.Visible = False AddRoute.btnSave.Left = AddRoute.btnDelete.Left AddRoute.MdiParent = Me AddRoute.Show() End Sub Private Sub mnuRouteEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuRouteEdit.Click Dim EditRoute As frmRoute EditRoute = New frmRoute EditRoute.btnSave.Text = "&Update" EditRoute.MdiParent = Me End Sub End Class

Page 119 of 227

frmConsignor.vb
Public Class frmConsignor Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents txtAddress As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtName As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents txtConsignorID As System.Windows.Forms.TextBox Friend WithEvents txtCompanyName As System.Windows.Forms.TextBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents txtEmailID As System.Windows.Forms.TextBox Friend WithEvents Label8 As System.Windows.Forms.Label

Page 120 of 227

Friend WithEvents txtFax As System.Windows.Forms.TextBox Friend WithEvents Label9 As System.Windows.Forms.Label Friend WithEvents txtNotes As System.Windows.Forms.TextBox Friend WithEvents Label10 As System.Windows.Forms.Label <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.txtNotes = New System.Windows.Forms.TextBox Me.Label10 = New System.Windows.Forms.Label Me.txtFax = New System.Windows.Forms.TextBox Me.Label9 = New System.Windows.Forms.Label Me.txtEmailID = New System.Windows.Forms.TextBox Me.Label8 = New System.Windows.Forms.Label Me.txtCompanyName = New System.Windows.Forms.TextBox Me.Label7 = New System.Windows.Forms.Label Me.txtAddress = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.txtName = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtConsignorID = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 376) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 44 Me.btnDelete.Text = "&Delete" ' 'Label5 ' Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(384, 16) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 43 Me.Label5.Text = "Previous Records"

Page 121 of 227

Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(32, 16) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(288, 32) Me.Label4.TabIndex = 42 Me.Label4.Text = "Consignor Information" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(360, 56) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(368, 360) Me.DataGrid.TabIndex = 41 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 376) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 40 Me.btnExit.Text = "&E&xit" ' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 376) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 39 Me.btnCancel.Text = "&Cancel" ' 'btnSave ' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 376) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 38

Page 122 of 227

Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.txtNotes) Me.GroupBox2.Controls.Add(Me.Label10) Me.GroupBox2.Controls.Add(Me.txtFax) Me.GroupBox2.Controls.Add(Me.Label9) Me.GroupBox2.Controls.Add(Me.txtEmailID) Me.GroupBox2.Controls.Add(Me.Label8) Me.GroupBox2.Controls.Add(Me.txtCompanyName) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.txtAddress) Me.GroupBox2.Controls.Add(Me.Label2) Me.GroupBox2.Controls.Add(Me.txtName) Me.GroupBox2.Controls.Add(Me.Label1) Me.GroupBox2.Location = New System.Drawing.Point(8, 112) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 256) Me.GroupBox2.TabIndex = 37 Me.GroupBox2.TabStop = False ' 'txtNotes ' Me.txtNotes.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtNotes.Location = New System.Drawing.Point(120, 136) Me.txtNotes.Multiline = True Me.txtNotes.Name = "txtNotes" Me.txtNotes.Size = New System.Drawing.Size(208, 112) Me.txtNotes.TabIndex = 13 Me.txtNotes.Text = "" ' 'Label10 ' Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label10.Location = New System.Drawing.Point(16, 136) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(96, 24) Me.Label10.TabIndex = 12 Me.Label10.Text = "Notes:" Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtFax ' Me.txtFax.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtFax.Location = New System.Drawing.Point(120, 112) Me.txtFax.Name = "txtFax" Me.txtFax.Size = New System.Drawing.Size(208, 20) Me.txtFax.TabIndex = 11 Me.txtFax.Text = ""

Page 123 of 227

' 'Label9 ' Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label9.Location = New System.Drawing.Point(16, 112) Me.Label9.Name = "Label9" Me.Label9.Size = New System.Drawing.Size(96, 24) Me.Label9.TabIndex = 10 Me.Label9.Text = "FAX:" Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtEmailID ' Me.txtEmailID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtEmailID.Location = New System.Drawing.Point(120, 88) Me.txtEmailID.Name = "txtEmailID" Me.txtEmailID.Size = New System.Drawing.Size(208, 20) Me.txtEmailID.TabIndex = 9 Me.txtEmailID.Text = "" ' 'Label8 ' Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label8.Location = New System.Drawing.Point(16, 88) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(96, 24) Me.Label8.TabIndex = 8 Me.Label8.Text = "E-Mail ID:" Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtCompanyName ' Me.txtCompanyName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtCompanyName.Location = New System.Drawing.Point(120, 40) Me.txtCompanyName.Name = "txtCompanyName" Me.txtCompanyName.Size = New System.Drawing.Size(208, 20) Me.txtCompanyName.TabIndex = 7 Me.txtCompanyName.Text = "" ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24)

Page 124 of 227

Me.Label7.TabIndex = 6 Me.Label7.Text = "Company Name:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtAddress ' Me.txtAddress.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtAddress.Location = New System.Drawing.Point(120, 64) Me.txtAddress.Name = "txtAddress" Me.txtAddress.Size = New System.Drawing.Size(208, 20) Me.txtAddress.TabIndex = 3 Me.txtAddress.Text = "" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 64) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 24) Me.Label2.TabIndex = 2 Me.Label2.Text = "Address:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtName ' Me.txtName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtName.Location = New System.Drawing.Point(120, 16) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(208, 20) Me.txtName.TabIndex = 1 Me.txtName.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "Name:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.txtConsignorID) Me.GroupBox1.Controls.Add(Me.Label3)

Page 125 of 227

Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 48) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(344, 56) Me.GroupBox1.TabIndex = 36 Me.GroupBox1.TabStop = False ' 'txtConsignorID ' Me.txtConsignorID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtConsignorID.Location = New System.Drawing.Point(120, 24) Me.txtConsignorID.Name = "txtConsignorID" Me.txtConsignorID.Size = New System.Drawing.Size(144, 20) Me.txtConsignorID.TabIndex = 7 Me.txtConsignorID.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 24) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Consignor ID:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'frmConsignor ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(736, 422) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmConsignor" Me.Text = "Consignor Information"

Page 126 of 227

CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Dim objConsignor As ShippingDataLogic.BLConsignor Dim dsConsignor As DataSet Private Sub ClearFields() txtConsignorID.Text = vbNullString txtName.Text = vbNullString txtAddress.Text = vbNullString txtCompanyName.Text = vbNullString txtEmailID.Text = vbNullString txtFax.Text = vbNullString txtNotes.Text = vbNullString txtConsignorID.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objConsignor = Nothing dsConsignor = Nothing Me.Dispose() End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveConsignor() ClearFields() objConsignor = New ShippingDataLogic.BLConsignor DataGrid.DataSource = objConsignor.GetConsignors Else UpdateConsignor() ClearFields() objConsignor = New ShippingDataLogic.BLConsignor DataGrid.DataSource = objConsignor.GetConsignors End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objConsignor = New ShippingDataLogic.BLConsignor DataGrid.DataSource = objConsignor.GetConsignors End Sub Private Sub frmConsignor_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objConsignor.Dispose() objConsignor = Nothing

Page 127 of 227

End Sub Private Sub SaveConsignor() Try objConsignor = New ShippingDataLogic.BLConsignor dsConsignor = objConsignor.GetConsignors '**** Below line in important. Otherwise ' We will get message of Primary key violation dsConsignor.Tables("Consignor").Rows.Clear() Dim objDataRow As DataRow = dsConsignor.Tables("Consignor").NewRow objDataRow.Item("ConsignorID") = txtConsignorID.Text.Trim objDataRow.Item("ConsignorName") = txtName.Text.Trim objDataRow.Item("CompanyName") = txtCompanyName.Text.Trim objDataRow.Item("Address") = txtAddress.Text.Trim objDataRow.Item("EmailID") = txtEmailID.Text.Trim objDataRow.Item("Fax") = txtFax.Text.Trim objDataRow.Item("Notes") = txtNotes.Text.Trim dsConsignor.Tables("Consignor").Rows.Add(objDataRow) If Not objConsignor.AddConsignor(dsConsignor) Then Throw New Exception("Insert Consignor failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateConsignor() Try objConsignor = New ShippingDataLogic.BLConsignor dsConsignor = objConsignor.GetConsignors '**** Below line in important. Otherwise ' We will get message of Primary key violation dsConsignor.Tables("Consignor").Rows.Clear() Dim objDataRow As DataRow = dsConsignor.Tables("Consignor").NewRow objDataRow.Item("ConsignorID") = txtConsignorID.Text.Trim objDataRow.Item("ConsignorName") = txtName.Text.Trim objDataRow.Item("CompanyName") = txtCompanyName.Text.Trim objDataRow.Item("Address") = txtAddress.Text.Trim objDataRow.Item("EmailID") = txtEmailID.Text.Trim objDataRow.Item("Fax") = txtFax.Text.Trim objDataRow.Item("Notes") = txtNotes.Text.Trim dsConsignor.Tables("Consignor").Rows.Add(objDataRow) If Not objConsignor.UpdateConsignor(dsConsignor) Then Throw New Exception("Update Consignor failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields()

Page 128 of 227

End Try End Sub Private Sub DeleteConsignor() Try objConsignor = New ShippingDataLogic.BLConsignor Then If Not objConsignor.DeleteConsignor(txtConsignorID.Text) Throw New Exception("Delete Consignor Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try ClearFields() End Sub Private Sub SearchConsignor() Try objConsignor = New ShippingDataLogic.BLConsignor dsConsignor = objConsignor.GetConsignor(txtConsignorID.Text.Trim) txtName.Text = dsConsignor.Tables("Consignor").Rows(0).Item("ConsignorName") txtCompanyName.Text = dsConsignor.Tables("Consignor").Rows(0).Item("CompanyName") txtAddress.Text = dsConsignor.Tables("Consignor").Rows(0).Item("Address") txtEmailID.Text = dsConsignor.Tables("Consignor").Rows(0).Item("EmailID") txtFax.Text = dsConsignor.Tables("Consignor").Rows(0).Item("Fax") txtNotes.Text = dsConsignor.Tables("Consignor").Rows(0).Item("Notes") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchConsignor() End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteConsignor() Else ClearFields()

Page 129 of 227

End If End Sub End Class

frmVehicles.vb
Public Class frmVehicles Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents txtName As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox

Page 130 of 227

Friend WithEvents txtVehicleNo As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents cmbRouteID As System.Windows.Forms.ComboBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.cmbRouteID = New System.Windows.Forms.ComboBox Me.Label7 = New System.Windows.Forms.Label Me.txtName = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtVehicleNo = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 184) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 53 Me.btnDelete.Text = "&Delete" ' 'Label5 ' Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(376, 8) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 52 Me.Label5.Text = "Previous Records" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Page 131 of 227

Me.Label4.Location = New System.Drawing.Point(24, 8) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(288, 32) Me.Label4.TabIndex = 51 Me.Label4.Text = "Vehicle Information" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(360, 48) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(344, 176) Me.DataGrid.TabIndex = 50 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 184) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 49 Me.btnExit.Text = "&E&xit" ' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 184) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 48 Me.btnCancel.Text = "&Cancel" ' 'btnSave ' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 184) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 47 Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.cmbRouteID) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.txtName) Me.GroupBox2.Controls.Add(Me.Label1)

Page 132 of 227

Me.GroupBox2.Location = New System.Drawing.Point(8, 104) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 72) Me.GroupBox2.TabIndex = 46 Me.GroupBox2.TabStop = False ' 'cmbRouteID ' Me.cmbRouteID.Location = New System.Drawing.Point(120, 40) Me.cmbRouteID.Name = "cmbRouteID" Me.cmbRouteID.Size = New System.Drawing.Size(208, 21) Me.cmbRouteID.TabIndex = 7 ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24) Me.Label7.TabIndex = 6 Me.Label7.Text = "Route ID:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtName ' Me.txtName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtName.Location = New System.Drawing.Point(120, 16) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(208, 20) Me.txtName.TabIndex = 1 Me.txtName.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "Name:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.txtVehicleNo) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1"

Page 133 of 227

Me.GroupBox1.Size = New System.Drawing.Size(344, 56) Me.GroupBox1.TabIndex = 45 Me.GroupBox1.TabStop = False ' 'txtVehicleNo ' Me.txtVehicleNo.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtVehicleNo.Location = New System.Drawing.Point(120, 24) Me.txtVehicleNo.Name = "txtVehicleNo" Me.txtVehicleNo.Size = New System.Drawing.Size(144, 20) Me.txtVehicleNo.TabIndex = 7 Me.txtVehicleNo.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 24) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Vehicle No.:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'frmVehicles ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(712, 230) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmVehicles" Me.Text = "Vehicle Information" CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False)

Page 134 of 227

Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Dim objVehicles As ShippingDataLogic.BLVehicles Dim dsVehicles As DataSet Private Sub ClearFields() txtVehicleNo.Text = vbNullString txtName.Text = vbNullString cmbRouteID.Text = vbNullString txtVehicleNo.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objVehicles = Nothing dsVehicles = Nothing Me.Dispose() End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveVehicles() ClearFields() objVehicles = New ShippingDataLogic.BLVehicles DataGrid.DataSource = objVehicles.GetVehicles Else UpdateVehicles() ClearFields() objVehicles = New ShippingDataLogic.BLVehicles DataGrid.DataSource = objVehicles.GetVehicles End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objVehicles = New ShippingDataLogic.BLVehicles DataGrid.DataSource = objVehicles.GetVehicles End Sub Private Sub frmVehicles_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objVehicles.Dispose() objVehicles = Nothing End Sub Private Sub SaveVehicles() Try objVehicles = New ShippingDataLogic.BLVehicles dsVehicles = objVehicles.GetVehicles '**** Below line in important. Otherwise

Page 135 of 227

' We will get message of Primary key violation dsVehicles.Tables("Vehicles").Rows.Clear() Dim objDataRow As DataRow = dsVehicles.Tables("Vehicles").NewRow objDataRow.Item("VehicleNo") = txtVehicleNo.Text.Trim objDataRow.Item("VehicleName") = txtName.Text.Trim objDataRow.Item("RouteID") = txtName.Text.Trim dsVehicles.Tables("Vehicles").Rows.Add(objDataRow) If Not objVehicles.AddVehicles(dsVehicles) Then Throw New Exception("Insert Vehicles failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateVehicles() Try objVehicles = New ShippingDataLogic.BLVehicles dsVehicles = objVehicles.GetVehicles '**** Below line in important. Otherwise ' We will get message of Primary key violation dsVehicles.Tables("Vehicles").Rows.Clear() Dim objDataRow As DataRow = dsVehicles.Tables("Vehicles").NewRow objDataRow.Item("VehicleNo") = txtVehicleNo.Text.Trim objDataRow.Item("VehicleName") = txtName.Text.Trim objDataRow.Item("RouteID") = txtName.Text.Trim dsVehicles.Tables("Vehicles").Rows.Add(objDataRow) If Not objVehicles.UpdateVehicles(dsVehicles) Then Throw New Exception("Update Vehicles failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub DeleteVehicles() Try objVehicles = New ShippingDataLogic.BLVehicles If Not objVehicles.DeleteVehicles(txtVehicleNo.Text) Then Throw New Exception("Delete Vehicles Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try

Page 136 of 227

ClearFields() End Sub Private Sub SearchVehicles() Try objVehicles = New ShippingDataLogic.BLVehicles dsVehicles = objVehicles.GetVehicles(txtVehicleNo.Text.Trim) txtName.Text = dsVehicles.Tables("Vehicles").Rows(0).Item("VehicleName") cmbRouteID.Text = dsVehicles.Tables("Vehicles").Rows(0).Item("RouteID") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchVehicles() End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteVehicles() Else ClearFields() End If End Sub End Class

frmPassword.vb
Public Class frmPassword Inherits System.Windows.Forms.Form Dim objPwdInfo As ShippingDataLogic.BLPwdInfo Dim dsPwdInfo As DataSet #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub

Page 137 of 227

'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnOk As System.Windows.Forms.Button Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents cmbUserName As System.Windows.Forms.ComboBox Friend WithEvents txtPassword As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Label10 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents txtNewPassword As System.Windows.Forms.TextBox Friend WithEvents txtConfPassword As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnExit = New System.Windows.Forms.Button Me.btnOk = New System.Windows.Forms.Button Me.Label11 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtConfPassword = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.txtNewPassword = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.cmbUserName = New System.Windows.Forms.ComboBox Me.txtPassword = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.Label10 = New System.Windows.Forms.Label Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(168, 176) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(88, 24) Me.btnExit.TabIndex = 41 Me.btnExit.Text = "E&xit"

Page 138 of 227

' 'btnOk ' Me.btnOk.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnOk.Location = New System.Drawing.Point(64, 176) Me.btnOk.Name = "btnOk" Me.btnOk.Size = New System.Drawing.Size(88, 24) Me.btnOk.TabIndex = 40 Me.btnOk.Text = "&Ok" ' 'Label11 ' Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 16.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label11.Location = New System.Drawing.Point(28, 8) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(272, 24) Me.Label11.TabIndex = 39 Me.Label11.Text = "Change Password" Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'GroupBox1 ' Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtConfPassword, Me.Label3, Me.txtNewPassword, Me.Label2, Me.cmbUserName, Me.txtPassword, Me.Label1, Me.Label10}) Me.GroupBox1.Location = New System.Drawing.Point(12, 48) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(324, 120) Me.GroupBox1.TabIndex = 38 Me.GroupBox1.TabStop = False ' 'txtConfPassword ' Me.txtConfPassword.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtConfPassword.Location = New System.Drawing.Point(128, 88) Me.txtConfPassword.Name = "txtConfPassword" Me.txtConfPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42) Me.txtConfPassword.Size = New System.Drawing.Size(176, 20) Me.txtConfPassword.TabIndex = 18 Me.txtConfPassword.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 88) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(104, 24)

Page 139 of 227

Me.Label3.TabIndex = 19 Me.Label3.Text = "Confirm Password:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtNewPassword ' Me.txtNewPassword.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtNewPassword.Location = New System.Drawing.Point(128, 64) Me.txtNewPassword.Name = "txtNewPassword" Me.txtNewPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42) Me.txtNewPassword.Size = New System.Drawing.Size(176, 20) Me.txtNewPassword.TabIndex = 16 Me.txtNewPassword.Text = "" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 64) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(104, 24) Me.Label2.TabIndex = 17 Me.Label2.Text = "New Password:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'cmbUserName ' Me.cmbUserName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbUserName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmbUserName.Items.AddRange(New Object() {"Administrator", "User"}) Me.cmbUserName.Location = New System.Drawing.Point(128, 16) Me.cmbUserName.Name = "cmbUserName" Me.cmbUserName.Size = New System.Drawing.Size(176, 21) Me.cmbUserName.TabIndex = 15 ' 'txtPassword ' Me.txtPassword.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtPassword.Location = New System.Drawing.Point(128, 40) Me.txtPassword.Name = "txtPassword" Me.txtPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42) Me.txtPassword.Size = New System.Drawing.Size(176, 20) Me.txtPassword.TabIndex = 13 Me.txtPassword.Text = "" ' 'Label1

Page 140 of 227

' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 40) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(104, 24) Me.Label1.TabIndex = 14 Me.Label1.Text = "Old Password:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label10 ' Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label10.Location = New System.Drawing.Point(40, 16) Me.Label10.Name = "Label10" Me.Label10.Size = New System.Drawing.Size(80, 24) Me.Label10.TabIndex = 12 Me.Label10.Text = "User Name:" Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'frmPassword ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(344, 214) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnExit, Me.btnOk, Me.Label11, Me.GroupBox1}) Me.Name = "frmPassword" Me.Text = "Change Password" Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click Dim OldPass As String Try objPwdInfo = New ShippingDataLogic.BLPwdInfo dsPwdInfo = objPwdInfo.GetPwdInfo(cmbUserName.Text.Trim) OldPass = objPwdInfo.DecryptPassword(dsPwdInfo.Tables("PwdInfo").Rows(0).Item("Pw d")) If OldPass = txtPassword.Text.Trim Then If txtNewPassword.Text.Trim = txtConfPassword.Text.Trim Then Try dsPwdInfo.Tables("PwdInfo").Rows.Clear() Dim objDataRow As DataRow = dsPwdInfo.Tables("PwdInfo").NewRow objDataRow.Item("Uid") = cmbUserName.Text.Trim

Page 141 of 227

objDataRow.Item("Pwd") = objPwdInfo.EncryptPassword(txtNewPassword.Text.Trim) dsPwdInfo.Tables("PwdInfo").Rows.Add(objDataRow) If Not objPwdInfo.UpdatePwdInfo(dsPwdInfo) Then Throw New Exception("Insert Vehicles failed!!!") Else MessageBox.Show("Password Changed Successfully!", "Password", MessageBoxButtons.OK, MessageBoxIcon.Information) End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try Else MessageBox.Show("New Passwords do not match! Please try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Else MessageBox.Show("Old Passwords do not match! Please try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally cmbUserName.Text = vbNullString txtPassword.Text = vbNullString txtNewPassword.Text = vbNullString txtConfPassword.Text = vbNullString End Try End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Dispose() End Sub End Class

frmReport.vb
Public Class frmReport Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent()

Page 142 of 227

'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents CrystalReportViewer As CrystalDecisions.Windows.Forms.CrystalReportViewer <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.CrystalReportViewer = New CrystalDecisions.Windows.Forms.CrystalReportViewer Me.SuspendLayout() ' 'CrystalReportViewer ' Me.CrystalReportViewer.ActiveViewIndex = -1 Me.CrystalReportViewer.Location = New System.Drawing.Point(8, 16) Me.CrystalReportViewer.Name = "CrystalReportViewer" Me.CrystalReportViewer.ReportSource = Nothing Me.CrystalReportViewer.Size = New System.Drawing.Size(1008, 344) Me.CrystalReportViewer.TabIndex = 0 ' 'frmReport ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(1028, 366) Me.Controls.Add(Me.CrystalReportViewer) Me.Name = "frmReport" Me.Text = "frmReport" Me.ResumeLayout(False) End Sub #End Region End Class

frmTariff.vb Page 143 of 227

Public Class frmTariff Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents txtTariffID As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents txtRate As System.Windows.Forms.TextBox Friend WithEvents txtEnd As System.Windows.Forms.TextBox Friend WithEvents txtStart As System.Windows.Forms.TextBox Friend WithEvents txtClass As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Page 144 of 227

Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.txtRate = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.txtEnd = New System.Windows.Forms.TextBox Me.Label6 = New System.Windows.Forms.Label Me.txtStart = New System.Windows.Forms.TextBox Me.Label7 = New System.Windows.Forms.Label Me.txtClass = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtTariffID = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 232) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 71 Me.btnDelete.Text = "&Delete" ' 'Label5 ' Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(376, 8) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 70 Me.Label5.Text = "Previous Records" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(24, 8) Me.Label4.Name = "Label4"

Page 145 of 227

Me.Label4.Size = New System.Drawing.Size(288, 32) Me.Label4.TabIndex = 69 Me.Label4.Text = "Tariff Information" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(360, 48) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(344, 216) Me.DataGrid.TabIndex = 68 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 232) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 67 Me.btnExit.Text = "&E&xit" ' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 232) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 66 Me.btnCancel.Text = "&Cancel" ' 'btnSave ' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 232) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 65 Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.txtRate) Me.GroupBox2.Controls.Add(Me.Label2) Me.GroupBox2.Controls.Add(Me.txtEnd) Me.GroupBox2.Controls.Add(Me.Label6) Me.GroupBox2.Controls.Add(Me.txtStart) Me.GroupBox2.Controls.Add(Me.Label7)

Page 146 of 227

Me.GroupBox2.Controls.Add(Me.txtClass) Me.GroupBox2.Controls.Add(Me.Label1) Me.GroupBox2.Location = New System.Drawing.Point(8, 104) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 120) Me.GroupBox2.TabIndex = 64 Me.GroupBox2.TabStop = False ' 'txtRate ' Me.txtRate.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtRate.Location = New System.Drawing.Point(120, 88) Me.txtRate.Name = "txtRate" Me.txtRate.Size = New System.Drawing.Size(208, 20) Me.txtRate.TabIndex = 11 Me.txtRate.Text = "" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 88) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 24) Me.Label2.TabIndex = 10 Me.Label2.Text = "Rate:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtEnd ' Me.txtEnd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtEnd.Location = New System.Drawing.Point(120, 64) Me.txtEnd.Name = "txtEnd" Me.txtEnd.Size = New System.Drawing.Size(208, 20) Me.txtEnd.TabIndex = 9 Me.txtEnd.Text = "" ' 'Label6 ' Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label6.Location = New System.Drawing.Point(16, 64) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(96, 24) Me.Label6.TabIndex = 8 Me.Label6.Text = "End Distance:" Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtStart

Page 147 of 227

' Me.txtStart.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtStart.Location = New System.Drawing.Point(120, 40) Me.txtStart.Name = "txtStart" Me.txtStart.Size = New System.Drawing.Size(208, 20) Me.txtStart.TabIndex = 7 Me.txtStart.Text = "" ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24) Me.Label7.TabIndex = 6 Me.Label7.Text = "Start Distance:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtClass ' Me.txtClass.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtClass.Location = New System.Drawing.Point(120, 16) Me.txtClass.Name = "txtClass" Me.txtClass.Size = New System.Drawing.Size(208, 20) Me.txtClass.TabIndex = 1 Me.txtClass.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "Class:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.txtTariffID) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(344, 56) Me.GroupBox1.TabIndex = 63 Me.GroupBox1.TabStop = False

Page 148 of 227

' 'txtTariffID ' Me.txtTariffID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtTariffID.Location = New System.Drawing.Point(120, 24) Me.txtTariffID.Name = "txtTariffID" Me.txtTariffID.Size = New System.Drawing.Size(144, 20) Me.txtTariffID.TabIndex = 7 Me.txtTariffID.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 24) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Tariff ID" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'frmTariff ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(712, 270) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmTariff" Me.Text = "frmTariff" CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False)

Page 149 of 227

End Sub #End Region Dim objTariff As ShippingDataLogic.BLTariffs Dim dsTariff As DataSet Private Sub ClearFields() txtTariffID.Text = vbNullString txtClass.Text = vbNullString txtStart.Text = vbNullString txtEnd.Text = vbNullString txtRate.Text = vbNullString txtTariffID.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objTariff = Nothing dsTariff = Nothing Me.Dispose() End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveTariff() ClearFields() objTariff = New ShippingDataLogic.BLTariffs DataGrid.DataSource = objTariff.GetTariffs Else UpdateTariff() ClearFields() objTariff = New ShippingDataLogic.BLTariffs DataGrid.DataSource = objTariff.GetTariffs End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objTariff = New ShippingDataLogic.BLTariffs DataGrid.DataSource = objTariff.GetTariffs End Sub Private Sub frmTariff_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objTariff.Dispose() objTariff = Nothing End Sub Private Sub SaveTariff() Try objTariff = New ShippingDataLogic.BLTariffs dsTariff = objTariff.GetTariffs '**** Below line in important. Otherwise ' We will get message of Primary key violation

Page 150 of 227

dsTariff.Tables("Tariff").Rows.Clear() Dim objDataRow As DataRow = dsTariff.Tables("Tariff").NewRow objDataRow.Item("TariffNo") = txtTariffID.Text.Trim objDataRow.Item("TariffName") = txtClass.Text.Trim objDataRow.Item("RouteID") = txtClass.Text.Trim dsTariff.Tables("Tariff").Rows.Add(objDataRow) If Not objTariff.AddTariffs(dsTariff) Then Throw New Exception("Insert Tariff failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateTariff() Try objTariff = New ShippingDataLogic.BLTariffs dsTariff = objTariff.GetTariffs '**** Below line in important. Otherwise ' We will get message of Primary key violation dsTariff.Tables("Tariff").Rows.Clear() Dim objDataRow As DataRow = dsTariff.Tables("Tariff").NewRow objDataRow.Item("TariffNo") = txtTariffID.Text.Trim objDataRow.Item("TariffName") = txtClass.Text.Trim objDataRow.Item("RouteID") = txtClass.Text.Trim dsTariff.Tables("Tariff").Rows.Add(objDataRow) If Not objTariff.UpdateTariffs(dsTariff) Then Throw New Exception("Update Tariff failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub DeleteTariff() Try objTariff = New ShippingDataLogic.BLTariffs If Not objTariff.DeleteTariffs(txtTariffID.Text) Then Throw New Exception("Delete Tariff Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try ClearFields() End Sub

Page 151 of 227

Private Sub SearchTariff() Try objTariff = New ShippingDataLogic.BLTariffs dsTariff = objTariff.GetTariffs(txtTariffID.Text.Trim) txtClass.Text = dsTariff.Tables("Tariff").Rows(0).Item("TariffName") txtStart.Text = dsTariff.Tables("Tariff").Rows(0).Item("RouteID") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchTariff() End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteTariff() Else ClearFields() End If End Sub End Class

frmStaion.vb
Public Class frmStation Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list.

Page 152 of 227

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents txtStationName As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents txtStationID As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents txtDesc As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.Label7 = New System.Windows.Forms.Label Me.txtStationName = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtStationID = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button Me.txtDesc = New System.Windows.Forms.TextBox CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() '

Page 153 of 227

'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 184) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 62 Me.btnDelete.Text = "&Delete" ' 'Label5 ' Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(376, 8) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 61 Me.Label5.Text = "Previous Records" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(24, 8) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(288, 32) Me.Label4.TabIndex = 60 Me.Label4.Text = "Station Information" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(360, 48) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(344, 176) Me.DataGrid.TabIndex = 59 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 184) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 58 Me.btnExit.Text = "&E&xit"

Page 154 of 227

' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 184) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 57 Me.btnCancel.Text = "&Cancel" ' 'btnSave ' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 184) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 56 Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.txtDesc) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.txtStationName) Me.GroupBox2.Controls.Add(Me.Label1) Me.GroupBox2.Location = New System.Drawing.Point(8, 104) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 72) Me.GroupBox2.TabIndex = 55 Me.GroupBox2.TabStop = False ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24) Me.Label7.TabIndex = 6 Me.Label7.Text = "Description:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtStationName ' Me.txtStationName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtStationName.Location = New System.Drawing.Point(120, 16) Me.txtStationName.Name = "txtStationName" Me.txtStationName.Size = New System.Drawing.Size(208, 20) Me.txtStationName.TabIndex = 1

Page 155 of 227

Me.txtStationName.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "Station Name:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.txtStationID) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(344, 56) Me.GroupBox1.TabIndex = 54 Me.GroupBox1.TabStop = False ' 'txtStationID ' Me.txtStationID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtStationID.Location = New System.Drawing.Point(120, 24) Me.txtStationID.Name = "txtStationID" Me.txtStationID.Size = New System.Drawing.Size(144, 20) Me.txtStationID.TabIndex = 7 Me.txtStationID.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 24) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Station ID" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch"

Page 156 of 227

Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'txtDesc ' Me.txtDesc.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtDesc.Location = New System.Drawing.Point(120, 40) Me.txtDesc.Name = "txtDesc" Me.txtDesc.Size = New System.Drawing.Size(208, 20) Me.txtDesc.TabIndex = 7 Me.txtDesc.Text = "" ' 'frmStation ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(712, 230) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmStation" Me.Text = "Station Information" CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Dim objStation As ShippingDataLogic.BLStation Dim dsStation As DataSet Private Sub ClearFields() txtStationID.Text = vbNullString txtStationName.Text = vbNullString txtDesc.Text = vbNullString txtStationID.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objStation = Nothing dsStation = Nothing Me.Dispose() End Sub

Page 157 of 227

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveStation() ClearFields() objStation = New ShippingDataLogic.BLStation DataGrid.DataSource = objStation.GetStation Else UpdateStation() ClearFields() objStation = New ShippingDataLogic.BLStation DataGrid.DataSource = objStation.GetStation End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objStation = New ShippingDataLogic.BLStation DataGrid.DataSource = objStation.GetStation End Sub Private Sub frmStation_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objStation.Dispose() objStation = Nothing End Sub Private Sub SaveStation() Try objStation = New ShippingDataLogic.BLStation dsStation = objStation.GetStation '**** Below line in important. Otherwise ' We will get message of Primary key violation dsStation.Tables("Station").Rows.Clear() Dim objDataRow As DataRow = dsStation.Tables("Station").NewRow objDataRow.Item("StationNo") = txtStationID.Text.Trim objDataRow.Item("StationName") = txtStationName.Text.Trim objDataRow.Item("RouteID") = txtStationName.Text.Trim dsStation.Tables("Station").Rows.Add(objDataRow) If Not objStation.AddStation(dsStation) Then Throw New Exception("Insert Station failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateStation() Try

Page 158 of 227

objStation = New ShippingDataLogic.BLStation dsStation = objStation.GetStation '**** Below line in important. Otherwise ' We will get message of Primary key violation dsStation.Tables("Station").Rows.Clear() Dim objDataRow As DataRow = dsStation.Tables("Station").NewRow objDataRow.Item("StationNo") = txtStationID.Text.Trim objDataRow.Item("StationName") = txtStationName.Text.Trim objDataRow.Item("RouteID") = txtStationName.Text.Trim dsStation.Tables("Station").Rows.Add(objDataRow) If Not objStation.UpdateStation(dsStation) Then Throw New Exception("Update Station failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub DeleteStation() Try objStation = New ShippingDataLogic.BLStation If Not objStation.DeleteStation(txtStationID.Text) Then Throw New Exception("Delete Station Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try ClearFields() End Sub Private Sub SearchStation() Try objStation = New ShippingDataLogic.BLStation dsStation = objStation.GetStation(txtStationID.Text.Trim) txtStationName.Text = dsStation.Tables("Station").Rows(0).Item("StationName") txtDesc.Text = dsStation.Tables("Station").Rows(0).Item("RouteID") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchStation() End Sub

Page 159 of 227

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteStation() Else ClearFields() End If End Sub End Class

frmRoute.vb
Public Class frmRoute Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid

Page 160 of 227

Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents txtRouteName As System.Windows.Forms.TextBox Friend WithEvents txtRouteID As System.Windows.Forms.TextBox Friend WithEvents txtStartingPoint As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents txtEndiingPoint As System.Windows.Forms.TextBox Friend WithEvents txtDistance As System.Windows.Forms.TextBox Friend WithEvents Label6 As System.Windows.Forms.Label <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.Label7 = New System.Windows.Forms.Label Me.txtRouteName = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtRouteID = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button Me.txtStartingPoint = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.txtEndiingPoint = New System.Windows.Forms.TextBox Me.txtDistance = New System.Windows.Forms.TextBox Me.Label6 = New System.Windows.Forms.Label CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 232) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 62 Me.btnDelete.Text = "&Delete" ' 'Label5 '

Page 161 of 227

Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(376, 8) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 61 Me.Label5.Text = "Previous Records" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(24, 8) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(288, 32) Me.Label4.TabIndex = 60 Me.Label4.Text = "Route Information" Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(360, 48) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(344, 216) Me.DataGrid.TabIndex = 59 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 232) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 58 Me.btnExit.Text = "&E&xit" ' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 232) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 57 Me.btnCancel.Text = "&Cancel" ' 'btnSave

Page 162 of 227

' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 232) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 56 Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.txtDistance) Me.GroupBox2.Controls.Add(Me.Label6) Me.GroupBox2.Controls.Add(Me.txtEndiingPoint) Me.GroupBox2.Controls.Add(Me.txtStartingPoint) Me.GroupBox2.Controls.Add(Me.Label2) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.txtRouteName) Me.GroupBox2.Controls.Add(Me.Label1) Me.GroupBox2.Location = New System.Drawing.Point(8, 104) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 120) Me.GroupBox2.TabIndex = 55 Me.GroupBox2.TabStop = False ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24) Me.Label7.TabIndex = 6 Me.Label7.Text = "Starting Point:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtRouteName ' Me.txtRouteName.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtRouteName.Location = New System.Drawing.Point(120, 16) Me.txtRouteName.Name = "txtRouteName" Me.txtRouteName.Size = New System.Drawing.Size(208, 20) Me.txtRouteName.TabIndex = 1 Me.txtRouteName.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1"

Page 163 of 227

Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "Route Name:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.txtRouteID) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(344, 56) Me.GroupBox1.TabIndex = 54 Me.GroupBox1.TabStop = False ' 'txtRouteID ' Me.txtRouteID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtRouteID.Location = New System.Drawing.Point(120, 24) Me.txtRouteID.Name = "txtRouteID" Me.txtRouteID.Size = New System.Drawing.Size(144, 20) Me.txtRouteID.TabIndex = 7 Me.txtRouteID.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(16, 24) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Route ID:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'txtStartingPoint ' Me.txtStartingPoint.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Page 164 of 227

Me.txtStartingPoint.Location = New System.Drawing.Point(120, 40) Me.txtStartingPoint.Name = "txtStartingPoint" Me.txtStartingPoint.Size = New System.Drawing.Size(208, 20) Me.txtStartingPoint.TabIndex = 8 Me.txtStartingPoint.Text = "" ' 'Label2 ' Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 64) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 24) Me.Label2.TabIndex = 7 Me.Label2.Text = "Ending Point:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtEndiingPoint ' Me.txtEndiingPoint.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtEndiingPoint.Location = New System.Drawing.Point(120, 64) Me.txtEndiingPoint.Name = "txtEndiingPoint" Me.txtEndiingPoint.Size = New System.Drawing.Size(208, 20) Me.txtEndiingPoint.TabIndex = 10 Me.txtEndiingPoint.Text = "" ' 'txtDistance ' Me.txtDistance.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtDistance.Location = New System.Drawing.Point(120, 88) Me.txtDistance.Name = "txtDistance" Me.txtDistance.Size = New System.Drawing.Size(208, 20) Me.txtDistance.TabIndex = 12 Me.txtDistance.Text = "" ' 'Label6 ' Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label6.Location = New System.Drawing.Point(16, 88) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(96, 24) Me.Label6.TabIndex = 11 Me.Label6.Text = "Total Distance" Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'frmRoute ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Page 165 of 227

Me.ClientSize = New System.Drawing.Size(712, 270) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmRoute" Me.Text = "Route Information" CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Dim objRoute As ShippingDataLogic.BLRouteDetails Dim dsRoute As DataSet Private Sub ClearFields() txtRouteID.Text = vbNullString txtRouteName.Text = vbNullString txtDistance.Text = vbNullString txtRouteID.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objRoute = Nothing dsRoute = Nothing Me.Dispose() End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveRoute() ClearFields() objRoute = New ShippingDataLogic.BLRouteDetails DataGrid.DataSource = objRoute.GetRouteDetails Else UpdateRoute() ClearFields() objRoute = New ShippingDataLogic.BLRouteDetails DataGrid.DataSource = objRoute.GetRouteDetails End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objRoute = New ShippingDataLogic.BLRouteDetails

Page 166 of 227

DataGrid.DataSource = objRoute.GetRouteDetails End Sub Private Sub frmRoute_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objRoute.Dispose() objRoute = Nothing End Sub Private Sub SaveRoute() Try objRoute = New ShippingDataLogic.BLRouteDetails dsRoute = objRoute.GetRouteDetails '**** Below line in important. Otherwise ' We will get message of Primary key violation dsRoute.Tables("Route").Rows.Clear() Dim objDataRow As DataRow = dsRoute.Tables("Route").NewRow objDataRow.Item("RouteNo") = txtRouteID.Text.Trim objDataRow.Item("RouteName") = txtRouteName.Text.Trim objDataRow.Item("RouteID") = txtRouteName.Text.Trim dsRoute.Tables("Route").Rows.Add(objDataRow) If Not objRoute.AddRouteDetails(dsRoute) Then Throw New Exception("Insert Route failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateRoute() Try objRoute = New ShippingDataLogic.BLRouteDetails dsRoute = objRoute.GetRouteDetails '**** Below line in important. Otherwise ' We will get message of Primary key violation dsRoute.Tables("Route").Rows.Clear() Dim objDataRow As DataRow = dsRoute.Tables("Route").NewRow objDataRow.Item("RouteNo") = txtRouteID.Text.Trim objDataRow.Item("RouteName") = txtRouteName.Text.Trim objDataRow.Item("RouteID") = txtRouteName.Text.Trim dsRoute.Tables("Route").Rows.Add(objDataRow) If Not objRoute.UpdateRouteDetails(dsRoute) Then Throw New Exception("Update Route failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields()

Page 167 of 227

End Try End Sub Private Sub DeleteRoute() Try objRoute = New ShippingDataLogic.BLRouteDetails If Not objRoute.DeleteRouteDetails(txtRouteID.Text) Then Throw New Exception("Delete Route Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try ClearFields() End Sub Private Sub SearchRoute() Try objRoute = New ShippingDataLogic.BLRouteDetails dsRoute = objRoute.GetRouteDetails(txtRouteID.Text.Trim) txtRouteName.Text = dsRoute.Tables("Route").Rows(0).Item("RouteName") txtDistance.Text = dsRoute.Tables("Route").Rows(0).Item("RouteID") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchRoute() End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteRoute() Else ClearFields() End If End Sub End Class

frmConsignment.vb
Public Class frmConsignment

Page 168 of 227

Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents btnDelete As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents DataGrid As System.Windows.Forms.DataGrid Friend WithEvents btnExit As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Label8 As System.Windows.Forms.Label Friend WithEvents Label7 As System.Windows.Forms.Label Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents btnSearch As System.Windows.Forms.Button Friend WithEvents Label6 As System.Windows.Forms.Label Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents Label12 As System.Windows.Forms.Label Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox Friend WithEvents Label19 As System.Windows.Forms.Label Friend WithEvents Label18 As System.Windows.Forms.Label Friend WithEvents Label13 As System.Windows.Forms.Label Friend WithEvents Label14 As System.Windows.Forms.Label Friend WithEvents Label15 As System.Windows.Forms.Label Friend WithEvents Label16 As System.Windows.Forms.Label

Page 169 of 227

Friend WithEvents Label17 As System.Windows.Forms.Label Friend WithEvents Label20 As System.Windows.Forms.Label Friend WithEvents Label21 As System.Windows.Forms.Label Friend WithEvents Label22 As System.Windows.Forms.Label Friend WithEvents Label23 As System.Windows.Forms.Label Friend WithEvents Label24 As System.Windows.Forms.Label Friend WithEvents Label25 As System.Windows.Forms.Label Friend WithEvents txtAmount As System.Windows.Forms.TextBox Friend WithEvents txtValue As System.Windows.Forms.TextBox Friend WithEvents txtQuantity As System.Windows.Forms.TextBox Friend WithEvents txtConsignmentID As System.Windows.Forms.TextBox Friend WithEvents txtDesc As System.Windows.Forms.TextBox Friend WithEvents txtWeight As System.Windows.Forms.TextBox Friend WithEvents txtHeight As System.Windows.Forms.TextBox Friend WithEvents txtBreadth As System.Windows.Forms.TextBox Friend WithEvents txtLength As System.Windows.Forms.TextBox Friend WithEvents DOC As System.Windows.Forms.DateTimePicker Friend WithEvents DOA As System.Windows.Forms.DateTimePicker Friend WithEvents DOD As System.Windows.Forms.DateTimePicker Friend WithEvents TOA As System.Windows.Forms.DateTimePicker Friend WithEvents cmbConsignorID As System.Windows.Forms.ComboBox Friend WithEvents cSMStationID As System.Windows.Forms.ComboBox Friend WithEvents comDestination As System.Windows.Forms.ComboBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.btnDelete = New System.Windows.Forms.Button Me.Label5 = New System.Windows.Forms.Label Me.Label4 = New System.Windows.Forms.Label Me.DataGrid = New System.Windows.Forms.DataGrid Me.btnExit = New System.Windows.Forms.Button Me.btnCancel = New System.Windows.Forms.Button Me.btnSave = New System.Windows.Forms.Button Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.txtAmount = New System.Windows.Forms.TextBox Me.Label8 = New System.Windows.Forms.Label Me.Label7 = New System.Windows.Forms.Label Me.txtValue = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.txtQuantity = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.txtConsignmentID = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.btnSearch = New System.Windows.Forms.Button Me.Label6 = New System.Windows.Forms.Label Me.Label11 = New System.Windows.Forms.Label Me.txtDesc = New System.Windows.Forms.TextBox Me.Label12 = New System.Windows.Forms.Label Me.GroupBox3 = New System.Windows.Forms.GroupBox Me.Label19 = New System.Windows.Forms.Label Me.txtWeight = New System.Windows.Forms.TextBox Me.Label18 = New System.Windows.Forms.Label Me.txtHeight = New System.Windows.Forms.TextBox Me.Label13 = New System.Windows.Forms.Label Me.txtBreadth = New System.Windows.Forms.TextBox Me.Label14 = New System.Windows.Forms.Label Me.Label15 = New System.Windows.Forms.Label

Page 170 of 227

Me.txtLength = New System.Windows.Forms.TextBox Me.Label16 = New System.Windows.Forms.Label Me.Label17 = New System.Windows.Forms.Label Me.DOC = New System.Windows.Forms.DateTimePicker Me.Label20 = New System.Windows.Forms.Label Me.Label21 = New System.Windows.Forms.Label Me.DOA = New System.Windows.Forms.DateTimePicker Me.Label22 = New System.Windows.Forms.Label Me.DOD = New System.Windows.Forms.DateTimePicker Me.Label23 = New System.Windows.Forms.Label Me.Label24 = New System.Windows.Forms.Label Me.TOA = New System.Windows.Forms.DateTimePicker Me.Label25 = New System.Windows.Forms.Label Me.cmbConsignorID = New System.Windows.Forms.ComboBox Me.cSMStationID = New System.Windows.Forms.ComboBox Me.comDestination = New System.Windows.Forms.ComboBox CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox2.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.GroupBox3.SuspendLayout() Me.SuspendLayout() ' 'btnDelete ' Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Location = New System.Drawing.Point(96, 272) Me.btnDelete.Name = "btnDelete" Me.btnDelete.Size = New System.Drawing.Size(80, 32) Me.btnDelete.TabIndex = 53 Me.btnDelete.Text = "&Delete" ' 'Label5 ' Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label5.Location = New System.Drawing.Point(40, 312) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(288, 32) Me.Label5.TabIndex = 52 Me.Label5.Text = "Previous Records" Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.Location = New System.Drawing.Point(40, 8) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(288, 24) Me.Label4.TabIndex = 51 Me.Label4.Text = "Consignment"

Page 171 of 227

Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'DataGrid ' Me.DataGrid.DataMember = "" Me.DataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid.Location = New System.Drawing.Point(8, 352) Me.DataGrid.Name = "DataGrid" Me.DataGrid.Size = New System.Drawing.Size(712, 152) Me.DataGrid.TabIndex = 50 ' 'btnExit ' Me.btnExit.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnExit.Location = New System.Drawing.Point(272, 272) Me.btnExit.Name = "btnExit" Me.btnExit.Size = New System.Drawing.Size(80, 32) Me.btnExit.TabIndex = 49 Me.btnExit.Text = "&E&xit" ' 'btnCancel ' Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnCancel.Location = New System.Drawing.Point(184, 272) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(80, 32) Me.btnCancel.TabIndex = 48 Me.btnCancel.Text = "&Cancel" ' 'btnSave ' Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSave.Location = New System.Drawing.Point(8, 272) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(80, 32) Me.btnSave.TabIndex = 47 Me.btnSave.Text = "&Save" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.Label20) Me.GroupBox2.Controls.Add(Me.DOC) Me.GroupBox2.Controls.Add(Me.txtAmount) Me.GroupBox2.Controls.Add(Me.Label8) Me.GroupBox2.Controls.Add(Me.Label7) Me.GroupBox2.Controls.Add(Me.txtValue) Me.GroupBox2.Controls.Add(Me.Label2) Me.GroupBox2.Controls.Add(Me.txtQuantity) Me.GroupBox2.Controls.Add(Me.Label1)

Page 172 of 227

Me.GroupBox2.Location = New System.Drawing.Point(8, 136) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(344, 120) Me.GroupBox2.TabIndex = 46 Me.GroupBox2.TabStop = False ' 'txtAmount ' Me.txtAmount.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtAmount.Location = New System.Drawing.Point(120, 88) Me.txtAmount.Name = "txtAmount" Me.txtAmount.Size = New System.Drawing.Size(208, 20) Me.txtAmount.TabIndex = 9 Me.txtAmount.Text = "" ' 'Label8 ' Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label8.Location = New System.Drawing.Point(16, 88) Me.Label8.Name = "Label8" Me.Label8.Size = New System.Drawing.Size(96, 24) Me.Label8.TabIndex = 8 Me.Label8.Text = "Bill Amount:" Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label7 ' Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label7.Location = New System.Drawing.Point(16, 40) Me.Label7.Name = "Label7" Me.Label7.Size = New System.Drawing.Size(96, 24) Me.Label7.TabIndex = 6 Me.Label7.Text = "Consignment Date:" Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtValue ' Me.txtValue.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtValue.Location = New System.Drawing.Point(120, 64) Me.txtValue.Name = "txtValue" Me.txtValue.Size = New System.Drawing.Size(208, 20) Me.txtValue.TabIndex = 3 Me.txtValue.Text = "" ' 'Label2 '

Page 173 of 227

Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(16, 64) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 24) Me.Label2.TabIndex = 2 Me.Label2.Text = "Item Value:" Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtQuantity ' Me.txtQuantity.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtQuantity.Location = New System.Drawing.Point(120, 16) Me.txtQuantity.Name = "txtQuantity" Me.txtQuantity.Size = New System.Drawing.Size(208, 20) Me.txtQuantity.TabIndex = 1 Me.txtQuantity.Text = "" ' 'Label1 ' Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(96, 24) Me.Label1.TabIndex = 0 Me.Label1.Text = "No. Of Items:" Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.cSMStationID) Me.GroupBox1.Controls.Add(Me.cmbConsignorID) Me.GroupBox1.Controls.Add(Me.Label11) Me.GroupBox1.Controls.Add(Me.Label6) Me.GroupBox1.Controls.Add(Me.txtConsignmentID) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.btnSearch) Me.GroupBox1.Location = New System.Drawing.Point(8, 40) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(344, 96) Me.GroupBox1.TabIndex = 45 Me.GroupBox1.TabStop = False ' 'txtConsignmentID ' Me.txtConsignmentID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtConsignmentID.Location = New System.Drawing.Point(120, 16) Me.txtConsignmentID.Name = "txtConsignmentID"

Page 174 of 227

Me.txtConsignmentID.Size = New System.Drawing.Size(144, 20) Me.txtConsignmentID.TabIndex = 7 Me.txtConsignmentID.Text = "" ' 'Label3 ' Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(24, 16) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(96, 24) Me.Label3.TabIndex = 6 Me.Label3.Text = "Consignment ID:" Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'btnSearch ' Me.btnSearch.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnSearch.Location = New System.Drawing.Point(272, 16) Me.btnSearch.Name = "btnSearch" Me.btnSearch.Size = New System.Drawing.Size(64, 32) Me.btnSearch.TabIndex = 5 Me.btnSearch.Text = "&Search" ' 'Label6 ' Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label6.Location = New System.Drawing.Point(24, 40) Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(96, 24) Me.Label6.TabIndex = 8 Me.Label6.Text = "Consignor ID:" Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label11 ' Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label11.Location = New System.Drawing.Point(24, 64) Me.Label11.Name = "Label11" Me.Label11.Size = New System.Drawing.Size(96, 16) Me.Label11.TabIndex = 10 Me.Label11.Text = "Station ID:" Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtDesc '

Page 175 of 227

Me.txtDesc.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtDesc.Location = New System.Drawing.Point(120, 16) Me.txtDesc.Multiline = True Me.txtDesc.Name = "txtDesc" Me.txtDesc.Size = New System.Drawing.Size(208, 80) Me.txtDesc.TabIndex = 13 Me.txtDesc.Text = "" ' 'Label12 ' Me.Label12.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label12.Location = New System.Drawing.Point(16, 16) Me.Label12.Name = "Label12" Me.Label12.Size = New System.Drawing.Size(96, 24) Me.Label12.TabIndex = 12 Me.Label12.Text = "Description:" Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'GroupBox3 ' Me.GroupBox3.Controls.Add(Me.comDestination) Me.GroupBox3.Controls.Add(Me.Label24) Me.GroupBox3.Controls.Add(Me.TOA) Me.GroupBox3.Controls.Add(Me.Label22) Me.GroupBox3.Controls.Add(Me.DOD) Me.GroupBox3.Controls.Add(Me.Label21) Me.GroupBox3.Controls.Add(Me.DOA) Me.GroupBox3.Controls.Add(Me.Label19) Me.GroupBox3.Controls.Add(Me.txtWeight) Me.GroupBox3.Controls.Add(Me.Label18) Me.GroupBox3.Controls.Add(Me.txtDesc) Me.GroupBox3.Controls.Add(Me.Label12) Me.GroupBox3.Controls.Add(Me.txtHeight) Me.GroupBox3.Controls.Add(Me.Label13) Me.GroupBox3.Controls.Add(Me.txtBreadth) Me.GroupBox3.Controls.Add(Me.Label14) Me.GroupBox3.Controls.Add(Me.Label15) Me.GroupBox3.Controls.Add(Me.txtLength) Me.GroupBox3.Controls.Add(Me.Label16) Me.GroupBox3.Controls.Add(Me.Label17) Me.GroupBox3.Controls.Add(Me.Label23) Me.GroupBox3.Location = New System.Drawing.Point(368, 40) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Size = New System.Drawing.Size(344, 304) Me.GroupBox3.TabIndex = 54 Me.GroupBox3.TabStop = False ' 'Label19 ' Me.Label19.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Page 176 of 227

Me.Label19.Location = New System.Drawing.Point(16, 248) Me.Label19.Name = "Label19" Me.Label19.Size = New System.Drawing.Size(96, 24) Me.Label19.TabIndex = 16 Me.Label19.Text = "Destination:" Me.Label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtWeight ' Me.txtWeight.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtWeight.Location = New System.Drawing.Point(120, 224) Me.txtWeight.Name = "txtWeight" Me.txtWeight.Size = New System.Drawing.Size(208, 20) Me.txtWeight.TabIndex = 15 Me.txtWeight.Text = "" ' 'Label18 ' Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label18.Location = New System.Drawing.Point(16, 224) Me.Label18.Name = "Label18" Me.Label18.Size = New System.Drawing.Size(96, 24) Me.Label18.TabIndex = 14 Me.Label18.Text = "Weight:" Me.Label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtHeight ' Me.txtHeight.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtHeight.Location = New System.Drawing.Point(120, 200) Me.txtHeight.Name = "txtHeight" Me.txtHeight.Size = New System.Drawing.Size(208, 20) Me.txtHeight.TabIndex = 11 Me.txtHeight.Text = "" ' 'Label13 ' Me.Label13.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label13.Location = New System.Drawing.Point(16, 200) Me.Label13.Name = "Label13" Me.Label13.Size = New System.Drawing.Size(96, 24) Me.Label13.TabIndex = 10 Me.Label13.Text = "Height:" Me.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtBreadth

Page 177 of 227

' Me.txtBreadth.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtBreadth.Location = New System.Drawing.Point(120, 176) Me.txtBreadth.Name = "txtBreadth" Me.txtBreadth.Size = New System.Drawing.Size(208, 20) Me.txtBreadth.TabIndex = 9 Me.txtBreadth.Text = "" ' 'Label14 ' Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label14.Location = New System.Drawing.Point(16, 176) Me.Label14.Name = "Label14" Me.Label14.Size = New System.Drawing.Size(96, 24) Me.Label14.TabIndex = 8 Me.Label14.Text = "Breadth:" Me.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label15 ' Me.Label15.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label15.Location = New System.Drawing.Point(16, 128) Me.Label15.Name = "Label15" Me.Label15.Size = New System.Drawing.Size(96, 24) Me.Label15.TabIndex = 6 Me.Label15.Text = "Arrival Time:" Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'txtLength ' Me.txtLength.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtLength.Location = New System.Drawing.Point(120, 152) Me.txtLength.Name = "txtLength" Me.txtLength.Size = New System.Drawing.Size(208, 20) Me.txtLength.TabIndex = 3 Me.txtLength.Text = "" ' 'Label16 ' Me.Label16.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label16.Location = New System.Drawing.Point(16, 152) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(96, 24) Me.Label16.TabIndex = 2 Me.Label16.Text = "Length:"

Page 178 of 227

Me.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label17 ' Me.Label17.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label17.Location = New System.Drawing.Point(16, 104) Me.Label17.Name = "Label17" Me.Label17.Size = New System.Drawing.Size(96, 24) Me.Label17.TabIndex = 0 Me.Label17.Text = "Arrival Date:" Me.Label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'DOC ' Me.DOC.CustomFormat = "dd/MM/yyyy" Me.DOC.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.DOC.Location = New System.Drawing.Point(120, 40) Me.DOC.Name = "DOC" Me.DOC.Size = New System.Drawing.Size(112, 20) Me.DOC.TabIndex = 14 ' 'Label20 ' Me.Label20.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label20.Location = New System.Drawing.Point(240, 40) Me.Label20.Name = "Label20" Me.Label20.Size = New System.Drawing.Size(88, 24) Me.Label20.TabIndex = 15 Me.Label20.Text = "DD/MM/YYYY" Me.Label20.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label21 ' Me.Label21.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label21.Location = New System.Drawing.Point(240, 104) Me.Label21.Name = "Label21" Me.Label21.Size = New System.Drawing.Size(88, 24) Me.Label21.TabIndex = 19 Me.Label21.Text = "DD/MM/YYYY" Me.Label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'DOA ' Me.DOA.CustomFormat = "dd/MM/yyyy" Me.DOA.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.DOA.Location = New System.Drawing.Point(120, 104) Me.DOA.Name = "DOA"

Page 179 of 227

Me.DOA.Size = New System.Drawing.Size(112, 20) Me.DOA.TabIndex = 18 ' 'Label22 ' Me.Label22.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label22.Location = New System.Drawing.Point(240, 272) Me.Label22.Name = "Label22" Me.Label22.Size = New System.Drawing.Size(88, 24) Me.Label22.TabIndex = 21 Me.Label22.Text = "DD/MM/YYYY" Me.Label22.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'DOD ' Me.DOD.CustomFormat = "dd/MM/yyyy" Me.DOD.Format = System.Windows.Forms.DateTimePickerFormat.Custom Me.DOD.Location = New System.Drawing.Point(120, 272) Me.DOD.Name = "DOD" Me.DOD.Size = New System.Drawing.Size(112, 20) Me.DOD.TabIndex = 20 ' 'Label23 ' Me.Label23.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label23.Location = New System.Drawing.Point(16, 272) Me.Label23.Name = "Label23" Me.Label23.Size = New System.Drawing.Size(96, 24) Me.Label23.TabIndex = 16 Me.Label23.Text = "Delivery Date:" Me.Label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'Label24 ' Me.Label24.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label24.Location = New System.Drawing.Point(240, 128) Me.Label24.Name = "Label24" Me.Label24.Size = New System.Drawing.Size(88, 24) Me.Label24.TabIndex = 23 Me.Label24.Text = "HH:MM:SS" Me.Label24.TextAlign = System.Drawing.ContentAlignment.MiddleRight ' 'TOA ' Me.TOA.CustomFormat = "" Me.TOA.Format = System.Windows.Forms.DateTimePickerFormat.Time Me.TOA.Location = New System.Drawing.Point(120, 128) Me.TOA.Name = "TOA"

Page 180 of 227

Me.TOA.Size = New System.Drawing.Size(112, 20) Me.TOA.TabIndex = 22 ' 'Label25 ' Me.Label25.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label25.Location = New System.Drawing.Point(392, 8) Me.Label25.Name = "Label25" Me.Label25.Size = New System.Drawing.Size(288, 24) Me.Label25.TabIndex = 55 Me.Label25.Text = "Consignment Details" Me.Label25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'cmbConsignorID ' Me.cmbConsignorID.Location = New System.Drawing.Point(120, 40) Me.cmbConsignorID.Name = "cmbConsignorID" Me.cmbConsignorID.Size = New System.Drawing.Size(144, 21) Me.cmbConsignorID.TabIndex = 12 ' 'cSMStationID ' Me.cSMStationID.Location = New System.Drawing.Point(120, 64) Me.cSMStationID.Name = "cSMStationID" Me.cSMStationID.Size = New System.Drawing.Size(144, 21) Me.cSMStationID.TabIndex = 13 ' 'comDestination ' Me.comDestination.Location = New System.Drawing.Point(120, 248) Me.comDestination.Name = "comDestination" Me.comDestination.Size = New System.Drawing.Size(208, 21) Me.comDestination.TabIndex = 24 ' 'frmConsignment ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(728, 510) Me.Controls.Add(Me.Label25) Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.Label5) Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.DataGrid) Me.Controls.Add(Me.btnExit) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Name = "frmConsignment" Me.Text = "Consignment Details" CType(Me.DataGrid, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox2.ResumeLayout(False)

Page 181 of 227

Me.GroupBox1.ResumeLayout(False) Me.GroupBox3.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region Dim objConsignment As ShippingDataLogic.BLConsignmentDetails Dim dsConsignment As DataSet Private Sub ClearFields() txtConsignmentID.Text = vbNullString txtValue.Text = vbNullString txtQuantity.Text = vbNullString txtConsignmentID.Focus() End Sub Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click objConsignment = Nothing dsConsignment = Nothing Me.Dispose() End Sub Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click If btnSave.Text = "&Save" Then SaveConsignment() ClearFields() objConsignment = New ShippingDataLogic.BLConsignmentDetails DataGrid.DataSource = objConsignment.GetConsignmentDetails Else UpdateConsignment() ClearFields() objConsignment = New ShippingDataLogic.BLConsignmentDetails DataGrid.DataSource = objConsignment.GetConsignmentDetails End If End Sub Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click ClearFields() objConsignment = New ShippingDataLogic.BLConsignmentDetails DataGrid.DataSource = objConsignment.GetConsignmentDetails End Sub Private Sub frmConsignment_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing objConsignment.Dispose() objConsignment = Nothing End Sub Private Sub SaveConsignment() Try objConsignment = New ShippingDataLogic.BLConsignmentDetails

Page 182 of 227

dsConsignment = objConsignment.GetConsignmentDetails '**** Below line in important. Otherwise ' We will get message of Primary key violation dsConsignment.Tables("Consignment").Rows.Clear() Dim objDataRow As DataRow = dsConsignment.Tables("Consignment").NewRow objDataRow.Item("ConsignmentNo") = txtConsignmentID.Text.Trim objDataRow.Item("ConsignmentName") = txtValue.Text.Trim objDataRow.Item("ConsignmentID") = txtValue.Text.Trim dsConsignment.Tables("Consignment").Rows.Add(objDataRow) If Not objConsignment.AddConsignmentDetails(dsConsignment) Then Throw New Exception("Insert Consignment failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub UpdateConsignment() Try objConsignment = New ShippingDataLogic.BLConsignmentDetails dsConsignment = objConsignment.GetConsignmentDetails '**** Below line in important. Otherwise ' We will get message of Primary key violation dsConsignment.Tables("Consignment").Rows.Clear() Dim objDataRow As DataRow = dsConsignment.Tables("Consignment").NewRow objDataRow.Item("ConsignmentNo") = txtConsignmentID.Text.Trim objDataRow.Item("ConsignmentName") = txtValue.Text.Trim objDataRow.Item("ConsignmentID") = txtValue.Text.Trim dsConsignment.Tables("Consignment").Rows.Add(objDataRow) If Not objConsignment.UpdateConsignmentDetails(dsConsignment) Then Throw New Exception("Update Consignment failed!!!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) Finally ClearFields() End Try End Sub Private Sub DeleteConsignment() Try objConsignment = New ShippingDataLogic.BLConsignmentDetails

Page 183 of 227

If Not objConsignment.DeleteConsignmentDetails(txtConsignmentID.Text) Then Throw New Exception("Delete Consignment Failed!") End If Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try ClearFields() End Sub Private Sub SearchConsignment() Try objConsignment = New ShippingDataLogic.BLConsignmentDetails dsConsignment = objConsignment.GetConsignmentDetails(txtConsignmentID.Text.Trim) txtValue.Text = dsConsignment.Tables("Consignment").Rows(0).Item("ConsignmentName") txtQuantity.Text = dsConsignment.Tables("Consignment").Rows(0).Item("ConsignmentID") Catch ex As Exception Throw New System.Exception(ex.Message, ex.InnerException) End Try End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click SearchConsignment() End Sub Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click Dim Ans As Long Ans = MsgBox("Do you really want to delete the Record?", MsgBoxStyle.Critical + MsgBoxStyle.YesNo, "Delete Record") If Ans = vbYes Then DeleteConsignment() Else ClearFields() End If End Sub End Class

4.2.

Comments and Description


Page 184 of 227

While coding it is necessary from the programmers point of view to write comments and the description for the piece of code being used. It can be easily done in VB.NET. Just put a single cote () and write the purpose of the code. It is very handy when we want to understand the purpose of the code. The sample is given below for the subroutine OpenDB. Public Sub OpenDB(ByVal Table As String) 'Subroutine to open the database ConnString =
server=localhost; integrated security=sspi; database=Shipping '

Connection string to connect the database Connection = New OleDbConnection(ConnString) ' initializing the connection DataAdapter = New OleDbDataAdapter("Select * from " & Table, Connection) ' Opening the connection DT = New DataTable ' Creating new data table object DataAdapter.Fill(DT) ' Populating the Data Table with data End Sub

4.3.

Standardization of the coding/Code Efficiency

While coding, it is seen that there are some sorts of code, which are being used so frequently in each module. So it is not feasible to write the same code again and again. So, it is better to make a function, may be private or public, and call that piece of code whenever necessary. In the piece of code below, the ClearFields function can be used to clear the text boxes used the form whenever necessary. Again in the subroutine OpenDB can be used to connect the database any it needs to connect the database. These codes are called several times in the program, hence the code is optimized. Private Sub ClearFields()

Page 185 of 227

txtStaffId.Text = "" txtName.Text = "" txtAddress.Text = "" txtPhone.Text = "" txtDoj.Text = "" cmbType.Text = "" txtSpecialization.Text = "" txtQualification.Text = "" cmbLevel.Text = "" cmbActive.Text = "" txtStaffId.Focus() End Sub Public Sub OpenDB(ByVal Table As String) ConnString = "
server=localhost; integrated security=sspi; database=Shipping

Connection = New OleDbConnection(ConnString) DataAdapter = New OleDbDataAdapter("Select * from " & Table, Connection) DT = New DataTable() DataAdapter.Fill(DT) End Sub

4.4.

Error handling

Error can be done is various way. The best method can be followed is using the try-catch-finally method. Using Try-Catch-Finally blocks we can easily handle errors that might occur during code execution. When exceptions are thrown, they are handled in the Catch block before code in the Finally block is executed. Page 186 of 227

Try OpenDB(Table) DataAdapter.InsertCommand = New OleDb.OleDbCommand(SQL, Connection) DR = DT.NewRow DT.Rows.Add(DR) DataAdapter.Update(DT) Catch MessageBox.Show(Err.Description.ToString, "Save error...", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally CloseDB() ClearFields() End Try

The other ways VB.NET support are On Error Resume Next and On Error Go To FlagName keywords to handle error or exception in a piece of code.

4.5.

Parameter Calling/Passing

In some functions it needs to pass some objects to do a specific work. As for example in the code below we write a function named PassRead, which is used to read password from the database. The password varies as the user name changes. So, it is better to pass the name of the user to the function as parameter and retrieve the required password. Besides, the function OpenDB can be used to open any table passing the name of the table as parameter to the function. Public Function PassRead(ByVal UserName As String) As String

Page 187 of 227

Dim STR As String Dim i As Integer SQL = "Select Password from Login where UserName=" & "'" & UserName & "'" OpenDB("Login") DT = New DataTable() DataAdapter = New OleDbDataAdapter(SQL, Connection) DataAdapter.Fill(DT) STR = DT.Rows(0).Item(0).ToString ReDim Preserve Password(Len(STR)) For i = 1 To Len(STR) Password(i) = Chr((Asc(Mid(STR, i, 1)) + 15) Xor 34) Next Dim l As Integer l = Len(STR) STR = "" For i = 1 To l STR = STR + Password(i) Next PassRead = STR End Function

4.6.

Validation Checks

The validation checks for each of the forms are as follows: Form 1. Login Form In this form a user has to type his/her name. No blank name followed by ok button click is accepted. An error message flashes if user

Page 188 of 227

does this. Only cancel button click is accepted at any time to abort the process. Form 2. Vehicle Entry Form In this form user has to input the details of the Vehicle. In the name field no number like 1 2 3 is allowed. Similarly, the vehicle number should be in numbers only, no character is allowed. The data will not be saved unless the user inputs each and every fields of the form. Form 3. Vehicle Edit Form This form is used to update the data of the Vehicle. In this form user has to input the vehicle id of the vehicle and search the record. In the name field no number like 1 2 3 is allowed. Similarly, the vehicle number should be in numbers only, no character is allowed. The data will not be saved unless the user inputs each and every fields of the form.

5. Testing
The aim of the testing process is to identify all defects existing in a software product or we can say that testing is a process of executing a program with the intent of finding an error. Testing a program consists of providing the program with a set of test inputs and observing if the program behaves as expected. A successful test is one that uncovers an as-yetundiscovered error. Exhaustive testing of almost any non-trivial system is impractical due to the fact that the domain of input data values to most practical software systems is either extremely large or infinite. Therefore we must design an optimal test suite that is of reasonable size and can uncover as many errors existing in the system as possible. A good test

Page 189 of 227

case is one that has a high probability of finding an as-yet-undiscovered error. A testing involves lot of creative thinking.

5.1.

Testing techniques and Testing strategies

Testing is an integral part in software development. It is broadly deployed in every phase in the software development cycle. Typically, more than 50% percent of the development time is spent in testing. Testing is usually performed for the following purposes: To improve quality For Verification & Validation (V&V) For reliability estimation Taxonomy Functionality (exterior quality) Correctness Reliability Usability Integrity Engineering (interior quality) Efficiency Testability Documentation Structure Adaptability (future quality) Flexibility Reusability Maintainability

Good testing provides measures for all relevant factors. The importance of any particular factor varies from application to application. After the generation of code the testing process of the project begins. It focuses on the logical internals of the functional externals; that is conducting tests to uncover errors to ensure that desired coding will be produced in the sender side along with accurate decoding on the receiver side.

Page 190 of 227

The following steps are considered to design effective test of the project: My entire test is traceable to coding and encoding activities and my Tests were planned long before testing began. The test started and

entire test is based on detecting errors in the process logic. continued along with the development of the modules. This not only helped in saving the extra amount of time but also helped in fixing the logical errors which were unknown during the concept development time. Applied Pareto principal applies to my software testing. Applying

Pareto principal I allotted 40 percent of my time in concept development which included devising of algorithms, testing of space/time complexities etc., then 20 percent to coding and rest to testing and implementation purpose. Test techniques applied and a schedule for my testing strategy is given below: Correctness testing: Correctness is the minimum requirement of software, the essential purpose of testing Correctness testing will need some type of oracle, to tell the right behavior from the wrong one. The tester may or may not know the inside details of the software module under test, e.g. control flow, data flow, etc. Therefore, either a white-box point of view or black-box point of view can be taken in testing software. We must note that the black-box and white-box ideas are not limited in correctness testing only. Unit Testing: Unit Testing started with the completion of each unit module, for example I first completed the Consignee Addition module. In this module I add a data for a new Consignee. After this I checked the database whether the Consignee is added or not. Thus I have checked all the other modules in similar fashion. White Box Testing:

Page 191 of 227

In practice White Box testing should not be done by the designer hSMSelf, it must be done by the client, though I myself have done the White Box Testing. At fist glance it would seem that very thorough white box testing would lead to "100 percent correct programs," All I needed to do all logical paths to exercise them and evaluates results. For even small program the number of possible paths can be very large. Black Box Testing: In this Black Box Testing or behavioral testing, focuses on the functional requirements of the program. That is, Black Box Testing enables to me to derive sets of input conditions that will fully exercise all functional requirements for my program. I found it is not an alternative to White Box techniques. Rather it is complimentary approach that is likely to uncover different Route errors than White Box methods. In this testing technique I attempted to find errors in the following categories: (1) Incorrect or missing function (2) Interface error (3) errors in data structure and external data base access. (4) Behavior or performance errors and (5) initialization and termination errors. I have applied some question for this testing technique, they are as follows: What type of input format will make good test cases? How is system behavior and performance tested? How is functional validity tested? What effect will specific combinations of message formats have on system operations for particular encoding/decoding technique. What data rates and data volume can the system tolerate?

Top-down Integration Testing :

Page 192 of 227

After the development of all the modules I start integrating the modules with the main module. I carried out integration testing at the interface of the two modules. The context of testing is described as follows: The program is constructed and tested in small increments where errors are easier to isolate and correct; interfaces are more likely to be tested completely. And a systematic test approach may be applied. I followed only the Top down Integration Testing. It is an incremental approach to construction of program structure. Alpha and Beta Testing: It is really impossible for me to foresee how my project will perform during the peak work load time of the network. The beta test conducted at one or more Consignee sites (the project would be delivered). So that recognition process works properly with different users. Testing GUI's: Graphical user interfaces (GUIs) offer interesting challenges to a software engineer. Due to reusable components in of GUI development environments, the creation of the user interface has become less time-consuming and more precise. But also the complexity of the GUI has grown with more difficulty in design and execution of test cases. GUIs have in general same look and feel. Hence, series of standard tests have been defined. The following checks have been done to test the GUIs. 1) For Windows: * Window opens properly as related to typed or menu based command. * Data content contained within the window is properly addressable with a mouse, function keys, directional arrows and keyboard.

* Window properly regenerates when it is overwritten and recalled.

Page 193 of 227

* All components such as Buttons, List Box, and Textbox etc. are displaying properly. * The active window is properly highlighted. * Window properly closes. 2) Full pull-down menus and mouse operations: * Appropriate menu bar is displayed in the appropriate context. * Pull-down operation work properly. * Mouse operations are properly recognized throughout the interactive text. * Multiple clicks are properly recognized in context. * Multiple buttons of mouse are properly recognized context. * The cursor, processing indicator and text pointer properly change as different operations are invoked. 3) Data Entry: * Alphanumeric data entry is properly echoed and input to the system. * Graphical modes of data entry (e.g., a slide bar) work properly. * Invalid data is properly recognized. * Data are input messages intelligible. In addition, finite state modeling graphs are used to derive a series of tests that address specific data and program objects that are relevant to the GUIs. Performance testing: Not all software systems have specifications on performance explicitly. But every system will have implicit performance requirements. The software should not take infinite time or infinite resource to execute. "Performance bugs" sometimes are used to refer to those design problems in software that cause the system performance to degrade.

Page 194 of 227

The typical method of doing performance testing is using a benchmark, a program, workload or trace designed to be representative of the typical system usage. Using Task manager in win XP/200/2003 it is noted that the system is not taking infinite recourses. Further, using benchmarking tool like system mechanic and dr.hardware the performance of the system is stated ok. Reliability testing: Software reliability refers to the probability of failure-free operation of a system. It is related to many aspects of software, including the testing process. Directly estimating software reliability by quantifying its related factors can be difficult. Testing is an effective sampling method to measure software reliability. Guided by the operational profile, software testing (usually black-box testing) can be used to obtain failure data, and an estimation model can be further used to analyze the data to estimate the present reliability and predict future reliability. Variances of reliability testing are Robustness testing Stress testing

There are no machine crashes, process hangs or abnormal termination. So it is passed ok in robustness testing. There is no resource exhaustion, bursts of activities, and system can sustained high loads. So it is also passed ok in stress testing. Security testing: Software quality, reliability and security are tightly coupled. Flaws in software can be exploited by intruders to open security holes. With the development of the Internet, software security problems are becoming even more severe. Security is tested in both application wise and database wise and the security test is positive in both. Page 195 of 227

Functionality Testing: Functionality testing is performed to verify that a software application performs and functions correctly according to design specifications. Whether you are in need of basic functionality tests to ensure that primary features function properly or you are in need of in depth verification of complex operations, SMS can meet your needs. For Functionality testing of SMS, I analyze the application and develop a comprehensive test plan that outlines all features and functional areas of the application that will be tested. The Test Plan includes Test Cases that outline how each feature and functional area will be tested. Some of the functional tests that we perform include: Compatibility Testing: Compatibility Testing services test the functionality and performance of a software application across multiple platform configurations. This type of testing typically uncovers compatibility issues with operating systems, other software applications, and hardware components. I execute the Test Plan and Test Cases on multiple platform configurations. SMS system will be tested: Using various client hardware configurations Using the minimum memory and hard drive space required Using various client Operating System combinations Using different network environments, when applicable Page 196 of 227 Simple Functional Testing Task Feature Testing Boundary Testing Forced Error Condition Testing Exploratory Testing

Using different printers and peripherals (i.e. zip drives, USBS, etc.) Using specified third-party software

Installation Testing: Installation testing is often an overlooked component of testing. This type of testing is performed to ensure that all Install features and options function properly and to verify that all necessary components of the application are installed. I perform several tests on the installation of an application to verify that the application can be installed with the minimum hard drive space required, with the minimum RAM required, onto removable drives (Zip and Jazz), and onto a drive other than the default drive. We also install the product on CLEAN systems (configurations with no other software installed) and DIRTY systems (configurations with other programs installed i.e. Virus checkers). We perform testing of all navigational buttons (Logon, Back, Exit, etc.), and user input fields to ensure that they function properly and yield the expected result. SMS Un-installation also needs to be tested to ensure that all data, executables, and .DLLs are removed. The un-installation of the application is tested using DOS command line. Usability Testing: For Usability Testing, we read and review every screen and dialog box of the software application, checking for spelling and grammatical errors as well as the overall design and layout. If Help files are included with the software application, we review the files to verify that the information contained in the files is correct and easy to understand and follow. Regression Testing: After the first round of testing is completed, regression testing needs to be performed to ensure that the reported errors are indeed fixed. Testing also needs to be performed to ensure that the fixes made to the application do not cause new errors to occur

Page 197 of 227

System Test Report Cover Sheet Name: Number of test cases: Number of failures found: Number of faults identified: System Report Grade Category Total Completeness 8(10) Failures 3(0) Faults 2(0) Test cases 17(25) Specifications 14(20) Critical-Evaluation 7(10) Presentation 7(10) Total Test Plan: Logon screen 1 2 3 4 5 6 7 Test Case Blank Id Blank Password Non-existing Id Non-existing Password Both valid Id Password Length mismatch Press Exit Button Error Application close Error Application close Passed Passed Expected Output Error Error Error Error & Allow Entry Observed Output Error Error Error Error Allow Entry Remarks Passed Passed Passed Passed Passed Points 8(10) 6(10) 7(10) 8(10) 7(10) 7(10) 7(10) 50(70) Nilambar Misra 17 3 2

Page 198 of 227

Consignee addition screen 1 2 3 4 5 6 Blank fields Duplicate record Bad data Valid data Length mismatch Press Exit Button Error Error Error Data Entry Error Application close Error Error Error Data Entry Error Application close Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Pressing button

Back Back to Choice

Back to Choice

Passed

Consignee updation screen 1 2 3 4 5 6 7 8 9 Blank search field Non-existing data Valid data Blank fields Bad data Valid data Length mismatch Press Exit Button Pressing button Error Error Allow Entry Error Error Data updation Error Application close Test Case Expected Output

Observed Output Error Error Allow Entry Error Error Data updation Error Application close Back to Choice

Remarks

Passed Passed Passed Passed Passed Passed Passed Passed Passed

Back Back to Choice

Page 199 of 227

Consignee deletion screen 1 2 3 5 6 7 Blank search field Non-existing data Valid data Length mismatch Press Exit Button Pressing button Error Error Data deletion Error Application close Error Error Data deletion Error Application close Back to Choice Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Back Back to Choice

Consignor Details addition screen 1 2 3 4 5 6 Blank fields Duplicate record Bad data Valid data Length mismatch Press Exit Button Error Error Error Data Entry Error Application close Error Error Error Data Entry Error Application close Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Pressing button

Back Back to Choice

Back to Choice

Passed

Consignor Details updation screen Test Case Expected Output Observed Output Remarks

Page 200 of 227

1 2 3 4 5 6 7 8 9

Blank search field Non-existing data Valid data Blank fields Bad data Valid data Length mismatch Press Exit Button Pressing button

Error Error Allow Entry Error Error Data updation Error Application close

Error Error Allow Entry Error Error Data updation Error Application close Back to Choice

Passed Passed Passed Passed Passed Passed Passed Passed Passed

Back Back to Choice

Consignor Details deletion screen 1 2 3 5 6 7 Blank search field Non-existing data Valid data Length mismatch Press Exit Button Pressing button Error Error Data deletion Error Application close Error Error Data deletion Error Application close Back to Choice Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Back Back to Choice

Consignor addition screen 1 2 Blank fields Duplicate record Error Error Error Error Passed Passed Test Case Expected Output Observed Output Remarks

Page 201 of 227

3 4 5 6

Bad data Valid data Length mismatch Press Exit Button

Error Data Entry Error Application close

Error Data Entry Error Application close

Passed Passed Passed Passed

Pressing button

Back Back to Choice

Back to Choice

Passed

Consignor updation screen 1 2 3 4 5 6 7 8 9 Blank search field Non-existing data Valid data Blank fields Bad data Valid data Length mismatch Press Exit Button Pressing button Error Error Allow Entry Error Error Data updation Error Application close Test Case Expected Output

Observed Output Error Error Allow Entry Error Error Data updation Error Application close Back to Choice

Remarks

Passed Passed Passed Passed Passed Passed Passed Passed Passed

Back Back to Choice

Consignor deletion screen 1 2 3 Blank search field Non-existing data Valid data Error Error Data deletion Error Error Data deletion Passed Passed Passed Test Case Expected Output Observed Output Remarks

Page 202 of 227

5 6 7

Length mismatch Press Exit Button Pressing button

Error Application close

Error Application close Back to Choice

Passed Passed Passed

Back Back to Choice

Consignme nt addition screen 1 2 3 4 5 6 Blank fields Duplicate record Bad data Valid data Length mismatch Press Exit Button Error Error Error Data Entry Error Application close Error Error Error Data Entry Error Application close Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Pressing button

Back Back to Choice

Back to Choice

Passed

Consignme nt updation screen 1 2 3 4 5 6 7 8 Blank search field Non-existing data Valid data Blank fields Bad data Valid data Length mismatch Press Exit Button Error Error Allow Entry Error Error Data updation Error Application close Test Case Expected Output

Observed Output Error Error Allow Entry Error Error Data updation Error Application

Remarks

Passed Passed Passed Passed Passed Passed Passed Passed

Page 203 of 227

close 9 Pressing button Back Back to Choice Back to Choice Passed

Consignme nt deletion screen 1 2 3 5 6 7 Blank search field Non-existing data Valid data Length mismatch Press Exit Button Pressing button Error Error Data deletion Error Application close Error Error Data deletion Error Application close Back to Choice Passed Passed Passed Passed Passed Passed Test Case Expected Output Observed Output Remarks

Back Back to Choice

Route addition screen 1 2 3 4 5 6 Blank fields Duplicate record Bad data Valid data Length mismatch Press Exit Button Test Case

Expected Output Error Error Error Data Entry Error Application close

Observed Output

Remarks

Error Error Error Data Entry Error Application close

Passed Passed Passed Passed Passed Passed

Pressing Back button

Back Choice

to Back to Choice

Passed

Page 204 of 227

Route updation screen 1 2 3 4 5 6 7 8 9 Blank search field Non-existing data Valid data Blank fields Bad data Valid data Length mismatch Press Exit Button Pressing Back button Error Error Allow Entry Error Error Data updation Error Application close Back to Choice Test Case Expected Output

Observed Output Error Error Allow Entry Error Error Data updation Error Application close Back to Choice

Remarks

Passed Passed Passed Passed Passed Passed Passed Passed Passed

Route deletion screen 1 2 3 5 6 7

Test Case Blank search field Non-existing data Valid data Length mismatch Press Exit Button Pressing button

Expected Output Error Error Data deletion Error Application close

Observed Output Error Error Data deletion Error Application close Back to Choice

Remarks Passed Passed Passed Passed Passed Passed

Back Back to Choice

Sample Test Outputs:

Page 205 of 227

Fig. 1: The Login window test case with wrong password.

Fig. 2: The Change Password window test case with wrong password.

Page 206 of 227

Fig. 3: The Edit Consignor window test case with wrong Consignor ID.

5.2.

Debugging and Code improvement

Programming errors are inevitable. Even very experienced programmers occasionally introduce errors, also known as bugs, while writing code. Debugging is the process of locating and fixing these errors. Types of Errors There are three basic types of errors you might encounter when writing code. Syntax errors represent code that cannot be understood by the compiler. Runtime errors are errors that occur when an attempt is made to perform an operation that is impossible to carry out. Logical errors are errors that result when code compiles and executes correctly, but returns an unexpected result. In this section, we will examine each error type in turn. Page 207 of 227

Syntax Errors A syntax error occurs when the compiler cannot compile the code it is given. For example, a syntax error occurs when keywords are typed incorrectly, punctuation is omitted, or an incorrect construct is parsed. Run-Time Errors Run-time errors occur when the application attempts to perform an operation that is not allowed. This includes operations that are impossible to carry out, such as division by zero, and operations that are not allowed, as in the case of security exceptions. When a run-time error occurs, an exception describing the error is thrown. Exceptions are special classes that are used to communicate error states between different parts of the application. You can write code to handle exceptions so that they do not halt execution of your application. Logical Errors Logical errors occur when the application compiles and executes correctly, but does not produce the expected results. These can be the most difficult type of errors to track down, because there might not be any indication as to the source of the error. Logical errors can result from something as innocuous as a misplaced decimal point.

You can use Break mode to examine your code line-by-line to identify and correct errors. Visual Studio .NET provides several options for stepping through code, including:
o

Step Into. To step through each line of code as it executes, including calls to other functions

Step Over.

Page 208 of 227

To step through each line of code as it executes, but step over calls to other functions
o

Step Out. To execute the remainder of code in the current function and stop at the next line in the function that called it, if applicable

Run To Cursor. To designate a line with the cursor and execute all the code leading up to that line

Set Next Statement. To set the next statement to be executed, skipping and not executing any intermediate lines

Breakpoints, used for debugging, are designated lines of code where execution halts and the application enters Break mode. Breakpoints can have conditions attached that determine whether the application will break or not. The Breakpoints window is where you manage, create, disable, or clear breakpoints.

Visual Studio .NET provides several tools for evaluating your program. The Locals, Autos, and Watch windows allow you to observe program variables while the application is running. The Command window allows you to execute code and print variable and property values to the window. Additional windows allow you to observe a variety of data regarding your application.

To identify and correct syntax errors From the Build menu, click Build Solution. Syntax errors appear in the Task List window.

Page 209 of 227

1. For Visual Basic .NET, double-click the error that reads Select Case must end with a matching End Select. You are taken to the end of the Select Case block. Examine the code and correct the error by correcting the syntax in the End Select line. Note that only two errors are displayed in the Task List window. 2. Double-click the first error in the Task List. You are taken to an error that cannot find a member named CurretOperation. Change this statement to read CurrentOperation to correct the error. 3. Double-click the final error in the Task List. Correct the spelling of Regiter2 to correct the error. 4. From the Build menu, choose Build Solution. Note that no further errors are discovered.

Now that we have rid our code of syntax errors, we can tackle the run-time errors and logical errors. To identify and correct a run-time error 1. Locate the NumberHandler method. This is a fairly simple method with minimal data path branching. This method builds a string of numbers as buttons 1 through 9 are pressed on the calculator face. 2. Develop a test plan for this method. Our test plan should explore all possible data branches and test the method with a variety of input and application variable values. Determine the expected results of each test case in advance. Table demonstrates some of the test cases you might use.

Page 210 of 227

Table. Test Cases for the NumberHandler Method Button Value of Value of Value CurrentNumberString of

expected 1 0 1 4 44 44 444 9 1266345578456 1266345578456 12663455784569 9 -3446.222231 -3446.222231 -3446.2222319 3 6 6 63 3. Execute our tests. Use the Locals, Autos, and Watch windows to observe the values of variables as the program executes. Use the Immediate window to assign values to variables. We can use Set Next Statement to rerun code multiple times. 4. Log your results and correct any run-time errors you find. Logical errors are the most difficult types of errors to identify. It frequently takes repeated testing to observe a problem and additional testing to identify the source of the error. To identify and correct a logical error 1. Locate the method named EqualsHandler. This method handles operations for the calculator when the equals (=) button is pressed. The number contained by the variable Register1 is added to, subtracted from, multiplied by, or divided into the number contained by Register2, and the value of that operation is assigned to Result. The user interface is then updated. 2. Execute the test plan shown in Table. Although incomplete, the plan does test every logical path through the method and should be sufficient to find a logical error. Note that boundary analysis and in-depth testing has been omitted for the purpose of brevity. Table. Test Cases for the EqualsHandler Method Current Operation Register1 Register2 Expected Value of Result Operation.Plus 442 5789 6231 Operation.Minus 400000 222222 177778 Operation.Multiply 23 12 276 Page 211 of 227

Pressed LabelDisplay.Text CurrentNumberString

Table. Test Cases for the EqualsHandler Method Current Operation Register1 Register2 Expected Value of Result Operation.Divide 3345 34 98.3823529411765 3. Diagnose and resolve any logical errors we encounter.

6. System Security Measures

6.1.

Database/data Security

The security is implemented in the system in two ways: a) Password: The system requires a valid password to open the application. Unauthorized access to the system is prevented by password security. The database is also requiring a password to login. b) Encryption: The data in the database is saved in encrypted form so that even if somebody sees the data, he will never be in a position to interpret the data saved in the database. When require, the data will be decrypted into readable form.

6.2.

Creation of user profile and access rights

There will be two types of users, viz. Administrator and User. The Administrator can do all the jobs designed in the system who can even

Page 212 of 227

deleted the records and change the passwords also, whereas the user has only the privilege of Data Entry Operator.

7. Cost Estimation
Cost in a project is due to requirements for Software, Hardware and Human Resource. Hardware resources are such things as the computer time, terminal time and memory requirement for the project, where as Software-resources include the tools and compilers needed during development. The bulk of the cost of Software development is due to the Human-resources needed, and most cost estimation procedures focus on the aspect. Most cost estimates are determined in turns of Person - Months (PM). By properly including Overheads (i.e. the cost of order, software, office space, etc.) in the Rupees cost of the person-month(PM), besides including the direct cost of the personmonth, most cost for a project can be inFlight by using PM as the basic measure. Estimates can be based on subjective opinion of some person or determined through the use of the models. Though, there are approaches to structure the opinion of the persons for achieving a consensus on the CostEstimate, it is generally accepted that it is important to have a more scientific approach to estimation through the use of models. Uncertainties in Cost-Estimation The cost of the project depends on the nature and characteristics of the project, at any point, the accuracy of the estimate will depend on the amount of reliable information we have about the final product. Clearly, when the product is delivered, the cost can be accurately determined, as all the data about the project and the resources spent can be fully known by then. This cost estimation with complete knowledge about the project. There is a great deal of uncertainties about the actual specification of the system. Specifications with uncertainties represent a range of possible final products, not one precisely denied product. Hence, the cost estimation based

Page 213 of 227

on this type of information cannot be accurate. Estimates at the phase of the project can be off by as much as a factor of four from the actual final cost. The accuracy of the actual cost estimates will depend on the effectiveness and accuracy of the cost estimation procedures or models employed and process. Cost estimation models have matured considerably and generally given fairly accurate estimates. For example, when the COCOMO model was checked with data from the projects it was found that the estimates were within 20% of the actual cost 68% of the time. It should also be mentioned that achieving a cost estimate after the requirements have been specified within 20% is actually quite good. Building Cost Estimation Models Any cost estimation model can be viewed as a Function that outputs the cost estimate. As the cost of a project depends on the nature of the project, clearly this cost estimation function will needed inputs about the project, from which it can produce the estimate. The basic idea of having a model or procedure for cost estimation is that it reduce the problem of estimation to estimating or determining the value of the key parameters that characterize the project, based on which the cost can be estimated. The problem of the estimation, not yet fully solved, is determining the key parameters whose value can be easily determined and how to get the cost estimate from the value of these. The most common approach for estimating effort is to make it a function of a single variable. Often these variables are the project size, and the equation of effort is considered: EFFORT = a * SIZE b Where a and b are constants Values for these constants for a particular process are determined through regression analysis, which is applied to data about the projects that has been performed in the past.

On size estimation The single variable cost models with size as depended variable results in simple looking models that can be easily obtained Page 214 of 227

from completed projects, applying them for estimation is not simple. The reason is that these models now require size as the input, and the size of the project is not known early in development and has to be estimated. This is particularly true if LOC is used as the measure of size in the model. One size estimates for components are available to get the overall size estimate for the system, the estimates of all the components can be added. With the size based model, if the size estimate is inaccurate, the cost estimate produced by the models will also be incorrect. Hence, it is important that good estimates for the size of the software be obtained. When estimating software size, the best way may be to get as much detail as possible about the software to be developed and to be aware of four basics when estimating the size of the various components. By obtaining details and using them for size estimation, the estimates are likely to be closer to the actual size of the final software. Here, we will discuss about the COCOMO model called as

CONSTRUCTIVE COST MODEL. This model estimates the total effort in terms of person months of the technical project staff. The effort estimates includes development, management, and support task but does not include the cost of the secretarial and other staff that might be needed in an organization. The basic steps in this model are: i) Obtain an initial estimate of the development effort from the estimates of thousand delivered lines of source code (KDLCOC). ii) Determine a set of 15 multiplying factors from different attributes of project. iii) Adjust effort estimates by multiplying the initial estimate with all the multiplying factors. The multiplying factors for all 15 cost drivers are multiplied to get the effort adjustment factor (EAF). The final effort estimate, E, is obtained by multiplying the initial estimate by EAF: E = EAF * Ei.

Page 215 of 227

The overall cost of the project can be estimated. For planning and monitoring purposes, estimates of the efforts required for the different phase is also desirable. In COCOMO, efforts for a phase are considered a defined percentage of the overall effort. COCOMO provides three levels of models of increasing complexity: basic, inter-mediate, and detailed. The model described earlier is the intermediate COCOMO model. The detailed model is the most complex. It has different multiplying factors for the different phases for a given cost driver. The set of cost drivers applicable to a system or module is also not the same as the drivers applicable to a system or module is also not the same as the drivers for the system level. However, it might be too detailed for many applications. We will follow the intermediate model described earlier, even for detailed estimates. COCOMO also provides help in determining the rating of different attributes and performing sensitivity and trade-off analysis. Using the COCOMO Model we can make the Cost-estimation of this project is like as follows: Project type = Organic. ConsConsignmentts for Organic Project are a=3.2, b=1.05 From the requirements, four major modules in the system are: data entry, data update, query, and report generator. It is also clear from the requirements that the project category is organic. The sizes for the different modules and the overall system are estimated to be Logon Choice Add/Update/Delete SMS-Query Reports Others 0.1 KDLOC 0.1 KDLOC 0.5 KDLOC 0.3 KDLOC 0.4 KDLOC 0.2 KDLOC

Page 216 of 227

TOTAL

1.6 KDLOC

From the requirements, the ratings of the different cost driver attributes are assessed. These ratings, along with their multiplying factors, are: Complexity Storage Experience Programmer Capability Nominal Nominal Nominal Nominal 1.05 1.10 1.15 1.00

All other factor had a nominal rating. From these, the effort adjustment factor (EAF) is EAF (Effort Adjustment Factor) = 1.02 * 1.10 * 1.14* 1.02 = 1.30. The initial effort (Ei) estimate for the project is obtained from the relevant equation which is: a * KDLOC b. We have, a = 3.2 and b = 1.05. Now putting into the above mentioned equation we get: Ei = 3.2 * (1.6) 1.05 PM. = 5.24 PM. Using the EAF, the adjusted effort estimate is E = EAF * Ei =1.30 * 5.24 PM. = 6.81 = 7 PM (approx). According to COCOMO model the effort estimated for different phases are: System Design = 0.16 * 7 = 1.12 Detail Design = 0.258 * 7 = 1.80

Code and Unit test = 0.417 * 7 = 2.91

Page 217 of 227

Integration = 0.97 The duration for the Project estimate for the project is obtained from the relevant equations: 2.5 * E 0.38 = 2.5 * (7) 0.38 = 2.5 * 2.09 = 5.22Months. The duration of the difference phases is: System design = .19 * 5.22 = 0.99 Months Programming =.623 * 5.22 = 3.25 Months.

Integration = .19 * 5.22 = 0.99 Months. The nominal productivity for the Project is: (Lines of Code (in thousand)* Effort (PM)) = 1.6 / 5.24 = 8.38 Average staff required for different phases is System design = 0.94 / 0.93 = 1.01 Persons = 1 person (approx.) Programming = 3.98 / 3.05 = 1.30 Persons = 1 person (approx.) Integration = 0.97 / 0.92 = 1.05 Persons = 2 persons (approx.) Using the productivity and EAF the effort estimate for different models can be determined as follow: Logon Choice Add/Update/Delete SMS-Query Reports 0.1/.41 * 1.32 = 0.32 PM 0.1/.41 * 1.32 = 0.32 PM 0.5/.41 * 1.32 = 1.56 PM 0.3/.41 * 1.32 = 0.96 PM 0.4/.41 * 1.32 = 1.28 PM Page 218 of 227

Others

0.2/.41 * 1.32 = 0.64 PM

So, at last this has been traced out that to complete the Project (SMS), The total time required = 5.08 = 5 Months (approx) If we assume the uniform wage amount and other installation equipment as the initial cost of the Project, as Rs. 3,000/-. So, the initial cost of my Project is = 5 X 3,000 = Rs. 15,000/-. If an extra amount of Rs. 500/- is added as the setup cost Hence, total cost of the project is Rs. 20, 000/-. The starting date of this Project is: 15th March, 2010. And, the ending date of this Project is: 15th September, 2010.

8. Reports

Various Reports

Fig14: Screen for the Report of Routes


Page 219 of 227

This screen is only for printing the Routes.

Fig15: Screen for the Report of Station This screen is only for printing the Station of the Shipping.

Fig16: Screen for the Report of Consignor This screen is only for printing the Consignor Information.

Page 220 of 227

Fig17: Screen for the Report of Tariff This screen is only for printing the Tariff Information.

9. Pert Chart
PERT Chart is a network of boxes (or circles) and arrows. There are different variations of PERT charts. The boxes in PERT chart can be decorated with their starting dates for the boxes at their heads. Some boxes can be designated as milestones.

The timeline PERT chart for the work structure:

Page 221 of 227

25/03/2010

Forms
15/03/2010 20/03/2010

31/03/2010

Start

Design Plan

Build DB Coding
25/07/2010

10/04/2010

15/07/2010

Integration & Testing

Documentation
12/09/2010 15/09/2010

Finish

Total Project time = 151 days

10.

Gantt Chart

Page 222 of 227

11.

Future Scope

The Shipping Management system can gradually replace the manual systems of Ship Yards. Since it is less-cost software hence the Shipping Companies can own it easily for the convenience of maintaining Database, for fast searching (availability) of Route, Container etc. This software can be upgraded as online system where anyone can search the availability of the information remotely. But before going for a web based networking the security features should be reviewed.

12.

Bibliography

Page 223 of 227

The reference books are: 1. Software Engineering, A practitioners approach- Roger S. Pressman. 2. Visual Basic .NET Programming BibleHank Morquis IDG Books Worldwide, Inc. 3. Mastering Visual Basic .NET Evangelos Petroutsos BPB Publications 4. Database Programming with ADO .NET Evangelos Petroutsos BPB Publications 5. Oracle 8i, The Complete Reference-Kevin Loney and George Koch Tara McGraw-Hill Edition: Cover Releases 8i Eric A.Smith, Valor Whisler, and

13.

Appendices

Abbreviations and Acronyms

Sl. No. 1 2 3 4 5 6 7 8 9 10

Term/ Abbreviations VB MS SQL SDLC SRS PERT COCOMO EAF LOC DFD

Description Visual Basic Microsoft Corporation Structured Query Language Software Development Life Cycle Software Requirement Specification Program Evaluation and Review Technique Constructive Cost Model Effort Adjustment Factor Line of Code Data Flow Diagram

Page 224 of 227

14.

Glossary

ADO.NET: The data access architecture for the Microsoft .NET Framework. ADO.NET is built around a disconnected data access model that uses a set of classes called a Data Provider to retrieve data from a data source. Common Language Runtime (CLR): The environment in which managed code executes. The common language runtime provides just-in-time compilation, enforces type safety, and manages memory through garbage collection. Data Provider: A set of classes that work together to provide managed data access. DataSet: A class that contains an application copy of data that has been retrieved from a data source. Exception: Any class that derives from System.Exception. Exceptions are thrown in response to run-time errors. See also throwing. Exception handling: The process of dealing with unusual occurrences within code so that it does not cause the program to crash or lose data. Foreign Key: In a data table, a column that contains a key value that uniquely identifies a record in a related table. Form: The primary unit of the user interface in a Windows Forms application. A form serves as a nexus for data display and user input, and can host controls. Graphic Device Interface (GDI): In Windows, a graphics display system used by applications to display or print bitmapped text (TrueType fonts), images, and other graphical elements. GDI+ is the name given to the .NET Frameworks managed implementation of the GDI.

Page 225 of 227

Interface: A contract for behavior that can be implemented by a class. Classes that implement the same interface can be expected to provide the members defined by the interface. Microsoft Intermediate Language (MSIL): A low-level language that is just-intime compiled to native code at run time. All .NET assemblies are represented in the MSIL. .NET Framework: A managed environment for the development and execution of code. It consists of the common language runtime and .NET Framework base class library. .NET Framework base class library: A collection of object-oriented types and interfaces that provides object models to assist in the development of your applications. Object: The base class for all types in the .NET Framework. More generically, any instance of a class or structure. Object-Oriented programming: The process of creating applications by using programmatic constructs to represent real-world objects. Optimization: The process of examining your application and modifying it to be more efficient in terms of either speed or size of the deployed application. Project: The collection of Visual Studio .NET source files that make up an application. Registry: The system repository for information about a computers settings. The registry can contain configuration information about programs and system components.

Page 226 of 227

Structured exception handling: Using TryCatchFinally blocks to handle errors that might occur during code execution. When exceptions are thrown, they are handled in the Catch block before code in the Finally block is executed. Structured Query Language (SQL): It is the standard language used for issuing commands to databases. Transaction: A group of commands (treated as a single unit) that change the data stored in a database. The transaction ensures that the commands are handled in an all-or-nothing fashionif one of the commands fails, all of the commands fail, and any data that was written to the database by the commands is backed out. In this way, transactions maintain the integrity of data in a database. Unicode: The universal character encoding scheme for characters and text. Each character is represented by a unique numeric value. User control: A user-defined control that encapsulates other Windows Forms controls with custom functionality in a common container. XML Schema: A description of the data elements contained in an XML file. The XML Schema provides the names of the elements, their types, whether or not they are key fields, and other information.

Page 227 of 227

Das könnte Ihnen auch gefallen