Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
351 views80 pages

Metro Train Management System Guide

The document describes a system design for a Metro Train Management System with the following key points: 1. The system is designed to manage employees in a hierarchical organization structure and provide managers with overall views and information to help manage human resources. 2. The system is modularized into different modules like employee creation, employee hierarchy, department entry, employee lists, process details, and job rotation. 3. The design aims to meet requirements like controlled and effective management of employees using current technologies in a modularized and integrated database system.

Uploaded by

care pro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
351 views80 pages

Metro Train Management System Guide

The document describes a system design for a Metro Train Management System with the following key points: 1. The system is designed to manage employees in a hierarchical organization structure and provide managers with overall views and information to help manage human resources. 2. The system is modularized into different modules like employee creation, employee hierarchy, department entry, employee lists, process details, and job rotation. 3. The design aims to meet requirements like controlled and effective management of employees using current technologies in a modularized and integrated database system.

Uploaded by

care pro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 80

1

Contents

Serial Name of Topic Page No.


No.
1. 3.
Certificate
2. Preface 4.
3. Acknowledgement 5.
4. Introduction 6.
5. Objective 7.
6. Abstract 8.
7. Hardware & Software Configuration 9.
8. Introduction of Visual Basic 10.
9. History Of Visual Basic 11.
10. Features Of Visual Basic 12.
11. Introduction To Access 13-14.
12. System Study and Analysis 15-31
13. DFD Diagram 32-33.
14. Snapshot and Coding 34-36.
15. Future Enhancement 37-77.
16. Conclusion 78.
17. Bibliography 79.
2

CHAPTER 1

INTRODUCTION

Introduction

The objective behind developing METRO TRAIN MANAGEMENT SYSTEMis to maintain


the hierarchy of the employees within an organization. It provides the manger and
administrative department an overall hierarchical view of the complete enterprise
and helps them in managing employees.
3

Every Organization has many managers, who are responsible for all the activities in
the organization. These managers manage different aspects of the organizational
management issues, such as manufacturing, production, Marketing, etc; one such
essential management issue is Metro Train Management System

As years progressed, the approach of the management changed towards the human
capital. Now Hierarchical Organization is part of every organization, and has its own
identity and importance. In this scenario, the bigger organizations need to put lot of
effort in the management of human Resources, as they are underlying capital asset
to the organization. In doing so, along with times, the Organization Information
changed from its basic operations to more strategic approach.

1.1 Problem Definition


Almost every activity in the world today is controlled by computer driven software
programs. This trend was first accommodated by engineering applications in the
past. However, as the life style became more and more complex, every area of
human interactions was invaded by various software systems, such as real time,
business, simulation, embedded, web based, personal and more recently, artificial
intelligence software etc.
According to the above facts, managing and maintaining an Metro Train
Smartcard System also be controlled by efficient software. This project focuses
attention on designing efficient and reliable website which controls the functions of
an MOBILE SHOWROOM.
In real world, it tends to associate with automated systems as they provide
many benefits than doing the same thing in manually. As above mentioned, here we
have introduced a system which can be used to maintain an Metro Train
Management System .

When we are concerning the manual process of an METRO TRAIN


MANAGEMENT SYSTEM, the major problem is the waste of time In an METRO TRAIN
MANAGEMENT SYSTEM we should deal with a large number of users. The Admin has
to maintain it with documents which are recorded by him. Therefore, there may be
4

defective reports. Also IMRPO has to appoint more persons to complete the
maintenance of the MOBILE SHOWROOM. Then the METRO TRAIN MANAGEMENT
SYSTEM has to have an additional cost.

1.2 Existing system description

Every Organization has many managers, who are responsible for all the activities in
the organization. These managers manage different aspects of the organizational
management issues, such as manufacturing, production, Marketing, etc; one such
essential management issue is METRO TRAIN MANAGEMENT SYSTEM.

As years progressed, the approach of the management changed towards the human
capital. Now Hierarchical Organization is part of every organization, and has its own
identity and importance. In this scenario, the bigger organizations need to put lot of
effort in the management of human Resources, as they are underlying capital asset
to the organization. In doing so, along with times, the Organization Information
changed from its basic operations to more strategic approach.

Some of the features are.

Finding ground level employee performance by the topmast manager.

Maintenance of profile details of the employees, and retrievals as and when


required.

Overall & detailed view of the organization hierarchy, which is very much essential in
making effective decisions.

Judging the potentiality of the employees.

Maintenance of the data when the organization has many branches spread over wide
geographical area.

 Accessing one branch information from another branch.

 Future planning issues based on the current HR information.

 Employees success planning.


5

 Vacancy situations and their priority /effect on the organizations


performance.

 Employee motivational & conflict resolving issues.

 As the whole project is based on the logical perspective of an ideal


organization’s Human Capital Management structure, the physical
implementation has no fixed rules, thus implementing the concept little
difficult.

 We need to consider while doing the project.

 The user should be provided with all information of the employee details.

 User-friendly interface with minimal training

 Intranet based application

 Provide hierarchical view of the organization

 Provide facilities for future planning

1.3 Organization of the report


The software requirement specification (SRS) is explained in chapter 2.
Chapter 3 outlines the details of the system design. Data base design is given in
chapter 4. Screens are shown in chapter 5; chapter 6 contains the coding for the
particular project. Testing is explained in chapter 7 and our theory concludes with
Conclusion and Future Enhancements in chapter 8 .The software packages used
are explained in Appendix in chapter 9 along with bibliography in chapter 10
6

CHAPTER 2

SOFTWARE REQUIREMENT SPECIFICATION


7

2.1 Software Requirement Specification

INTRODUCTION

Purpose: The main purpose for preparing this document is to give a general insight
into the analysis and requirements of the existing system or situation and for
determining the operating characteristics of the system.

Scope: This Document plays a vital role in the development life cycle (SDLC)

As it describes the complete requirement of the system. It is meant for use by


the developers and will be the basic during testing phase. Any changes made to the
requirements in the future will have to go through formal change approval process.

Developers Responsibilities Overview:

The developer is responsible for:

1) Developing the system, which meets the SRS and solving all the requirements of
the system?

2) Demonstrating the system and installing the system at client's location after the
acceptance testing is successful.

3) Submitting the required user manual describing the system interfaces to work on it
and also the documents of the system.

4) Conducting any user training that might be needed for using the system.
8

5) Maintaining the system for a period of one year after installation.

2.2 Functional Requirements

2.2.1 Software Requirements

 Platform Used: WINDOWS XP / 7

 Software Packages Used:

 NETBEANS

 MYSQL

2.2.2 Minimum Hardware Requirements

 Intel(R) Core((TM)) 2 Duo 2.0 GHz or More

 15” CRT, or LCD monitor

 1 GB RAM or More

 80 GB or More HARD-DISK

 Normal or Multimedia Compatible mouse and keyboard


9

Interface Requirements

User Interface

 A suitable, user friendly menu should be provided.

 This menu acts as an interface between the customer, program and buttons.

 Each of these buttons corresponds to an operation.

 The user can choose the operation he/she wants to perform and provide input
