Courier Management System Courier Management System

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 87

lOMoARcPSD|23903460

Courier Management System

Computer Science - Computer Fundamentals & language theory & practicals (University
of Mumbai)

Studocu is not sponsored or endorsed by any college or university


Downloaded by Vincenzo Max (anandhoni1@gmail.com)
lOMoARcPSD|23903460

cc

UNIVERSITY OF MUMBAI
RAJIV GANDHI COLLEGE
PLOT NO – 16/17,SECTOR – 10/ A VASHI ,

NAVI MUMBAI- 400703

ACADEMIC YEAR

(2015-2016)

PROJECT REPORT ON

“Courier Management System”


DEVELOPED BY
VIKAS GUPTA
SUBMITTED TO UNIVERSITY OF MUMBAI

UNDER THE GUIDENCE OF

MR. KAMAL JAIN

Downloaded by Vincenzo Max (anandhoni1@gmail.com)


lOMoARcPSD|23903460

A PROJECT REPORT SUBMITTED TO

DEPARTMENT OF COMPUTER SCIENCE

Rajiv Gandhi College


Arts, Commerce &Science
Plot No – 16/17,Sec – 10 A Vashi ,Navi Mumbai 400703

“Courier Management System”


IN THE PARTIAL FULFILMENT OF THE REQUREMENT

FOR THE AWARD OF THE DEGREE OF

BACHLEOR OF COMPUTER SCIENCE

SUBMITTED BY
VIKAS GUPTA
Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84
lOMoARcPSD|23903460

DEPARTMENT OF COMPUTER SCIENCE

CERTIFICATE

This is to certify that the project entitled

“Courier Management System”

Is successfully completed by Vikas Gupta, Examination Number Seat no


1026601. under the guidance of Prof. Mr. Kamal Jain, during the academic period
of 26th June, 2015 to 18th January,2016 as per the Syllabus, and the fulfillment for
the completion of the B.Sc. degree in the Computer Science of University of
Mumbai. It is also to certify that this is original work of the candidate done during
academic year 2015-2016

Date:

Internal Examiner Head of Department

External Examiner

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Courier Management System

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

SYNOPSIS

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Introduction:

The Courier Management Systemsoftware package is basically designed to make the


work of CourierManagementdepartmentvery.

Problem Definition:

The Organization was holding the system where the records in the database were not completely secure. In
the current system, where whole records were handled by various employees and the data were stored in
registers and excel sheets. This results in data redundancy .

The general requirements of this project are as follows:

1. Reliable

2. Error free

3. User friendly

4. Secure

5. Low maintenance

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Solution of the problem:

Considering all these aspects we have tried to develop a system that will help the
Courier department a much better way to approach at there work ,save lots of valuable
time and benefit a lot from this system.

The proposed system is so designed that it can be used by multiple users at a time with
different access right granted to them by the administrator. The software completely
eliminates the threat of information leakage, saves a lot of time and also successfully
estimates the working hours of the employees. You don’t have to do different posting for
the same in generating reports. Using this systemyou can provide security to your
database, save your valuable time, and also estimate the hours worked.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Process Involved:

The proposed system as the following modules:-

1. Login

2. Administrator

3. Customer Information

4. Consignment Details

5. Delivery Boy Details

6. Reports

Objective of the Project

1. To provide security to the records in the database

2. To estimate the working hours of the employee

3. To generate the multiple reports form the information provided as per requirement.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Hardware and software used:

Hardware:

Processor : Intel Pentium D

Ram : 1GB

Utility : Printer

Software:

Operating System : Microsoft WindowsXP2

Front end : Microsoft visual studio 2005

Back end : Microsoft sql server 2005

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

INDEX
Sr. No Topic Page No
1 OBJECTIVE AND SCOPE OF THE PROJECT 1-10

2
THEORETICAL BACKGROUND
3 DEFINITION OF PROBLEM

4
SYSTEM ANALYSIS AND DESIGN
5 DETAILED LIFECYCLE OF THE PROJECT

6 i. TREE DIAGRAM, FDD, ERD, CLD, DFD

7 i. EVENT TABLE

8 i. TABLE STRUCTURE

9 i. INPUT AND OUTPUT SCREEN DESIGN

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

OBJECTI
VE
AND
SCOPE
OF
PROJECT

Object and Scope

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

The software aims at making the work of the entire staff of the Courier Department very
easy, to save their time.To maintain their documents, to maintain their tasks performed
in timely manner. The system saves your time and gives out the accurate
documentation. To generate various reports for their documentation.

The proposed system has been designed in such a way that can be operated by various
kinds of users. The working of software is very easy to understand it is very graphical
and it is user friendly.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

THEORI
TICAL
BACKGROUND

THEORITICAL BACKGROUND

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

 The system prevailing in the organization was manually based

 The work was done using Excel Sheets.

 The Excel Sheets was used to maintain customersand Delivery Boys monthlyrecords and different
individuals were working on the same data to produce various.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

DEFI
NITI
ON
OF
PROBLEM

Definition of Problem:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

The organization presently holds a manual system, which is unable to cope with the
monthly and yearly transaction of the organization; hence with the implementation of
this system, the management becomes very efficient.

Time consuming :Since the work was carried and maintained on the excel sheets it was
very time consuming whenever one wanted to retrieve data or wanted to go through the
earlier transactions. This made the process tedious.

Complex Infrastructure: Since the work was carried on excel sheets it was very
difficult to carry the transactions.

Person engaged: - Since the system was manually handled a person is continuously
engaged in entering the data and updating its data.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

SYSTEM
ANALYSI
S
AND
DESI
GN

SYSTEM ANALYSIS:

In system analysis we have found number of fact finding techniques about the system,
which is under study.

These facts helped us to understand what the existing system is, the flow of the existing
system and what the problems are in the existing system.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

I. Fact finding by observation


By observing the activities of the Courier Department. The system flow of the
departments is examined. All the details of the department process are given to
the administrator. This report has to be maintained properly.

II. Fact finding by document analysis.


This method involves the collecting of desired documents. These documents were
analyzed. This method was use to calculate the actual data element required in
the system.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