wherever necessary.
10

CHAPTER 3

SYSTEM DESIGN
11

System Design

Hierarchical Organization Information software tool has been designed


keeping in view of all the technical aspects, to suit the proposed
requirements using the current technology. Hierarchical Organization
Information software does not include any external memory hungry .dll or
.exe files. It doesn’t adapt any third party controls.

Combining these powerful, state of art, burning technologies with tightly


integrated database, the Hierarchical Organization Information software
will meet the proposed solution of providing controlled and effective
Management of the employees.

The Hierarchical Organization Information software has been modularized


into following modules…

a) Employee Creation
b) Employee hierarchy
c) Department entry/Department interdependency
d) Live status
e) Employee list enumeration
f) Process details
g) Job rotation
h) Position Weight age based on Department wise, section wise
j) Vacancies maintenance & process details
12

Module Description:

A) Employee Creation

In the Hierarchical Organization Information System each employee


is created with their corresponding department, designation and
section details.

B) Employee hierarchy

In this system Administration department is the Root Department


under which different departments exist. So the Employment
hierarchy will start with root department head like chairman and
subsequently the department employees with depthead and section
employees with their section employees and for sub departments in
the departments can be identified.

c) Department entry/department hierarchy

In this module, Master Data for the departments can be created


employees refer this data .Sub departments Can be identified
.Some of The departments will have Different Sections

Each Department having Department heads ,so department


employees should reported to the department head he may be
subordinate to his superior Department he shall report to him.
Some of departments having sections so section employees shall be
reported to the section in charge he shall report to the department
head.

From this Departments, sub departments the Department


hierarchy shall be created.
13

E)Live status

Live status gives accurate information about which Employee

Will work in which section his superior employees or his


subordinates can be identified along with their corresponding
departments so that the employee info can be managed easily.

Their performance can be monitored and if they need can be


deputed to other department as and when required this can be
effectively managed.

F) Employee list enumeration

The employee details already in the database so the details can be


retrieved as and when required by taking the selective criteria from
the HR manager.

G) Process details

This following process will be done to get the desired results.

 Employee hierarchy can be created using Employers and their


superior’s information.
 Department Hierarchy can be created using the departmental
interdependencies.
 Vacancy list in various departments can be identified and
prioritized by calculating the position weightages.
 Employees can be transferred from one department to another
based on different criteria provided by the HR manager.
 Employee retention can be processed depending their
performance.
14

H) Job Rotation

Job rotation process will be invoked when the employee


experiences monotony in his work / duty. These will result in poor
performance, sometimes leads to major errors in the field of
operation. This can be overcome by job rotation process. In this
the employee will be moved to other department of interest, so that
the employee will work with renovated vigor and vitality.
15

DATA FLOW DIAGRAM

A Dataflow Diagram also known as “Bubble Chart” is used to clarify System requirements and
identifying major transformations that all become programs in System Design

SYMBOLS

Data Source/Destination

Process

Data Storage

Flow of data
16

Position-Weight age
User

Vacanc Vacanci
ies es
Dept / section
Prioritie
s

Vacancies Vacanc
Rotati Rotati
ies
on on
Fillings
user

Rotation Job
Analys
is

Employee
17

CHAPTER 4

DATABASE DESIGN

SQL> desc departments

Name Null? Type

------------------------------- -------- ----

DEPTNO NUMBER(10)

DEPTNAME VARCHAR2(10)

DEPTHEAD VARCHAR2(10)

LOCATION VARCHAR2(10)
18

SQL> desc employees

Name Null? Type

------------------------------- -------- ----

EMPID VARCHAR2(10)

ENAME VARCHAR2(10)

DEPTNO NUMBER(10)

DESIGNATIONID VARCHAR2(10)

SECTIONID VARCHAR2(10)

ADDRESS VARCHAR2(50)

PHONE VARCHAR2(15)

FAX VARCHAR2(15)

EMAIL VARCHAR2(50)

SQL> desc sections

Name Null? Type

------------------------------- -------- ----

SECTID VARCHAR2(10)

SECTNAME VARCHAR2(15)

SECTIONINCH VARCHAR2(10)

DEPTNO NUMBER(10)

SQL> desc designation

Name Null? Type

------------------------------- -------- ----

DESIGNID VARCHAR2(10)

DESIGNATION VARCHAR2(15)
19

SQL> desc DEPTINTERDEPENDENCY

Name Null? Type

------------------------------- -------- ----

DEPTNO NUMBER(10)

UPDEPTNO NUMBER(10)

DNDEPTNO NUMBER(10)

SQL> desc DEPTPOSWEIGHTAGE

Name Null? Type

------------------------------- -------- ----

DEPTNO NUMBER(10)

LAYER NUMBER(10)

WEIGHTAGE NUMBER(10)

SQL> desc jobrotation

Name Null? Type

------------------------------- -------- ----

EMPID VARCHAR2(10)

PRESENRDESIGNATION VARCHAR2(10)

DEPUTEDTO VARCHAR2(10)

STATUS VARCHAR2(50)

REMARKS VARCHAR2(100)

SQL> desc vacancies


20

Name Null? Type

------------------------------- -------- ----

VACANCYID VARCHAR2(10)

DEPTNO NUMBER(10)

SECTIONID VARCHAR2(10)

DESIGNATIONID VARCHAR2(10)

NOOFVACANCIES NUMBER(10)

STATUS VARCHAR2(15)

VACANCYDATE DATE

PRIORITY VARCHAR2(50)

SQL> desc VACANCYFILLDETAILS

Name Null? Type

------------------------------- -------- ----

VACANCYID VARCHAR2(10)

EMPID VARCHAR2(10)

FILLEDDATE DATE

INTAKEDETAILS VARCHAR2(50)

SQL> desc DESIGLAYER

Name Null? Type

------------------------------- -------- ----

DESIGNATIONID VARCHAR2(10)

LAYER NUMBER(10)

WEIGHTAGE NUMBER(10)

SQL> desc DESIGNATIONWEIGHTAGE


21

Name Null? Type

------------------------------- -------- ----

DESIGNATIONID VARCHAR2(10)

DEPTNO VARCHAR2(50)

WEIGHTAGE VARCHAR2(50)

CHAPTER 5

CODING
22

LOGIN FORM

Imports System.Data.SqlClient
Public Class LoginForm

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


System.EventArgs) Handles OK.Click

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


Conn.Open()
Dim Cmd0 As New SqlCommand("select * from UsersTab where
uName='" & UCase(UsernameTextBox.Text) & "' and pword='" &
PasswordTextBox.Text & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MDIParent1.Show()
Me.Hide()
If Conn.State = ConnectionState.Open Then Conn.Close()
Else
MsgBox("Username or Password is not correct please
check")
End If

End Sub

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


As System.EventArgs) Handles Cancel.Click
End
End Sub

End Class
23

MDI FORM

Imports System.Windows.Forms

Public Class MDIParent1

Private Sub QualificationDetailsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
QualificationDetailsToolStripMenuItem.Click
QualificationForm.MdiParent = Me
QualificationForm.Show()
End Sub

Private Sub DesignationDetailsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
DesignationDetailsToolStripMenuItem.Click
Designationform.MdiParent = Me
Designationform.Show()
End Sub

Private Sub EmpDetailsToolStripMenuItem1_Click(ByVal sender As


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

Private Sub EmpListToolStripMenuItem_Click(ByVal sender As


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

Private Sub NewApplicationToolStripMenuItem_Click(ByVal sender As


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

Private Sub SmartCardIssueToolStripMenuItem_Click(ByVal sender As


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

Private Sub SmartCardRechargeToolStripMenuItem_Click(ByVal sender


As System.Object, ByVal e As System.EventArgs) Handles
SmartCardRechargeToolStripMenuItem.Click
CardRechargeForm.MdiParent = Me
CardRechargeForm.Show()
End Sub
24

Private Sub CardBalanceToolStripMenuItem_Click(ByVal sender As


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

Private Sub ToolStripMenuItem1_Click(ByVal sender As


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

Private Sub SmartCardApplicationsToolStripMenuItem_Click(ByVal


sender As System.Object, ByVal e As System.EventArgs) Handles
SmartCardApplicationsToolStripMenuItem.Click
ApplicationReportForm.MdiParent = Me
ApplicationReportForm.Show()
End Sub

Private Sub RechargeReportToolStripMenuItem_Click(ByVal sender As


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

Private Sub TrainDetailsToolStripMenuItem_Click(ByVal sender As


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

Private Sub TrainTimingsToolStripMenuItem_Click(ByVal sender As


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

Private Sub TicketPriceToolStripMenuItem_Click(ByVal sender As


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

Private Sub SwapCardToolStripMenuItem_Click(ByVal sender As


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

Private Sub
CardSwapedForTicketReportToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CardSwapedForTicketReportToolStripMenuItem.Click
TicketIssuedReport.MdiParent = Me
25

TicketIssuedReport.Show()
End Sub

Private Sub MasterEntriesToolStripMenuItem_Click(ByVal sender As


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

End Sub
End Class

DESIGNATION FORM

Imports System.Data.SqlClient
Public Class Designationform
Dim pkVar As String
Private Sub VehicleForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
disRecords()
End Sub

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


As System.EventArgs)
ClearTxtControls(Me, 1)
TextBox1.Focus()
End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select DesignationName from
DesignationTab where DesignationName='" & UCase(TextBox1.Text) & "'",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into DesignationTab("
26

q2Var = " values("


q1Var = q1Var & "DesignationName" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "Details" & ")"
q2Var = q2Var & "'" & TextBox2.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select DesignationName,Details
From DesignationTab order by DesignationName", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from DesignationTab
where DesignationName='" & pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(1).ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub
27

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from DesignationTab where
DesignationName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from DesignationTab where
DesignationName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
TextBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class

QUALIFICATION FORM
28

Imports System.Data.SqlClient
Public Class QualificationForm
Dim pkVar As String
Private Sub VehicleForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
disRecords()
End Sub

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


As System.EventArgs)
ClearTxtControls(Me, 1)
TextBox1.Focus()
End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select QualificationName from
QualificationTab where QualificationName='" & UCase(TextBox1.Text) &
"'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into QualificationTab("
q2Var = " values("
q1Var = q1Var & "QualificationName" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "Details" & ")"
q2Var = q2Var & "'" & TextBox2.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
29

Dim DS1 As New DataSet


Dim adp As New SqlDataAdapter("Select
QualificationName,Details From QualificationTab order by
QualificationName", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from QualificationTab
where QualificationName='" & pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(1).ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from QualificationTab
where QualificationName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False
30

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from QualificationTab
where QualificationName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
TextBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class

SMART CARD APPLICATION FORM

Imports System.Data.SqlClient
Public Class ApplicationForm
Dim pkVar As String
Private Sub EmpDetForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
appDate.Value = Now.Date

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


Conn.Open()
Dim Cmd1 As New SqlCommand("select qualificationname from
QualificationTab order by qualificationName", Conn)
Dim D1 As SqlDataReader = Cmd1.ExecuteReader()
While D1.Read
31

ComboBox1.Items.Add(D1(0).ToString)
End While
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd2 As New SqlCommand("select DesignationName from
DesignationTab order by DesignationName", Conn)
Dim D2 As SqlDataReader = Cmd2.ExecuteReader()
While D2.Read
ComboBox2.Items.Add(D2(0).ToString)
End While

disRecords()
End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select AppNo from ApplicationTab
where AppNo='" & UCase(TextBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into ApplicationTab("
q2Var = " values("
q1Var = q1Var & "AppNo" & ","
q2Var = q2Var & "" & Val(TextBox1.Text) & ","
q1Var = q1Var & "AppDate" & ","
q2Var = q2Var & "'" & Today.Date & "',"
q1Var = q1Var & "AppName" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "Add1" & ","
q2Var = q2Var & "'" & TextBox3.Text & "',"
q1Var = q1Var & "Add2" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Add3" & ","
q2Var = q2Var & "'" & TextBox5.Text & "',"
q1Var = q1Var & "PinCode" & ","
q2Var = q2Var & "'" & TextBox6.Text & "',"
q1Var = q1Var & "PhoneNo" & ","
32

q2Var = q2Var & "'" & TextBox7.Text & "',"


q1Var = q1Var & "eMail" & ","
q2Var = q2Var & "'" & TextBox8.Text & "',"
q1Var = q1Var & "QualificationName" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "ProfessionName" & ","
q2Var = q2Var & "'" & ComboBox2.Text & "',"
q1Var = q1Var & "DOB" & ","
q2Var = q2Var & "'" & Format(jDate.Value, "dd/MMM/yyyy") &
"',"
q1Var = q1Var & "FeeAmt" & ")"
q2Var = q2Var & "" & Val(TextBox9.Text) & ")"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select AppNo,appName From
ApplicationTab order by AppNo", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from ApplicationTab
where AppNo=" & pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(2).ToString
TextBox3.Text = D1(3).ToString
TextBox4.Text = D1(4).ToString
TextBox5.Text = D1(5).ToString
TextBox6.Text = D1(6).ToString
TextBox7.Text = D1(7).ToString
TextBox8.Text = D1(8).ToString
ComboBox1.Text = D1(9).ToString
ComboBox2.Text = D1(10).ToString
jDate.Value = D1(11).ToString
TextBox9.Text = D1(12).ToString
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
33

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from ApplicationTab where
AppNo=" & pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from ApplicationTab where
AppNo=" & pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)

TextBox1.Focus()
TextBox9.Text = "250"
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
34

End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class

CARD ISSUE FORM

Imports System.Data.SqlClient
Public Class CardIssueForm
Dim pkVar As Long
Private Sub ItemForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
disRecords()

iDate.Value = Now.Date
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd1 As New SqlCommand("select empCode from empDetTab
order by empcode", Conn)
Dim D1 As SqlDataReader = Cmd1.ExecuteReader()
While D1.Read
ComboBox1.Items.Add(D1(0).ToString)
End While

End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select AppNo from SmartCardTab
where AppNo=" & (TextBox1.Text) & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
35

If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into SmartCardTab("
q2Var = " values("
q1Var = q1Var & "AppNo" & ","
q2Var = q2Var & "" & Val(TextBox1.Text) & ","
q1Var = q1Var & "AppName" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "CardNo" & ","
q2Var = q2Var & "'" & (TextBox3.Text) & "',"
q1Var = q1Var & "iDate" & ","
q2Var = q2Var & "'" & Format(iDate.Value, "dd/MMM/yyyy") &
"',"
q1Var = q1Var & "issuedBy" & ")"
q2Var = q2Var & "'" & ComboBox1.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select AppNo,AppName From
SmartCardTab order by AppNo", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from SmartCardTab where
AppNo=" & pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(1).ToString
TextBox3.Text = D1(2).ToString
iDate.Value = D1(3).ToString
ComboBox1.Text = D1(4).ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
36

Else
TextBox1.Text = ""
TextBox2.Text = ""
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from SmartCardTab where
AppNo=" & pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from SmartCardTab where
AppNo=" & pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
TextBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
37

ButDelete.Enabled = False
End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class

TRAIN TIMINGS FORM

Imports System.Data.SqlClient
Public Class TrainSchedulingForm
Dim pkVar As String
Private Sub ItemForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
disRecords()

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


Conn.Open()
Dim Cmd1 As New SqlCommand("select TrainName from TrainDetTab
order by TrainName", Conn)
Dim D1 As SqlDataReader = Cmd1.ExecuteReader()
While D1.Read
ComboBox1.Items.Add(D1(0).ToString)
End While
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd2 As New SqlCommand("select StationName from
StationTab order by StationName", Conn)
Dim D2 As SqlDataReader = Cmd2.ExecuteReader()
While D2.Read
ComboBox2.Items.Add(D2(0).ToString)
ComboBox3.Items.Add(D2(0).ToString)
End While

End Sub

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


As System.EventArgs)
ClearTxtControls(Me, 1)
TextBox1.Focus()
End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
38

ButDelete.Enabled = False

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select TrainNo from
TrainTimingsTab where TrainNo='" & UCase(TextBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into TrainTimingsTab "
q2Var = " values("
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q2Var = q2Var & "'" & TextBox2.Text & "',"
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q2Var = q2Var & "'" & ComboBox2.Text & "',"
q2Var = q2Var & "'" & TextBox3.Text & "',"
q2Var = q2Var & "'" & ComboBox3.Text & "',"
q2Var = q2Var & "'" & TextBox4.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select TrainNo,TrainName From
TrainTimingsTab order by TrainNo", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from TrainTimingsTab
where TrainNo='" & pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
39

TextBox2.Text = D1(1).ToString
ComboBox1.Text = D1(2).ToString
ComboBox2.Text = D1(3).ToString
TextBox3.Text = D1(4).ToString
ComboBox3.Text = D1(5).ToString
TextBox4.Text = D1(6).ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from TrainTimingsTab where
TrainNo='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from TrainTimingsTab where
TrainNo='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
40

butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
TextBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class

TRAIN NAME DETAILS

Imports System.Data.SqlClient
Public Class TRainDetailsForm
Dim pkVar As String
Private Sub ItemForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
disRecords()

End Sub

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


As System.EventArgs)
ClearTxtControls(Me, 1)
TextBox1.Focus()
End Sub

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


As System.EventArgs) Handles butSave.Click
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
Sub SaveRecord()
41

If TextBox1.Text = "" Then


MsgBox("Please enter the necessary details")
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select TrainName from TrainDetTab
where TrainName='" & UCase(TextBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
MsgBox("This record is allready present in the database")
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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


Conn.Open()
q1Var = "insert into TrainDetTab("
q2Var = " values("
q1Var = q1Var & "TrainName" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "Vagons" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "Capacity" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "Facilities" & ")"
q2Var = q2Var & "'" & TextBox4.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select TrainName,vagons From
TrainDetTab order by TrainName", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub DG1_CellContentClick(ByVal sender As System.Object,


ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DG1.CellContentClick
pkVar = DG1.CurrentRow.Cells(0).Value
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from TrainDetTab where
TrainName='" & pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(1).ToString
TextBox3.Text = D1(2).ToString
TextBox4.Text = D1(3).ToString
42

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""
TextBox2.Text = ""
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End If
If Conn.State = ConnectionState.Open Then Conn.Close()

End Sub

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


As System.EventArgs) Handles butClose.Click
Me.Close()
End Sub

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


System.EventArgs) Handles butModify.Click
If vbNo = MsgBox("Are you sure you want modify this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from TrainDetTab where
TrainName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

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


System.EventArgs) Handles ButDelete.Click
If vbNo = MsgBox("Are you sure you want delete this record",
MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from TrainDetTab where
TrainName='" & pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False

End Sub
43

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
TextBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
End Sub

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


As System.EventArgs) Handles butList.Click
disRecords()
End Sub

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


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)
End Sub
End Class
TRAIN PRICE FORM

Imports System.Data.SqlClient
Public Class TicketPriceForm

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


As System.EventArgs) Handles Button1.Click

If ComboBox2.Text = "" Then


MsgBox("Please select the from place")
Exit Sub
End If
If ComboBox3.Text = "" Then
MsgBox("Please select the to place")
Exit Sub
End If

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


Conn.Open()
Dim cmd2 As New SqlCommand("delete from ticketPriceTab where
fromplace='" & ComboBox2.Text & "' and toplace='" & ComboBox3.Text &
"'", Conn)
cmd2.ExecuteNonQuery()

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


Conn.Open()
q1Var = "insert into TicketPriceTab("
q2Var = " values("
q1Var = q1Var & "fromPlace" & ","
q2Var = q2Var & "'" & ComboBox2.Text & "',"
q1Var = q1Var & "toPlace" & ","
q2Var = q2Var & "'" & ComboBox3.Text & "',"
q1Var = q1Var & "ticketPrice" & ")"
q2Var = q2Var & "" & Val(TextBox1.Text) & ")"

'MsgBox(q1Var & q2Var)


Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()
44

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

MsgBox("Record saved successfully")

End Sub

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


e As System.EventArgs) Handles ComboBox3.Leave

TextBox1.Text = ""
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select ticketPrice from
ticketPriceTab where fromplace='" & ComboBox2.Text & "' and
toplace='" & ComboBox3.Text & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.Read Then
TextBox1.Text = D1(0)
End If

End Sub

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


e As System.EventArgs) Handles ComboBox2.Leave
TextBox1.Text = ""
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select ticketPrice from
ticketPriceTab where fromplace='" & ComboBox2.Text & "' and
toplace='" & ComboBox3.Text & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.Read Then
TextBox1.Text = D1(0)
End If
End Sub

Private Sub TicketPriceForm_Load(ByVal sender As Object, ByVal e


As System.EventArgs) Handles Me.Load
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd2 As New SqlCommand("select StationName from
StationTab order by StationName", Conn)
Dim D2 As SqlDataReader = Cmd2.ExecuteReader()
While D2.Read
ComboBox2.Items.Add(D2(0).ToString)
ComboBox3.Items.Add(D2(0).ToString)
End While
End Sub

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


As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
45

TICKET ISSUE FORM

Imports System.Data.SqlClient
Public Class TicketIssuedReport

Private Sub AppListReport_Load(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
DateFrom.Value = Today.Date

End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select
vNo,vDate,CardNo,TranAmt From CardTranTab where (vDate >='" &
Format(DateFrom.Value, "dd/MMM/yyyy") & "' and vDate <='" &
Format(dateTo.Value, "dd/MMM/yyyy") & "')" & " and vtype=2 order by
vNo desc", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As


System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50
Dim MyFont As New Font("Arial", 18)
XPos = 10
e.Graphics.DrawString("Cust Care Administration", MyFont,
Brushes.Black, XPos, YPos)
YPos += 50
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("No. 101, 4th floor, UB City, Bangalore
- 560001", MyFont, Brushes.Black, XPos, YPos)
YPos += 100
XPos = 10
e.Graphics.DrawString("Application List", MyFont,
Brushes.Black, XPos, YPos)
YPos += 50
XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("VourcherNo", MyFont, Brushes.Black,
XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("Date", MyFont, Brushes.Black, XPos,
YPos)
XPos = XPos + 150
e.Graphics.DrawString("Card No", MyFont, Brushes.Black, XPos,
YPos)
XPos = XPos + 150
e.Graphics.DrawString("Recharge Amt", MyFont, Brushes.Black,
XPos, YPos)
XPos = XPos + 150
46

YPos += 25
For Each r As DataGridViewRow In DG1.Rows

XPos = 10
e.Graphics.DrawString(r.Cells(0).Value, MyFont,
Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(1).Value, MyFont,
Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(2).Value, MyFont,
Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(3).Value, MyFont,
Brushes.Black, XPos, YPos)
XPos = XPos + 150

YPos += 25
Next
End Sub

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


As System.EventArgs) Handles Button2.Click
PP1.ShowDialog()
End Sub

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


As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
End Class

MODULE

Imports System.Data.SqlClient

Module RIModule1
Public Conn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|
DataDirectory|\MetroCardData.mdf;Integrated Security=True;User
Instance=True")
Public SqlStr, q1Var, q2Var As String
Public colVar, rowVar, I, J As Long
Public vTypeVar As Byte

Enum CtrlType
TextBox = 1
ComboBox = 2
End Enum
Public Sub ClearTxtControls(ByRef frm As Object, ByRef
ControlType As CtrlType, Optional ByRef Tagstr As Object = Nothing)
Dim Contrl As Object
For Each Contrl In frm.Controls
If Not (IsNothing(Tagstr)) Then
If Trim(UCase(Contrl.Tag)) = Trim(UCase(Tagstr)) Then
Contrl.Text = ""
47

Exit For
End If
Else
Select Case ControlType
Case CtrlType.ComboBox
If TypeOf Contrl Is
System.Windows.Forms.ComboBox Then Contrl.Text = ""
Case CtrlType.TextBox
If TypeOf Contrl Is
System.Windows.Forms.TextBox Then Contrl.Text = ""
End Select
End If
Next Contrl
Contrl = Nothing
End Sub
End Module

CHAPTER 6
TESTING
48

TESTING

This section deals with the details of the classes of tests which must be conducted to
validate the functions, performance, and the constraints. This is achieved basically by the
means of testing which plays a vital role in the development of the software. The various low
level testing which can be grouped on a broader sense are discussed as below:

 Unit Testing: Testing of each and every module individually is called unit testing.
Each module is designed and executed so that it works independently and
generates some relative output. Unit testing of a module results in a set of
individually executing modules that generates its independent output. The modules
in this project i.e. purchases, sales, returns, cash and bank transactions, stock status
and others are individually tested.

 Integration Testing: Integration testing is one in which the modules are combined
with one another to synchronize the outputs and co-ordinate the flow of control.
Each module is coalesced with other module to establish proper connectivity
between the two modules. All the individual modules have been integrated and
tested.

 Validation Testing: Validation testing deals with testing that whether the
validations are justified and all the requirements are fulfilled logically as per the
requirements as the validations are designed according to the requirements of the
application – an approach to the problem in a logical and relational manner. All the
validation testing have been done (like only the numbers should be accepted in the
49

phone number , amount , bill no fields ,quantity and other related fields, similarly
for the text to accepted only in related fields like the names and other related
fields). The stock validation is the major validation that keeps track of the products
dealt and the reorder levels.

 System Testing: Testing the whole system i.e. verifying and validating the whole
source code to check if the system as a whole is executing is called system testing.
The proposed system undergoes it under all conditions to be called a successful
system.

Notes

All testing has been carried out using some sample data.

Each section in the remainder of this document has lists of test criteria that must be satisfied
for the system to have passed that section of testing. In front of the each criteria test Passed
or Failed is written.

Unit Testing

The purpose of unit testing is to uncover errors in the smallest software unit -- the routine.
Each routine will be tested individually using black box-oriented tests. The programmer of
each module will design a set of test cases for that module and ensure that the module is
fully tested. Important or complex routines will also be tested by at least one other person.

Integration Testing

This section describes the integration strategy and procedures for the system. It gives the
order in which modules will be developed and how they will be integrated. It also describes
the specific tests that will be performed on integrated sets of modules. Note: It is important
that each module be thoroughly tested as a unit before being integrated with other modules.

Integration testing of unit tested modules is necessary to ensure that:


50

 modules interface correctly with each other;


 one module does not have inadvertent, undesirable effects on another module;

 sub modules (routines) combine to produce the desired functions of the major
module;

 Interfaces to, and use of global data structures are consistent.

System Testing

Functional Requirements Testing

The functionality tests should be performed by the application representatives and treat the
whole system as a black box using the actual applications or middleware. The aim of these
tests is to verify the overall functionality of the system.

This will be performed by a section by section walkthrough of the SRS functional


requirements section. All functional requirements in the SRS must be fulfilled.

Beta Testing

Method

This will be performed by the client, and by potential users of the system at the Bureau of
Meteorology. Users will be given a copy of the system to try out. Any problems with the
system will be reported back to the group.

Beta Testing

To help us achieve the best possible result with our project, we have decided to get as much
input as possible from potential users of our system.

Bugs.

If unexpected events happen while using project,

Alterations.
51

If there is anything missing from the system, that you would like to see there, we would also
like to know about it. Most likely we will not be able to implement the changes to the
current system (due to time restraints) but when the full system is written next year, it will
most likely be present.

 All Comments... Can be sent to us in various ways.

Please include your name and email address in any correspondence.

Results

Comments received from the customers:

Alpha testing - prototype 2 of system

Performance and Stress Testing

A set of tests have been developed for performance and stress testing. Performance tests
will ensure that the system responds in a reasonable time to user input (as defined in the
SRS). The aim of stress testing is to try to break the program by giving it abnormal or extreme
input quantity, frequency or volume.

Performance testing will be performed at the client's site after installation. According to the
SRS:

The system must respond to all reports within 10 seconds on an Pentium IV computer with a
load average less than 1.

 Performance criteria satisfied.

Stress testing with extreme and abnormal input cases has been performed where necessary
on individual routines in the Unit Testing section.

 Stress testing satisfied.


52

Acceptance Testing

Acceptance testing consists of a suite of tests to be performed in the presence of the client
before he accepts the system. It will consist of the function tests, performance tests (at the
client's site) a walk-through of the user manual and the final demonstration.

 Function tests accepted.


 Performance tests accepted.
 User manual walkthrough accepted. Will be held performed along with
Installation Testing.
 Final demonstration accepted.

Installation Testing

Installation tests will check the installation and configuration procedure as well as any
missing dependencies.

Installation tests test the installation and configuration procedures. These tests are a set of
scripts that automatically download all necessary packages and install them.

Acceptance testing will be repeated after installation of the system at the Customer Place.
This is to ensure that the system works correctly in the Customer Place.

Some specific points that also need to be tested are:

1. Directory paths for data and help files are set up correctly and can be found by the
system.
2. Check for necessary third party controls.

3. All IDL library functions can be found by the system.

4. All fonts for the text tool can be found and loaded -- beta testing uncovered some
problems loading some fonts.

5. Check Printer drivers are installed properly.


53

Regression Testing

The selective retesting of a software system that has been modified to ensure that any bugs
have been fixed and that no other previously working functions have failed as a result of the
reparations and that newly added features have not created problems with previous versions
of the software. Also referred to as verification testing, regression testing is initiated after a
programmer has attempted to fix a recognized problem or has added source code to a
program that may have inadvertently introduced errors. It is a quality control measure to
ensure that the newly modified code still complies with its specified requirements and that
unmodified code has not been affected by the maintenance activity.

Regression testing was not usually necessary, because most of the errors detected were very
localized, and did not affect other functions in an adverse manner.
54

DATA VALIDATION

Data validation is a very important part in any application involving a database. We


have to be aware of the specifications of the database organization and also about the kind
of data that goes into the database. We have to provide for stringent error checking, in order
to discard invalid data and prevent it from getting it into the database.

Data validation can be done in two places. While creating the database schema, we
can specify certain integrity constraints that have to be maintained b/w various relations in
the schema. This ensures that no insertion, deletion and update anomalies creep in during
operation. Data validation can also be done at the interface itself, to provide more robust
level of data validation. For example, in the login form whose loginid has been established
by the administrator will be given login permission. This can be trapped at the interface level
itself. And in the form, to modify the user profile, the administrator is allowed to modify only
if that loginid has need permission.

Some Examples of Data Validation done in this project are:

 Invalid loginid cannot be entered.

 Invalid Email Id, Phone no. cannot be entered.

 All the Mandatory fields should be filled.

 And various Front End and Back End Validations.

CHAPTER 7
Snapshot
55
56
57
58
59
60
61
62

CHAPTER 8
CONCLUSION

Conclusion

 The project has been appreciated by all the users in the


organization.
 It is easy to use, since it uses the GUI provided in the user dialog.
 User friendly screens are provided.
 The usage of software increases the efficiency, decreases the effort.
 It has been efficiently employed as a Site management mechanism.
It has been thoroughly tested and implemented
63

CHAPTER 9
APPENDIX
64

SOFTWARE ENVIRONMENT

The proposed system is developed using Java as the front end and Sql Server as the
back end.

Java Overview

Java is an easy to use and easy to learn program that allows everyone, from the
novice to the professional developer, to create applications. It provides you with a
streamlined development environment help you to develop dynamic web
applications in easy way. It provides you with a great set of tools, wizards, more than
60 reusable controls, and hundreds of reusable code snippets to reduce the time and
effort needed to create an attractive professional web application. The Java gives
you the ability to visually designing your web sit through the use of toolbox, property
window, login controls, web part controls, navigation controls, document outline,
master page, and table designer. There is a set of controls dialogs and wizards to help
you in communicating with a certain database or data source. When you encounter a
problem with your application you certainly debug it to explore this problem and fix
it. Java provides some tools to simplify the debugging process.
65

This new version enables cool fun features that build on the latest technologies
including AJAX, CSS, LINQ and JavaScript IntelliSense. While the other Express Edition
products focus on programming and application development, Java provides a set of
tools; its versatile HTML and CSS editing tools are paired with the power of ASP.NET
to allow users to quickly build web applications.

To make your task easy Microsoft provides a lot of learning materials all can be
reached from within the Java environment.

With Java you can create wonderful and full featured web sites while enjoying an
easy and sophisticated environment and development tool for web applications.

Java delivers key advances for developers in three primary pillars:

Rapid application development

Effective team collaboration

Break through user experiences

Java provides advanced development tools, debugging features, database


functionality, and innovative features for quickly creating tomorrow's cutting-edge
applications across a variety of platforms.

Java includes enhancements such as visual designers for faster development with
the .NET Framework 3.5, substantial MOBILE SHOWROOMvements to Web
development tools and language enhancements that speed development with all
types of data. Java provides developers with all the tools and framework support
required to create compelling, expressive, AJAX-enabled Web applications.
66

Developers will be able to take advantage of these rich client-side and server-side,
frameworks to easily build client-centric Web applications that integrate with any
back-end data provider, run within any modern browser, and have complete access
to ASP.NET application services and the Microsoft platform.

Rapid Application Development

To help developers rapidly create modern software, Java delivers MOBILE


SHOWROOMved language and data features, such as Language Integrated Query
(LINQ), that make it easier for individual programmers to build solutions that analyze
and act on information.

Java also provides developers with the ability to target multiple versions of the .NET
Framework from within the same development environment. Developers will be able
to build applications that target the .NET Framework 2.0, 3.0 or 3.5, meaning that
they can support a wide variety of projects in the same environment.

Break Through User Experience

Java offers developers new tools that speed creation of connected applications on
the latest platforms including the Web, Windows Vista, Office 2007, SQL Server , and
Windows Server . For the Web, ASP.NET AJAX and other new technologies will enable
developers to quickly create a new generation of more efficient, interactive, and
personalized Web experiences.

Effective Team Collaboration

Java delivers expanded and METRO TRAIN MANAGEMENT SYSTEMofferings that help
METRO TRAIN MANAGEMENT SYSTEMcollaboration in development teams, including
67

tools that help integrate database professionals and graphic designers into the
development process.

Use the Microsoft .NET Framework 3.5

The .NET Framework enables the rapid construction of connected applications that
provide outstanding end-user experiences by providing the building blocks (pre-
fabricated software) for solving common programming tasks. Connected applications
built on the .NET Framework model business processes effectively and facilitate the
integration of systems in heterogeneous environments.

Together Java and the .NET Framework reduce the need for common plumbing code,
reducing development time and enabling developers to concentrate on solving
business problems.

The .NET Framework 3.5 builds incrementally on the .NET Framework 3.0.
Enhancements have been made to feature areas including the base class library,
Windows Workflow Foundation, Windows Communication Foundation, Windows
Presentation Foundation, and Windows Card Space.

Operators

Programming languages have a set of operators that perform arithmetical


operations, and others such as Boolean operations on truth values, and string
operators manipulating strings of text. Computers are mathematical devices, but
compilers and interpreters require a full syntactic theory of all operations in order to
parse formulae involving any combinations correctly. In particular they depend on
68

operator precedence rules, on order of operations, that are tacitly assumed in


mathematical writing.

Conventionally, the computing usage of operator also goes beyond the mathematical
usage (for functions). In Java.NET, New, AddressOf and CType are operators. You can
also define your own uses for operators. When an operator is alphanumeric rather
than a punctuation character, it is sometimes called a named operator.

So operators are special symbols that are used to represent for example simple
computations like addition and multiplication. Most of the operators in ASP.NET do
exactly what you would expect them to do, because they are common mathematical
symbols. For example, the operator for adding two integers is +.

Java Language Controls

Like its predecessor, Java excels in creating graphical user interfaces. Although the
programmer still has the option of creating controls and setting their properties
programmatically (i.e., by hand writing the code), he usually will create many, if not
all of the controls in the interface by selecting items from the toolbox and adding to a
particular form. While working with forms, you can use the toolbox to drag different
controls to the form you are designing, resize them and relocate them using the
mouse.

Java Classes
69

The Class concept is the main foundation of Object Oriented Programming. In a


world of Graphical User Interfaces and more complex programs, classes have become
a very important part of programming.

Terminology

Object: A unit that has its own properties and methods for a user to use at his or her
discursion.

Encapsulation: Lets the user of the class control the data and operations of a class
that can be seen from other classes.

Property: Represents a data value associated with an instance.

Method: An operation that can be performed by the class.

Constructor: The method that is called when an object of the class has been
instantiated.

Field: A variable at the class level.


70

Design features

Interoperability

Because computer systems commonly require interaction between new and older
applications, the .NET Framework provides means to access functionality
that is implemented in programs that execute outside the .NET
environment. Access to COM components is provided in the
System.Runtime.InteropServices and System.EnterpriseServices namespaces
of the framework; access to other functionality is provided using the
P/Invoke feature.

Common Language Runtime Engine

The Common Language Runtime (CLR) is the execution engine of the .NET
Framework. All .NET programs execute under the supervision of the CLR,
guaranteeing certain properties and behaviors in the areas of memory
management, security, and exception handling.

Language Independence

The .NET Framework introduces a Common Type System, or CTS. The CTS
specification defines all possible datatypes and programming constructs
supported by the CLR and how they may or may not interact with each
other conforming to the Common Language Infrastructure (CLI)
specification. Because of this feature, the .NET Framework supports the
exchange of types and object instances between libraries and applications
written using any conforming .NET language.

Base Class Library


71

The Base Class Library (BCL), part of the Framework Class Library (FCL), is a library of
functionality available to all languages using the .NET Framework. The BCL
provides classes which encapsulate a number of common functions,
including file reading and writing, graphic rendering, database interaction,
XML document manipulation and so on.

Simplified Deployment

The .NET Framework includes design features and tools that help manage the
installation of computer software to ensure that it does not interfere with
previously installed software, and that it conforms to security requirements.

Security

The design is meant to address some of the vulnerabilities, such as buffer overflows,
that have been exploited by malicious software. Additionally, .NET provides
a common security model for all applications.

Portability

The design of the .NET Framework allows it theoretically to be platform agnostic, and
thus cross-platform compatible.[citation needed] That is, a program written
to use the framework should run without change on any type of system for
which the framework is implemented. While Microsoft has never
implemented the full framework on any system except Microsoft Windows,
the framework is engineered to be platform agnostic,[5] and cross-platform
implementations are available for other operating systems (see Silverlight
and the Alternative implementations section below). Microsoft submitted
the specifications for the Common Language Infrastructure (which includes
the core class libraries, Common Type System, and the Common
Intermediate Language),[6][7][8] the C# language,[9] and the C++/CLI
language[10] to both ECMA and the ISO, making them available as open
standards. This makes it possible for third parties to create compatible
implementations of the framework and its languages on other platforms.
72

SQL Server Compact Edition

Introduction
A new generation of applications is on the horizon for businesses and consumers.
This is driven by market changes such as a growing mobile workforce and its need for
productivity even when not “connected” and an explosive growth of new devices
such as personal digital assistants (PDAs), portable music players, and gaming
consoles, creating exciting possibilities for new applications. These new applications
place new demands on the data platform on which they are developed.

To meet the needs of this changing application landscape, Microsoft introduces its
newest edition of the SQL Server database product line, SQL Server Compact Edition
— a maintenance-free, compact embedded database for single-user client
applications for all Windows Platforms, including Tablet PCs, Pocket PCs, Smart
Phones and Desktops. Compact Edition is available to deploy and redistribute free of
charge.

This white paper outlines the current business and consumer environment and the
key factors that influence the need for this new generation of applications. It
describes how SQL Server Compact Edition can be used to satisfy the data platform
demands of these applications.

Business Environment and Customer Challenges

Evolving business and consumer needs are placing new demands on the next
generation of applications. In the business sphere, more and more employees or
information workers are mobile and are seeing the need to run their traditional
desktop applications on mobile devices like PDAs and Tablet PCs. For example, sales
personnel require Customer Relationship Management (CRM) applications on their
mobile devices; field service employees need to check product specifications and
perform online ordering from mobile devices, and so on. In addition, these mobile
information workers cannot rely on being connected to the corporate network at all
73

times, but need to have the same rich and complete application experience in the
“disconnected” or “occasionally connected” state, as they would have in the
“connected” state. A classic example of this is the offline e-mail experience presented
by Microsoft Office Outlook, where users can work on their locally stored e-mails in a
disconnected state and synchronize with the server when connectivity is available.
Information workers also expect a seamless integrated experience between multiple
devices. For example, one may start entering data into an expense reporting
application on a PDA and continue working on the same application from a desktop
at a later point, starting from where he or she left off on the PDA.

Another growing trend in businesses today is to gain competitive advantage by


gaining insights from a plethora of data that is collected every day. This data is being
gathered at the “edges” of the enterprise – for example: inventory information
gathered through scanning radio frequency identification (RFID) tags at a
warehouse – and needs to be aggregated with data from other edge locations at a
central site for analysis. Similarly, the mobile workforce that works at the edges of
the enterprise needs relevant and current business information from the central data
repository.

Meanwhile, information technology (IT) departments that develop and deploy these
line-of-business (LOB) applications in their businesses continue to grapple with the
challenge of providing robust IT services that are secure and reliable in spite of
constantly falling budgets. IT departments continue to look for ways to develop new
applications rapidly by leveraging existing skills and tools and to find ways to easily
deploy and manage end-user applications, which helps to keep costs down.

For consumers, rich personal applications continue to proliferate and evolve on


desktops and home devices, such as gaming consoles and digital video recorders
(DVRs). These applications are becoming more and more connected as vendors sell
additional personalized services through the Internet. For example, a vendor that
sells a tax application can offer services to consumers to securely store their year-end
data online for any future need. Similarly, vendors can offer enhanced end-user
experiences with their client applications using this service model. For example, an
online streaming audio/video service that automatically downloads images of the
74

album or video cover can enhance the end-user experience. Staying in touch with the
customer through an Internet service can also help vendors track user preferences
and better target their software offerings.

Rich consumer applications also continue to grow rapidly in mobile phones and in
the convergent devices arena. Applications such as calendaring that were in the
business realm are now also increasingly being required in personal devices.

As application paradigms change, application developers have new requirements for


the database platform on which these applications are built. In particular, there is a
growing need for local-store databases that are:

 Embeddable to provide better application security, performance, and ease of


distribution and deployment.

 Lightweight and compact to preserve system resources, especially in devices


where processor and memory is premium.

 Componentizable to allow application vendors to choose essential


functionality only, which keeps application size to a minimum.

 Supported on multiple devices so the same application code can be used to


build applications on multiple devices and platforms.

 Capable of providing automatic synchronization to allow end-users to work


with most recent data in an offline application experience and to push
updates to a central location.

 Built with advanced security to protect against threats such as stolen mobile
devices.

The Solution

In light of the changing needs of the new class of applications, Microsoft introduces
its newest edition of the SQL Server database product line, SQL Server Compact
Edition. It is an evolution of the SQL Server Mobile Edition technology. While the
latter was used exclusively for mobile devices, its capabilities are now being
leveraged to create maintenance-free, compact (less than 2 MB disk footprint)
embedded databases for single-user client applications for all Microsoft Windows
75

platforms, including Tablet PCs, Pocket PCs, smart phones, and desktops, to enable
the scenarios discussed earlier in the paper.

SQL Server Compact Edition also enables an application to scale up, either via a
robust synchronization with other SQL Server Editions, or by moving to a higher
edition of SQL Server.

How SQL Server Compact Edition Can Help

SQL Server Compact Edition addresses the new application development challenges
by providing for faster results and increased productivity, better decision making
support and a trusted platform.

Faster Results and Increased Productivity

Developers and administrators can achieve faster results with SQL Server Compact
Edition.

Developers

SQL Server Compact Edition is tightly integrated with Microsoft Java as well as the
.NET Framework. Developers can readily use their existing knowledge of developing
database applications with Java to build SQL Server Compact Edition based
applications, which enables them to be instantly productive. SQL Server Compact
Edition supports a familiar structured query language (SQL) syntax and common
programming model, such as ADO.NET. A significant productivity advantage for
developers is that they can use the same application code to build the application for
multiple devices and platforms. SQL Server Compact Edition applications can also be
seamlessly migrated from mobile and desktop scenarios to work with other editions
of SQL Server in multi-user or server scenarios.

Administrators
76

As the database is embedded in the application, little or no management is required.


SQL Server Compact Edition can be included in the application package and deployed
using the Click Once deployment feature of Java . Alternatively, this lightweight data
store can be downloaded quickly. SQL Server Compact Edition can be configured to
keep up-to-date with the Microsoft Update services, so administrators will not need
to bother with complicated maintenance plans. However, the user needs to have
administrative privileges to install SQL Server Compact Edition on a tablet PC or
desktop. An administrator can use SQL Server Management Studio (including Express
Edition) to administer the database.

Better Decisions

With SQL Server Compact Edition, together with SQL Server business intelligence
capabilities, you can extend your business insights further across the organization to
data sources in distributed and mobile applications. By enabling synchronization to a
central database, data in such applications can be captured, analyzed by SQL Server
Analysis Services, and reported by SQL Server Reporting Services. The Report Viewer
Controls available in Java can be used in applications to provide rich reports based
on data from SQL Server Compact Edition. With SQL Server Compact Edition, you can
deliver the right data, at the right place and time, in the right form factor.

Trusted Platform

As a leading database platform, SQL Server provides an unsurpassed level of trust.


The SQL Server product line has been in existence for more than 10 years and has
millions of customers.

Reliability

Being a member of the SQL Server family, SQL Server Compact Edition takes
advantage of proven technologies. Originally built on SQL Server Mobile technology,
SQL Server Compact Edition has additional capabilities to ensure that applications
perform well and are secure. SQL Server Compact Edition includes “self-healing” and
management technologies that are designed to handle “instant off” and dead battery
scenarios in mobile devices.
77

SQL Server Compact Edition supports two synchronization technologies to ensure


that data is reliably delivered, supporting updates on both the server and client end.
Remote Data Access (RDA) is a synchronization technology that can be used when a
lightweight synchronization solution is adequate (e.g. no conflict resolution). SQL
Server Compact Edition also supports merge replication, which is ideal when a more
sophisticated solution is required.

Security was a critical part of the design of SQL Server Compact Edition. Because it
was designed into the product, organizations can trust the high security level for data
protection in these ways:

 Synchronization uses 128-bit SSL for secure and reliable functionality, even
through firewalls.

 SQL Server Compact Edition uses 128-bit RSA file-based encryption on devices
for database file security.

 SQL Server Compact Edition provides an encrypted data format with


password protection.

 SQL Server Compact Edition uses a single file format, enabling document-safe
format.

Better Over Time

SQL Server scales up from a device to the data center, so as business requirements
grow, SQL Server Compact Edition can easily scale up to other editions of SQL Server.
Applications of all sizes are supported on the trusted SQL Server platform, including:

 ISV applications that run on mobile devices or a local desktop.

 Occasionally connected applications that need automatic synchronization.

 Small company, departmental, and workgroup scenarios.

 Web-based applications.

 Large enterprise applications, including MRP, financial, and ERP scenarios.


78

Conclusion

ORACLE Compact Edition rises to the challenge of enabling application vendors and
IT organizations to create the next wave of applications. Whether it is providing a rich
and complete desktop-like application experience to the mobile information workers
who are occasionally connected or consumers who are demanding more from their
desktop and device applications, SQL Server Compact Edition has a host of features
and capabilities that enable it to effectively serve as a local data store for these new
applications. Such features include high security, high performance, simple
development and deployment, and automatic synchronization.
79

CHAPTER 10
BIBLIOGRAPHY
80

BIBLIOGRAPHY

Websites:

1. www.msdn.Sql.com

2.www.scribd.com

3. www.ask.com

4. www.schools3.com

Books refeRTOed:

1. Netbeans (Skywards publications)


2. A complete Netbeans training 6 course:How to Program:Packages
3. Advanced programming Using Netbeansc:Version 7.0
4. Netbeans 7.0 Programming(Black Book)

You might also like