DETAI
LED
LI
FECYCLE
OF
PROJECT

Funct
ionalDecomposi
tionDi
agr
am:

Courier
Management

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Login Customer Consignment Reports

Add User Regular Consignment General Customers


Consignment
Delete Consignment
Information Regular Customers
Information Consignment
Change
` Password View Regular Regular Customers
Customer
General Undeliverd
General consignment
Customer
Regular
Customer

General
Customer

Cont
extLevelDi
agr
am:

Courier
Regular Customers Info
Customer ManagementConsignment Details Consignment
General Customer System
Info

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Regular Customers View Regular Customers Info

General Customer View General Customer Info

Delivery Boy Details Delivery Boy Report

Delivery Boy

Dat
aFl
ow Di
agr
am:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Add User

Admin Login Delete User

Change

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Admin Admin Login

Add User
Admin DownloadedDelete UserMax (anandhoni1@gmail.com)
by Vincenzo 84
lOMoARcPSD|23903460

Admin

Change Password

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Regular Customers
Info
Admin rcustomer
Regular Customers
View

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

General Customers
Info
Admin
gcustomer
General Customers
View

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Consignment

Consignment
Consignment
Admin
General Customers View

Consignment

Regular Customers View

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Admin Delivery Doy dbdetails

Ent
ityRel
ati
onshi
pDi
agr
am

Manages

Admin

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Manages
Manages Consignment Customers
Details Information

Manages
Delivery Boy Details

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Table structure:

Table name: Admin

Table name Fields Name Type Description

admin Username varchar(30) Describes Admin


name

Password varchar(8) Gives password

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Table name: dbdetails

Table Fields Name Type Description

dbdetails Delid varchar(40) Delivery Boys ID

Delname varchar(20) Delivery Boys


name

City varchar(20) City

Address varchar(30) Address

Mobileno varchar(50) Mobile Number

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Table name: enquiry

Table name Field name Type Description

enquiry Cityname nvarchar(50) City Name

approximatecharges nvarchar(50) Approximate


charges

branches nvarchar(50) Branch Name.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Table name: gcustomer

Table name Field name Type Description

gcustomer Id varchar(50) Customer ID

Name Varchar(50) Customer Name

Address Varchar(50) Customer Address

Tel Varchar(50) Telephome Number

mob Varchar(50) Mobile Number

date smalldatetime Date

month Varchar(50) Month

consignment Varchar(50) Consignment

weight Varchar(50) Weight

destination Varchar(50) Destination

city Varchar(50) City

amount Varchar(50) Amount

status Varchar(255) Status

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Table name: rconsignment

Table name Field name Type Description

rconsignment Custid Varchar(300) Customer ID

accno nvarchar(50) Account Number

cname nvarchar(50) Customer Name

destination nvarchar(50) Destination

city nvarchar(50) City

date Datetime Daet

month nvarchar(50) Month

consignment nvarchar(50) Consignment

weight nvarchar(50) Weight

amount nvarchar(50) Amount

status nvarchar(50) Styatus

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Tablename:rcustomer

Table name Field name Type Description

rcustomer accno nvarchar(50) Accoumt Number

name nvarchar(50) Name

address nvarchar(50) Address

tel nvarchar(50) Telephone

mob nvarchar(50) Mobile Number

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

CODE

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Feasibi
li
ty
Study

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Feasibility Study For System Implementation

Before the system was designed the feasibility study is carried out.

1. Operational Feasibility:

The Admin was finding it difficult to keep track of the performance of the HR department with
the manual system, and insurance department were not comfortable with their manual system
and data redundancy .As the new system will decrease workload, strain, work time, redundancy
of data, and proper view of each user efficiency by each process. The user of two departments
has welcomed new system and is ready to switch over with new implementation.

The management is willing to switch over because of individual. Moreover, the will receive
timely and accurate reports which indeed helpful for the company.

So the system is operational feasible.

2. Technical Feasibility:

Technical feasibility center around the existing computer system and what extent it can support the
proposed additions. This involves no financial considerations to accommodate enhancement.

Since, the entire required technical platform available, organization were technical sound to execute the
project.

3. Economically feasibility:

The system is economically feasible due to the following reasons. The user is already having the required
hardware and software, so major cost will be in terms of development of the new system.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Syst
em
I
mplementat
ion
Har
dwareAnd
Softwar
eUsed

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Fourth Generation Techniques

Fourth Generation Technique means the use of software tool to define or specify among some of the
characteristics of the software of the higher level. The tool to define or generates source code as to the
developer specifications. Software development environment that supports 4GT includes the following tool:-

 Procedural language for database query.

 Report Generation.

 Data manipulation.

 Code Generation.

 High-level graphic ability.

 Spread sheet capability.

These tools are used for specific application domain and it cannot be applied to all types of software.

4GT passes through following phases:-


 Requirement Gathering.

 Design strategy

 Implementation

 Testing

Advantages:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

 Dramatic reduction in software development time.

 Improves productivity of software developers.

 Coding is reduced or eliminated.

 More satisfied users.

 Higher quality software with less error.

 Improves communication between different users.

 4GT can be used for small and medium sized projects.

 Reduced Testing time.

 Improved organizational effectiveness.

Fourth Generation Techniques

Requirement
Gathering
Testing
System Downloaded by Vincenzo Max (anandhoni1@gmail.com) Final Product 84
lOMoARcPSD|23903460

Implementation
Using 4Gt

 Requirement Gathering:
At this stage, the documents involved for the system development were collected.

Requirement gathering includes detail study of inadequacies in the legacy systems and it involves the
determination of things that are required to overcome the adequacies.

 System Design:
During the phase, we identify data dictionaries to visualize database structure or database design.
Process involved in the legacy system or the current systems are identified. These are the process,
which manipulates the data, and the F.D.D. (Functional Decomposition Diagram) is drawn. And after
determining the process involved, the D.F.D. (Data Flow Diagram) is prepared. By considering data

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

dictionary list of processes and data flow entities involved, of the process and flow entities involved are
short-listed and E.R.D. (Entity Relationship Diagram) is prepared.

 Implement Using 4GT:


Implement stage involves preparing the source code to carry out processes that manipulates the data.

The source code is prepared by keeping in mind the list of possible errors. Source code deploys the
mechanism to avoid these types of errors.

 Testing:
For testing purpose we have used Whit-box method-a widely used technique in which paths of the
logic are tested to determine how well they produce predictable results. With this commonly used
testing technique, we have examined the internal structure of the object.

 Final Product:
After applying 4GT techniques successfully and effectively, we get robust application software, which
satisfies the objectives, which are determined at designing phase i.e. it takes proper input &produce
desired output.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Har
dwar
eandsof
twar
eused:

Hardware:

Processor : Intel Pentium D

Ram : 1GB

Utility : Printer

Software:

Operating System : Windows Vista Home Premium

Front end : Microsoft visual studio 2008

Back end : Microsoft sql server 2005

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Syst
em
Mai
ntenance&
Evaluat
ion

Syst
em Mai
ntenance& Eval
uat
ion

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Authentication:

 User Management:

In this mode user add user profile i.e. Username &Password as well as User mode
(Administrator \ Normal). Administrator user has only access to master database. Normal
User can do other transaction except master maintenance. User can change password
also so as to secure its profile.

 Log off:

By using this user can logoff from the application and can log on as a different user.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

TESTI
NG
METHODOLOGY

Testing Methodology

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

For testing purpose we have used White – box method – a widely used technique in
which path of logic are tested to determine how well they produce predictable results.
With this commonly used tested technique, we have examined the internal structure of
the object.

With the help of White – box testing we have tested the source code without taking into
account the external description for that source code. Because of the use of this testing
method we came to know about the unintentional items such as infinite loops, paths
through the code which should be allowed but which cannot be executed and
dead(unreachable) code.

The key points that we have considered in White – box technique


are as follows

 Path Testing:
In this we have tested every possible path in the code i.e. all conditions to assure that
every line of code is working properly.

 Condition Testing:
In this we have tested for errors in condition (Boolean, Arithmetic / Relational errors).

 Data Flow Testing:


In this we have tested paths according to location of definitions and their users.

 Loop Testing:
In this we have checked the validity of the loop constructs.

 Data validationTesting:
Here we have implemented the code that validates the input data before storing it in
that database. This prevents duplication of data.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

SCREENSHOTS

MDICourier:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmLogin:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmRegCustIno:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmRegCustView:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Frmgencustview:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmGencustinfo:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmConsignment:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

frmDelboy:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Frmgencustconsignrpt:

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Repor
ts

imports System
Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84
lOMoARcPSD|23903460

Imports System.IO
Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class frmLogin
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim dr As SqlDataReader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
connection()
con = New SqlConnection(constr)
If con.State = ConnectionState.Open Then con.Close()
con.Open()
End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnSubmit.Click
If txtUserName.Text = "" Then
MsgBox("Please Enter username")
txtUserName.Focus()

ElseIf txtpass.Text = "" Then


MsgBox("Please enter password")
txtpass.Focus()
End If
cmd = New SqlCommand
connection()
con = New SqlConnection(constr)
cmd.Connection = con
cmd.CommandText = "select * from admin where username='" & txtUserName.Text & "'
and password='" & txtpass.Text & "'"
con.Open()
dr = cmd.ExecuteReader()
If (dr.Read()) Then
MessageBox.Show("Login Successful")

MDIParent1.Show()
Me.Hide()
txtUserName.Text = ""
txtUserName.Focus()
txtpass.Text = ""
MDIParent1.CustomerToolStripMenuItem.Visible = True
MDIParent1.ConsignmentToolStripMenuItem.Visible = True
MDIParent1.DeliveryBoyToolStripMenuItem.Visible = True
MDIParent1.ReportsToolStripMenuItem.Visible = True
MDIParent1.AddUserToolStripMenuItem.Visible = True
MDIParent1.DeleteUserToolStripMenuItem.Visible = True
MDIParent1.ChangePasswordToolStripMenuItem.Visible = True
Else
MessageBox.Show("Login Failed")
txtUserName.Text = ""
txtUserName.Focus()
txtpass.Text = ""
End If

dr.Close()
con.Close()
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnExit.Click

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Dim res As String


res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub
End Class
Imports System.Windows.Forms

Public Class MDIParent1

Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)


' Create a new instance of the child form.
Dim ChildForm As New System.Windows.Forms.Form
' Make it a child of this MDI form before showing it.
ChildForm.MdiParent = Me

m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber

ChildForm.Show()
End Sub

Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)


Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = OpenFileDialog.FileName
' TODO: Add code here to open the file.
End If
End Sub

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
SaveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"

If (SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then


Dim FileName As String = SaveFileDialog.FileName
' TODO: Add code here to save the current contents of the form to a file.
End If
End Sub

Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Global.System.Windows.Forms.Application.Exit()
End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


' Use My.Computer.Clipboard to insert the selected text or images into the
clipboard
End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


' Use My.Computer.Clipboard to insert the selected text or images into the
clipboard
Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84
lOMoARcPSD|23903460

End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
'Use My.Computer.Clipboard.GetText() or My.Computer.Clipboard.GetData to retrieve
information from the clipboard.
End Sub

Private Sub ToolBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
'Me.ToolStrip.Visible = Me.ToolBarToolStripMenuItem.Checked
End Sub

Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
'Me.StatusStrip.Visible = Me.StatusBarToolStripMenuItem.Checked
End Sub

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.Cascade)
End Sub

Private Sub TileVerticleToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub

Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
' Close all child forms of the parent.
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub

Private m_ChildFormNumber As Integer = 0

Private Sub CustomerToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CustomerToolStripMenuItem.Click

End Sub

Private Sub CustomerViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CustomerViewToolStripMenuItem.Click
frmRegcustview.MdiParent = Me
frmRegcustview.Show()
End Sub

Private Sub ChangePasswordToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles ChangePasswordToolStripMenuItem.Click

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

ChangePassword.MdiParent = Me
ChangePassword.Show()
End Sub

Private Sub CustomerInfoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CustomerInfoToolStripMenuItem.Click
frmRegularCustInfo.MdiParent = Me
frmRegularCustInfo.Show()
End Sub

Private Sub CustomerInfoToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CustomerInfoToolStripMenuItem1.Click
frmGeneralCustInfo.MdiParent = Me
frmGeneralCustInfo.Show()
End Sub

Private Sub CustomerViewToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles CustomerViewToolStripMenuItem1.Click
frmGencustview.MdiParent = Me
frmGencustview.Show()
End Sub

Private Sub ConsignmentToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs)
frmConsignment.MdiParent = Me
frmConsignment.Show()
End Sub

Private Sub RegularCustomerToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RegularCustomerToolStripMenuItem.Click
frmcdinfoR.MdiParent = Me
frmcdinfoR.Show()
End Sub

Private Sub GeneralCustomerToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles GeneralCustomerToolStripMenuItem.Click
frmcdinfoG.MdiParent = Me
frmcdinfoG.Show()
End Sub

Private Sub AddNewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles AddNewToolStripMenuItem.Click
frmdelboy.MdiParent = Me
frmdelboy.Show()
End Sub

Private Sub ViewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles ViewToolStripMenuItem.Click
frmDeliveryBoyView.MdiParent = Me
frmDeliveryBoyView.Show()
End Sub

Private Sub GeneralCustomersConsignmentToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
GeneralCustomersConsignmentToolStripMenuItem.Click
frmGCustConsigReport.MdiParent = Me
frmGCustConsigReport.Show()
End Sub

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Private Sub RegularCustomersConsignmentToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
RegularCustomersConsignmentToolStripMenuItem.Click
frmRegCusConsig.MdiParent = Me
frmRegCusConsig.Show()
End Sub

Private Sub RegularCustomersToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs)
frmRegCust.MdiParent = Me
frmRegCust.Show()
End Sub

Private Sub RegularCustomerToolStripMenuItem1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RegularCustomerToolStripMenuItem1.Click
frmRegCustUndelCons.MdiParent = Me
frmRegCustUndelCons.Show()
End Sub

Private Sub GeneralCustomerToolStripMenuItem1_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles GeneralCustomerToolStripMenuItem1.Click
frmGenCustUndelCons.MdiParent = Me
frmGenCustUndelCons.Show()
End Sub

Private Sub LoginToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles LoginToolStripMenuItem1.Click
frmLogin.MdiParent = Me
frmLogin.Show()
End Sub

Private Sub AddUserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles AddUserToolStripMenuItem.Click
frmAddUser.MdiParent = Me
frmAddUser.Show()
End Sub

Private Sub DeleteUserToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles DeleteUserToolStripMenuItem.Click
frmDelUser.MdiParent = Me
frmDelUser.Show()
End Sub

Private Sub MDIParent1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
CustomerToolStripMenuItem.Visible = False
ConsignmentToolStripMenuItem.Visible = False
DeliveryBoyToolStripMenuItem.Visible = False
ReportsToolStripMenuItem.Visible = False
AddUserToolStripMenuItem.Visible = False
DeleteUserToolStripMenuItem.Visible = False
ChangePasswordToolStripMenuItem.Visible = False
End Sub

Private Sub LogOutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles LogOutToolStripMenuItem.Click
Dim res As String
res = MessageBox.Show("Do You Want To LogOut?", "Log Out",
MessageBoxButtons.YesNo)
If res = vbYes Then
CustomerToolStripMenuItem.Visible = False

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

ConsignmentToolStripMenuItem.Visible = False
DeliveryBoyToolStripMenuItem.Visible = False
ReportsToolStripMenuItem.Visible = False
AddUserToolStripMenuItem.Visible = False
DeleteUserToolStripMenuItem.Visible = False
ChangePasswordToolStripMenuItem.Visible = False
Application.Restart()
End If
End Sub

Private Sub AboutUsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles AboutUsToolStripMenuItem.Click

End Sub

Private Sub UndeliverdConsignmentToolStripMenuItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
UndeliverdConsignmentToolStripMenuItem.Click

End Sub
End Class

mports System.IO
Imports System.Data
'Imports System.Data.OleDb
Imports System.Data.SqlClient
Public Class frmAddUser
Dim con As New SqlConnection
Dim cmd As New SqlCommand
Dim rd As SqlDataReader
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles btnOK.Click

If txtUserName.Text = "" Or txtPassword.Text = "" Or txtRePassword.Text = "" Then


MessageBox.Show("Please Fill Complete Information")
Exit Sub
End If

If txtPassword.Text = txtRePassword.Text Then


Dim cmd = New SqlCommand
cmd.Connection = con
cmd.CommandText = "insert into admin values('" & txtUserName.Text & "','" &
txtPassword.Text & "')"
cmd.ExecuteNonQuery()
MessageBox.Show("User Added Successfully")
txtPassword.Text = ""
txtRePassword.Text = ""
txtUserName.Text = ""
txtUserName.Focus()
Else
MessageBox.Show("Incorrect Password")
txtPassword.Text = ""
txtRePassword.Text = ""
txtPassword.Focus()
Exit Sub
End If
End Sub

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnExit.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub

Private Sub txtUserName_LostFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles txtUserName.LostFocus
cmd = New SqlCommand
cmd.Connection = con
cmd.CommandText = "select * from admin where username='" & txtUserName.Text & "'"
'con.Open()
rd = cmd.ExecuteReader()
While rd.Read
MessageBox.Show("User already Exist! Please enter a different user name")
txtUserName.Focus()
End While
rd.Close()
End Sub

Private Sub txtUserName_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtUserName.TextChanged

End Sub

Private Sub frmAddUser_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
connection()
con = New SqlConnection(constr)
If con.State = ConnectionState.Open Then con.Close()
con.Open()
End Sub
End Class

Public Class FrmAvailability

Private Sub FrmAvailability_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'RcustomerDataSet.enquiry' table.
You can move, or remove it, as needed.
'Me.EnquiryTableAdapter.Fill(Me.RcustomerDataSet.enquiry)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub
Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84
lOMoARcPSD|23903460

End Class

Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class frmcdinfoG
Dim con As SqlConnection
Dim strComputerName As String
Dim s As Date
Dim ds As DataSet
Dim ad As SqlDataAdapter
Dim cmd As SqlCommand
Dim dv As DataView
Dim reader As SqlDataReader
Dim cmd2 As SqlCommand
Private Sub frmcdinfoG_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
cmd2 = New SqlCommand
connection()
con = New SqlConnection(constr)
cmd2.Connection = con
cmd2.CommandText = "select * from gcustomer"
con.Open()
reader = cmd2.ExecuteReader()

While (reader.Read)
cbocustid.Items.Add(reader("id"))

End While
reader.Close()

End Sub

Private Sub cbocustid_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles cbocustid.SelectedIndexChanged
Dim DT As New DataTable
Dim DR As DataRow
Dim DC As New DataColumn

DT.Columns.Add("Customer ID")
DT.Columns.Add("Name")
DT.Columns.Add("Address")
DT.Columns.Add("Date")
DT.Columns.Add("Consigmnment")
DT.Columns.Add("Destination Address")
DT.Columns.Add("Consigmnment status")
DT.Columns.Add("Delivery Boy Id")
DT.Columns.Add("DName")
'DT.Columns.Add("Consigmnment1")

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

If con.State = ConnectionState.Open Then con.Close()


con.Open()

cmd = New SqlCommand("select


gcustomer.id,gcustomer.name,gcustomer.address,gcustomer.date,gcustomer.consignment,gcusto
mer.destination,gcustomer.status,dbdetails.delid,dbdetails.delname from
gcustomer,dbdetails where gcustomer.id='" & Trim(cbocustid.Text) & "'and
gcustomer.city=dbdetails.city", con)

If (Trim(cbocustid.Text) = "") Then


Dim DV As New DataSet
DataGridView1.DataSource = DV
con.Close()
Exit Sub
End If
reader = cmd.ExecuteReader
Try

While (reader.Read())

DR = DT.NewRow
DR(0) = reader(0)
DR(1) = reader(1)
DR(2) = reader(2)
DR(3) = reader(3)
DR(4) = reader(4)
DR(5) = reader(5)
DR(6) = reader(6)
DR(7) = reader(7)
DR(8) = reader(8)
DT.Rows.Add(DR)
End While

Catch ex As Exception
MsgBox(ex)
End Try

DataGridView1.DataSource = DT
con.Close()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub
End Class

Dim strComputerName As String


Dim s As Date
Dim ds As DataSet
Dim ad As SqlDataAdapter
Dim cmd As SqlCommand
Dim dv As DataView

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Dim reader As SqlDataReader


Dim cmd2 As SqlCommand
Private Sub frmcdinfoR_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
cmd2 = New SqlCommand
connection()
con = New SqlConnection(constr)
cmd2.Connection = con
cmd2.CommandText = "select * from rcustomer"
con.Open()
reader = cmd2.ExecuteReader()

While (reader.Read)
cboCustId.Items.Add(reader("id"))

End While
reader.Close()
End Sub

Private Sub cboCustId_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles cboCustId.SelectedIndexChanged
Dim DT As New DataTable
Dim DR As DataRow
Dim DC As New DataColumn

DT.Columns.Add("Consigmnment ID")
'DT.Columns.Add("Account Number")
DT.Columns.Add("Destination Address")
DT.Columns.Add("Date")
DT.Columns.Add("Consigmnment Type")
DT.Columns.Add("Weight")
DT.Columns.Add("Amount")
DT.Columns.Add("Delivery Boy Id")
DT.Columns.Add("Name")

If con.State = ConnectionState.Open Then con.Close()


con.Open()

cmd = New SqlCommand("select


rcustomer.id,rcustomer.destination,rcustomer.date,rcustomer.consignment,rcustomer.weight,
rcustomer.amount,rcustomer.status,dbdetails.delid,dbdetails.delname from
rcustomer,dbdetails where rcustomer.id='" & Trim(cboCustId.Text) & "'and
rcustomer.city=dbdetails.city", con)

If (Trim(cboCustId.Text) = "") Then


Dim DV As New DataSet
DataGridView1.DataSource = DV
con.Close()
Exit Sub
End If
reader = cmd.ExecuteReader
'Try

While (reader.Read())

DR = DT.NewRow
DR(0) = reader(0)

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

DR(1) = reader(1)
DR(2) = reader(2)
DR(3) = reader(3)
DR(4) = reader(4)
DR(5) = reader(5)
DR(6) = reader(6)
DR(7) = reader(7)
'DR(8) = reader(9)
DT.Rows.Add(DR)
End While

'Catch ex As Exception
'MsgBox(ex)
'End Try

DataGridView1.DataSource = DT
con.Close()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub
End Class

Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class frmdelboy
Dim rd As SqlDataReader
Dim cmd As New SqlCommand

Private Sub frmdelboy_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
connection()
con = New SqlConnection(constr)
con.Open()
'Call MFGVALUES()
cmd.Connection = con
cmd.CommandText = "Select * from dbdetails"
Dim id As Integer
id = 0
rd = cmd.ExecuteReader
While (rd.Read)
id = rd("delid")
End While
rd.Close()
txtId.Text = id + 1

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnExit.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnSave.Click
If (txtName.Text = "") Or (txtAddress.Text = "") Or (txtMobileNo.Text = "") Or
(cbocity.Text = "") Then
MsgBox("Please Enter All The Required Data")
Else
cmd.Connection = con
cmd.CommandText = "Insert into dbdetails values('" & Trim(txtId.Text) & "','"
& Trim(txtName.Text) & "','" & Trim(cbocity.Text) & "','" & Trim(txtAddress.Text) & "','"
& Trim(txtMobileNo.Text) & "')"
cmd.ExecuteNonQuery()
MsgBox("Record Saved")
txtId.Text = txtId.Text + 1
txtName.Text = ""
txtAddress.Text = ""
txtMobileNo.Text = ""
cbocity.Text = ""
'txtId.Focus()
txtName.Focus()
End If
End Sub

Private Sub txtId_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtId.TextChanged

End Sub

Private Sub txtMobileNo_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtMobileNo.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
e.Handled = True
End If
If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub

Private Sub txtMobileNo_LostFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles txtMobileNo.LostFocus
'If txtMobileNo.Text <> "" Then
' If Not IsNumeric(txtMobileNo.Text) Then
' MessageBox.Show("Please enter a numeric value for mobile no.")
' txtMobileNo.Focus()
' End If
'End If
'If Len(txtMobileNo.Text) < 10 Then
' MessageBox.Show("Mobile no Not Valid")
'End If
End Sub

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Private Sub txtMobileNo_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtMobileNo.TextChanged

End Sub
End Class

Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class frmdelboy
Dim rd As SqlDataReader
Dim cmd As New SqlCommand

Private Sub frmdelboy_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
connection()
con = New SqlConnection(constr)
con.Open()
'Call MFGVALUES()
cmd.Connection = con
cmd.CommandText = "Select * from dbdetails"
Dim id As Integer
id = 0
rd = cmd.ExecuteReader
While (rd.Read)
id = rd("delid")
End While
rd.Close()
txtId.Text = id + 1
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnExit.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnSave.Click
If (txtName.Text = "") Or (txtAddress.Text = "") Or (txtMobileNo.Text = "") Or
(cbocity.Text = "") Then
MsgBox("Please Enter All The Required Data")
Else
cmd.Connection = con
cmd.CommandText = "Insert into dbdetails values('" & Trim(txtId.Text) & "','"
& Trim(txtName.Text) & "','" & Trim(cbocity.Text) & "','" & Trim(txtAddress.Text) & "','"
& Trim(txtMobileNo.Text) & "')"
cmd.ExecuteNonQuery()
MsgBox("Record Saved")
txtId.Text = txtId.Text + 1

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

txtName.Text = ""
txtAddress.Text = ""
txtMobileNo.Text = ""
cbocity.Text = ""
'txtId.Focus()
txtName.Focus()
End If
End Sub

Private Sub txtId_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtId.TextChanged

End Sub

Private Sub txtMobileNo_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtMobileNo.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
e.Handled = True
End If
If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub

Private Sub txtMobileNo_LostFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles txtMobileNo.LostFocus
'If txtMobileNo.Text <> "" Then
' If Not IsNumeric(txtMobileNo.Text) Then
' MessageBox.Show("Please enter a numeric value for mobile no.")
' txtMobileNo.Focus()
' End If
'End If
'If Len(txtMobileNo.Text) < 10 Then
' MessageBox.Show("Mobile no Not Valid")
'End If
End Sub

Private Sub txtMobileNo_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtMobileNo.TextChanged

End Sub

Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles PictureBox1.Click

End Sub
End Class

Dim crtableLogoninfo As New TableLogOnInfo()


Dim crConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
Dim CrTables As Tables
Dim CrTable As Table
Dim reppath As String
Dim path As String
Dim substring As String

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CrystalReportViewer1.Load
'connection()
'con = New SqlConnection(constr)
'con.Open()
'Dim rpt As New GenCustConsRpt
'ad = New SqlDataAdapter("select * from gcustomer", con)
'ds = New DataSet
'ad.Fill(ds, "gcustomer")
'rpt.SetDataSource(ds)
'CrystalReportViewer1.ReportSource = rpt

Dim rpt As New GenCustConsRpt


'Dim myFile As New System.IO.StreamReader("c:\\cont")
'Dim str1 As String = myFile.ReadToEnd()
'Dim str As String() = str1.Split(New Char() {";"})
'myFile.Close()
connection()
con = New SqlConnection(constr)
con.Open()
cmd = New SqlCommand("select * from gcustomer", con)
dr = cmd.ExecuteReader()
dt = New DataTable()
dt.Load(dr)
dr.Close()
rd = New CrystalDecisions.CrystalReports.Engine.ReportDocument()
path = Application.StartupPath.ToString()
substring = path.Substring(path.IndexOf("\") - 2, path.IndexOf("bin") - 1)
reppath = substring & "\" & "GenCustConsRpt.rpt"
rd.Load(reppath)
With crConnectionInfo
.ServerName = ".\SQLExpress"
.DatabaseName = "db_Courier"
.IntegratedSecurity = True
End With

rd.SetDataSource(dt)
CrTables = rd.Database.Tables

'Loop through each table in the report and apply the LogonInfo information
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)

Next

CrystalReportViewer1.Refresh()
CrystalReportViewer1.ReportSource = rd

End Sub

Private Sub frmGCustConsigReport_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

End Sub
End Class

Dim crtableLogoninfo As New TableLogOnInfo()


Dim crConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
Dim CrTables As Tables
Dim CrTable As Table
Dim reppath As String
Dim path As String
Dim substring As String

Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles CrystalReportViewer1.Load
'connection()
'con = New SqlConnection(constr)
'con.Open()
'Dim rpt As New rptGenCustUndelCons
'ad = New SqlDataAdapter("select * from gcustomer where status='No'", con)
'ds = New DataSet
'ad.Fill(ds, "gcustomer")
'rpt.SetDataSource(ds)
'CrystalReportViewer1.ReportSource = rpt

'Dim rpt As New rptGenCustUndelCons


'Dim myFile As New System.IO.StreamReader("c:\\cont")
'Dim str1 As String = myFile.ReadToEnd()
'Dim str As String() = str1.Split(New Char() {";"})
'myFile.Close()
connection()
con = New SqlConnection(constr)
con.Open()
cmd = New SqlCommand("select * from gcustomer where status='No'", con)
dr = cmd.ExecuteReader()
dt = New DataTable()
dt.Load(dr)
dr.Close()
rd = New CrystalDecisions.CrystalReports.Engine.ReportDocument()
path = Application.StartupPath.ToString()
substring = path.Substring(path.IndexOf("\") - 2, path.IndexOf("bin") - 1)
reppath = substring & "\" & "rptGenCustUndelCons.rpt"
rd.Load(reppath)
With crConnectionInfo
.ServerName = str(0)
.DatabaseName = "Courier"
.UserID = str(1)
.Password = str(2)
End With

rd.SetDataSource(dt)
CrTables = rd.Database.Tables

'Loop through each table in the report and apply the LogonInfo information
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Next

CrystalReportViewer1.Refresh()
CrystalReportViewer1.ReportSource = rd

End Sub

Private Sub frmGenCustUndelCons_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub
End Class

Imports System
Imports System.Data
Imports System.Data.SqlClient
Public Class frmGeneralCustInfo
Dim rd As SqlDataReader
Dim ad As SqlDataAdapter
Dim cmd As New SqlCommand
Dim month As String
Private Sub txtWeight_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)
Handles txtWeight.LostFocus
If txtWeight.Text <> "" Then
If Not IsNumeric(txtWeight.Text) Then
MessageBox.Show("Please enter a numeric value for Weight")
txtWeight.Focus()
Exit Sub
End If
End If
txtAmount.Text = Val(txtWeight.Text) * 20
End Sub

Private Sub dtpDate_ValueChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles dtpDate.ValueChanged
txtMonth.Text = dtpDate.Value.Month
Call months()
txtMonth.Text = month
End Sub
Public Sub months()
If txtMonth.Text = 1 Then
month = "January"
ElseIf txtMonth.Text = 2 Then

month = "February"
ElseIf txtMonth.Text = 3 Then

month = "March"
ElseIf txtMonth.Text = 4 Then

month = "April"

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

ElseIf txtMonth.Text = 5 Then

month = "May"
ElseIf txtMonth.Text = 6 Then

month = "June"
ElseIf txtMonth.Text = 7 Then

month = "July"
ElseIf txtMonth.Text = 8 Then

month = "August"
ElseIf txtMonth.Text = 9 Then

month = "September"
ElseIf txtMonth.Text = 10 Then

month = "October"
ElseIf txtMonth.Text = 11 Then

month = "November"
ElseIf txtMonth.Text = 12 Then

month = "December"
End If

End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnSave.Click

btnEdit.Text = "&Edit"
Dim Stat As String
If btnSave.Text = "&Add New" Then
enableds()
clears()
btnSave.Text = "&Save"
txtId.Items.Clear()
cmd.Connection = con
'cmd.CommandText = "Select * from gcustomer"
'rd = cmd.ExecuteReader
'Dim id As Integer
'id = 0
'While rd.Read
' id = rd("id")
'End While
'txtId.Text = id + 1
'txtId.Enabled = False

txtId.Enabled = False
clears()
ElseIf btnSave.Text = "&Save" Then
If rdbYes.Checked = True Then
Stat = "Yes"
ElseIf rdbNo.Checked = True Then
Stat = "No"
Else
MsgBox("Please Select a value for delivery status")
Exit Sub
End If

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

connection()
con = New SqlConnection(constr)
cmd.Connection = con
con.Open()
cmd.CommandText = "insert into gcustomer values('" & Trim(txtcust_id.Text) &
"','" & Trim(txtName.Text) & "','" & Trim(txtAddress.Text) & "','" & Trim(txtResi.Text) &
"','" & Trim(txtMob.Text) & "','" & Trim(dtpDate.Value) & "','" & Trim(txtMonth.Text) &
"','" & Trim(cboConsinment.Text) & " ','" & Trim(txtWeight.Text) & "','" &
Trim(txtDest.Text) & "','" & Trim(cboCity.Text) & "','" & Trim(txtAmount.Text) & "','" &
Trim(Stat) & "')"
cmd.ExecuteNonQuery()
MsgBox("Record Saved")
clears()
disableds()
'custid()

txtId.Enabled = True
txtcust_id.Text = Val(txtcust_id.Text) + 1
End If
End Sub

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnDelete.Click

btnSave.Text = "&Add New"


btnEdit.Text = "&Edit"

If txtId.Text = "" Then


MsgBox("Please select a Id to delete")
Exit Sub
Else
connection()
con = New SqlConnection(constr)
cmd.Connection = con
con.Open()
cmd.CommandText = "delete from gcustomer where id='" & Trim(txtId.Text) & "'"
cmd.ExecuteNonQuery()
MsgBox("Record Deleted")
txtId.Text = ""
txtName.Text = ""
txtAddress.Text = ""
txtResi.Text = ""
txtMob.Text = ""
dtpDate.Value = Today
cboConsinment.Text = ""
txtDest.Text = ""
txtWeight.Text = ""
cboCity.Text = ""
txtAmount.Text = ""
custid()
End If
End Sub

Private Sub frmGeneralCustInfo_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
connection()
con = New SqlConnection(constr)
con.Open()
custid()
cmd.Connection = con

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Dim x As Integer
cmd.CommandText = "Select * from gcustomer"
rd = cmd.ExecuteReader
If Not (rd.HasRows) Then
x = 1
Else
While (rd.Read())

x = rd("id")
x = x + 1
End While
rd.Close()

End If

'cmd.CommandText = "Select * from gcustomer"


'rd = cmd.ExecuteReader
'Dim i As Integer
'i = 0
'While rd.Read
' i = i + 1
'End While
'rd.Close()
'If i = 0 Then
' MessageBox.Show("There is no record to display in general cusotmers ")
'End If
disableds()
txtcust_id.Text = x.ToString()
End Sub
Private Sub custid()
cmd.Connection = con
cmd.CommandText = "Select distinct id from gcustomer"
rd = cmd.ExecuteReader
txtId.Items.Clear()
While (rd.Read)
txtId.Items.Add(rd("id"))
End While
rd.Close()
End Sub

Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnEdit.Click

btnSave.Text = "&Add New"


txtcust_id.Visible = False
txtId.Visible = True
If btnEdit.Text = "&Edit" Then
'btnEdit.Visible = False
enableds()
btnEdit.Text = "&Update"
txtId.Enabled = False
ElseIf btnEdit.Text = "&Update" Then
Dim Stat As String
If rdbYes.Checked = True Then
Stat = "Yes"
ElseIf rdbNo.Checked = True Then
Stat = "No"
Else
MsgBox("Please Select a value for delivery status")
End If
cmd.Connection = con

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

cmd.CommandText = "Update gcustomer set name='" & Trim(txtName.Text) &


"',address='" & Trim(txtAddress.Text) & "',tel='" & Trim(txtResi.Text) & "',mob='" &
Trim(txtMob.Text) & "',consignment='" & Trim(cboConsinment.Text) & "',weight='" &
Trim(txtWeight.Text) & "',destination='" & Trim(txtDest.Text) & "',city='" &
Trim(cboCity.Text) & "',amount='" & Trim(txtAmount.Text) & "',status='" & Trim(Stat) &
"'where id='" & Trim(txtId.Text) & "'"
cmd.ExecuteNonQuery()
MsgBox("Updated")
txtId.Text = ""
txtName.Text = ""
txtAddress.Text = ""
txtResi.Text = ""
txtMob.Text = ""
dtpDate.Value = Today
cboConsinment.Text = ""
txtDest.Text = ""
txtWeight.Text = ""
cboCity.Text = ""
txtAmount.Text = ""
disableds()
txtId.Focus()
btnEdit.Text = "&Edit"
txtId.Enabled = True

End If
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles btnExit.Click
Dim res As String
res = MsgBox("Do You Want To Exit", vbQuestion + vbYesNo, "Confirmation")
If res = vbYes Then
Me.Close()
End If
End Sub
Private Sub enableds()
'txtId.Enabled = True
txtName.Enabled = True
txtAddress.Enabled = True
txtResi.Enabled = True
txtMob.Enabled = True
cboConsinment.Enabled = True
txtDest.Enabled = True
txtWeight.Enabled = True
cboCity.Enabled = True
txtAmount.Enabled = True

End Sub

Private Sub disableds()


'txtId.Enabled = False
txtName.Enabled = False
txtAddress.Enabled = False
txtResi.Enabled = False
txtMob.Enabled = False
cboConsinment.Enabled = False
txtDest.Enabled = False
txtWeight.Enabled = False

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

cboCity.Enabled = False
txtAmount.Enabled = False
txtMonth.Enabled = False
End Sub
Private Sub clears()
'txtId.Text = ""
txtName.Text = ""
txtAddress.Text = ""
txtResi.Text = ""
txtMob.Text = ""
cboConsinment.Text = ""
txtDest.Text = ""
txtWeight.Text = ""
cboCity.Text = ""
txtAmount.Text = ""
'txtMonth.Text = ""
End Sub

Private Sub txtResi_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtResi.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
e.Handled = True
End If
If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub

Private Sub txtResi_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtResi.TextChanged
'If txtResi.Text <> "" Then
' If Not IsNumeric(txtResi.Text) Then
' MessageBox.Show("Please enter a numeric value for residence")
' txtResi.Focus()
' End If
'End If
End Sub

Private Sub txtMob_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtMob.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _
Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then
e.Handled = True
End If
If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then
e.Handled = False
End If
End Sub

Private Sub txtMob_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)


Handles txtMob.LostFocus
'If txtMob.Text <> "" Then
' If Not IsNumeric(txtMob.Text) Then
' MessageBox.Show("Please enter a numeric value for mobile")
' txtMob.Focus()
' Exit Sub
' End If
'End If
'If Len(txtMob.Text) < 10 Then
' MessageBox.Show("Mobile no Not Valid")

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

' txtMob.Focus()
' Exit Sub
'End If
End Sub

Private Sub txtMob_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtMob.TextChanged

End Sub

Private Sub txtAmount_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)


Handles txtAmount.LostFocus
If txtAmount.Text <> "" Then
If Not IsNumeric(txtAmount.Text) Then
MessageBox.Show("Please enter a numeric value for amount")
txtAmount.Focus()
End If
End If
End Sub

Private Sub txtId_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtId.SelectedIndexChanged
cmd.Connection = con
cmd.CommandText = "Select * from gcustomer where id='" & Trim(txtId.Text) & "'"
rd = cmd.ExecuteReader

While (rd.Read())
txtName.Text = rd("name")
txtAddress.Text = rd("address")
txtResi.Text = rd("tel")
txtMob.Text = rd("mob")
dtpDate.Value = rd("date")
txtMonth.Text = rd("month")
cboConsinment.Text = rd("consignment")
txtWeight.Text = rd("weight")
txtDest.Text = rd("destination")
cboCity.Text = rd("city")
txtAmount.Text = rd("amount")
disableds()
Dim Stat As String
Stat = rd("status")
If Stat = "Yes" Then
rdbYes.Checked = True
ElseIf Stat = "No" = True Then
rdbNo.Checked = True
End If
End While
rd.Close()

End Sub

Private Sub txtWeight_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtWeight.TextChanged

End Sub
End Class

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

Annexur
e

Organization Profile

The World of Willis

We are one of the world's No.3 risk management and insurance intermediaries.

We're in the business of identifying, analyzing and managing risk. We deliver


professional risk transfer, risk management, loss management and actuarial services to
companies, as well as financial and employee benefits consulting.

What makes us different is our entrepreneurial approach and commitment to the


delivery of customized solutions. We concentrate on what we do best - broking, risk
management and consulting. We provide clients with excellent local service, while
enabling them to access our extensive network of global resources. We constantly strive
to improve our offerings - from state-of-the-art product solutions to excellent claims
processing.

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

BI
BLOGRAPHY

 Visual Basic .Net Programming [Black book]

 Steven Holzner

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84


lOMoARcPSD|23903460

 Programming in Visual Basic 6.0

 Julia Bradley

 Anta Millspaugh

 The Complete Reference SQL

 James R. Groff & Paul N. Weinberg

 Web sites:
 www.CodeGuru.com

 www.planetsource.com

 www.MSDN.com

 www.microsoft.com

Downloaded by Vincenzo Max (anandhoni1@gmail.com) 84

You might also like