Вы находитесь на странице: 1из 138

PROJECT ON

BANKING ADMINISTRATION
Submitted in fulfillment of the requirements of the degree of
BACHELOR Of Computer Application(BCA)
(Bangalore University)

BY

ROHIT JAIN (08NASB3054)


SANCHIT GOYAL (08NASB3055)

2010-2011

SRI BHAGWAN MAHAVEER JAIN COLLEGE


SRI BHAGWAN MAHAVEER JAIN COLLEGE
(Bangalore)

CERTIFICATE

This is to certify that Rohit jain (08NASB3054) Sanchit goyal (08NASB3055), are bonafide
students of Sri Bhagawan Mahaveer Jain College and have carried out a project entitled
“BANKING ADMINISTRATION” . This project report has been submitted during the academic
year 2010-2011 in partial fulfillment of the requirements of the Degree of Bachelor Of computer
Application (BCA) of Bangalore University.

Guided By:
………………………………..
Mrs. SMITHA
Lecturer, HOD
Department of BCA Department of BCA
SBMJC SBMJC

...................................

EXTERNAL EXAMINERS
Date :……………………
1. ………………………..

Place :……………………
2. …………………………

2
DECLARATION

We, Rohit jain (08NASB3054),Sanchit goyal (08NASB3055), do hereby declare

that the project work entitled “BANKING ADMINISTRATION” is a bonafide work

carried out by us under the guidance of Mrs. Smita. This project as presented in this

report is our original work and has not been presented for any other University

award. This project has been submitted as part fulfillment of requirements for the

Degree of Bachelor Of Computer Applications 6th Semester of Bangalore

University.

Date : Student Sign : ……………………..

Place : Student Name : ……………………

3
ACKNOWLEDGEMENT

We, the student of third year B.C.A (2010-2011), Sri Bhagawan Mahaveer Jain
College have developed software on BANKING ADMINISTRATION.

We sincerely thank our college management for giving us opportunity to work on


this project.

We are thankful to Mrs. Smita under whose guidance this project was carried out.
We thank Mr. Manjunath.B (H.O.D of BCA department) and all the BCA
department for their co-operation without whom we would not had completed our
project.

Finally we take the pleasure in acknowledging gratefully all of them who helped us
directly or indirectly in the preparation of this software package.

4
SI.NO CONTENTS

1 INTRODUCTION

2 SYNOPSIS

3 SRS

4 E-R DIAGRAM

5 DATA FLOW DIAGRAM

6 TABLE DESIGN

7 SOURCE CODE

8 SCREEN SHOTS

9 TESTING AND REPORTS

10 CONCLUSION

11 BIBLIOGRAPHY

5
INTRODUCTION

The definition of our problem lies in manual system and a fully automated system.

Manual System : The system is very time consuming and lazy. This system is
more prone to errors and sometimes the approach to various problems is
unstructured.

Technical System : With the advent of latest technology if we do not update our
system then our business result in losses gradually with time. The technical
systems contains the tools of latest trend i.e. computers printers, fax, Internet
etc. The systems with this technology are very fast, accurate, user-friendly and
reliable.

Need of BANKING ADMINISTRATION

A few factors that directs us to develop a new system are given below -:
1) Faster System
2) Accuracy
3) Reliability
4) Informative

6
SYNOPSIS

ABOUT THE BANK


The concerned bank serves in savings, current, fixed and recurring deposits.
With the increase of the customers and investments in the bank, the bank needs to be
computerized to provide better service to their customers.

ABOUT THE PROJECT


The bank offers the following four deposits:
• Savings Account
• Current Account
• Recurring Deposit
We aim at automating the transactions and maintaining of the related
informations of the four deposits and we also aim at introducing ATM facility for
the bank for providing better service to the customers.

SAVINGS ACCOUNT
Under this module the savings account of the customers are handled. Interest
will be calculated and the board of directors decides the rate.
The tasks implemented here are:
• Create new accounts for customers
• Enter the deposit, withdrawal i.e., transaction and retrieval information
• Edit any customer information
• Calculated interest

7
• Generate daily reports, particular account number’s report, report of
transaction between the two dates etc.

CURRENT ACCOUNT
Under this model current accounting is handled. No interest is awarded here.
The tasks implemented here are:
• Create new accounts for customers
• Enter the deposit, withdraw i.e., transaction and retrieval information
• Edit new customer information
• Generate daily reports, particular account the two dates etc.

RECURRING DEPOSIT
Under this module only recurring deposit comes. There will be interest for
which the board of directors will decide the rate. In this the customer for which
he/she didn’t pay the installments correctly should pay a penalty. The board of
directors will fix this penalty rate.
In this interface the user in charge will be able to:
• Create new recurring deposits
• Enter the information of customer, the deposit
• Edit any customer information
• Calculate interest

8
SRS-(SYSTEM REQUIREMENT SPECIFICATIONS)

SRS is the starting point of the software development activity specifying


requirements necessarily involves specifying what people have in their minds. When
the inputs from the multiple people are to be gathered, as in most often case, these
inputs are likely to be inconsistence as well.

The SRS is a means of translating the ideas in the minds of the client into formal
document i.e. input to output requirements of the phase. Thus the output of the phase
is a set of formally specified requirements which hopefully are completed and
consistent. A good SRS provides many benefits. Some of the goals it accomplishes
are:-

• Establishing the basis for agreement between client and supplier in


what the software product will do.

• Reducing the development cost. The preparation of the SRS forces,


rigorous specification of the requirements before the design begins.

• Providing a reference for validation of the final product.

9
The SRS assists the client in determining if the software meets the requirement.

Hardware Requirements

Processor : Pentium IV Intel Dual Core 2.0GHz and Above


Memory : 1GB RAM
Display Unit : 15” Color Monitor
Keyboard : IBM PC Compatible
Mouse : IBM PC Compatible

Software Requirements

Operating System : Windows XP with service pack 2 or above


Windows Vista

Developing Tool : Visual Basic 2005 Express edition or above


With Sql Server compact edition
Visual Basic 2008 Express edition or above
With Sql Server compact edition

Database : Microsoft Sql Server

Communication Interface:

• Mouse.

10
• Keyboard.

SYSTEM DESIGN

ER DIAGRAM

An entity-relationship diagram is a graphical depiction of organizational system


elements and the association among the elements. E-R diagrams can help define
system boundaries. The elements that make up a system are referred to as
entities. A relationship is the association that describes the interaction between
entities.

An entity is an object or concept about which you want to store information.

Weak Entity
A weak entity is an entity that must defined by a foreign key relationship with
another entity as it cannot be uniquely identified by its own attributes alone.

Key attribute
A key attribute is the unique, distinguishing characteristic of the entity. For example,
an employee's social security number might be the employee's key attribute.

11
ER DIAGRAM-1

12
ER-DIAGRAM-2

13
ER-DIAGRAM-3

14
ER-DIAGRAM-4

15
DATAFLOW DIAGRAM

16
Data flow diagram is a picture of the movement of data between external entities and
the process and data stored within a system.It allows us to model how data flows
through an information system,the relationships among data flows and how data is to
be stored at specific locations.data flow diagram is an efficient tool that is used for
process modeling.Process modeling is an analysis technique used to capture the flow
of inputs through a system(or a group of processes)to their resulting output.

The DFD symbols are as shown below:


An arrow identifies the data flow,its is the pipeline
through which information flows

A circle or bubble represent a process that


transform incoming data flows into
outgoing data flows.

A rectangle defines the source on


destination of data.

1.A/C TYPE

17
User Verification

Add
new List of
Delete
a/c Modify a/c
record
types details types
s

a/c type

2.CUSTOMER ENTRY

User Verification

Add new Delete List of


Modify
customer record customer
details
s s

customer entry

3.AMOUNT DEPOSIT

18
User Verification

Add new Delete List of


transactio Modify
record transaction
n details
s s

Amount deposit

4.AMOUNT WITHDRAWAL

User Verification

Add new Delete List of


transactio Modify
record transaction
n details
s s

Amount withdrawal

19
5.CHEQUE ISSUE

User Verification

Issue new Delete


Modify List of
cheque record
details details
book s

Cheque issue

20
TABLE DESIGN

1.Bank details:

NAME TYPE NULL VALUE

Bankname Varchar(10) Not null

Address Varchar(100) Not null

Pincode Number(10) Not Null

Phoneno Number(10) Not null

Email Varchar(20) Not null

Website Varchar(20) Not null

Regno Number(10) Not null

21
2.CA A/C TYPES:

NAME TYPE NULL VALUE

Acname Varchar(10) Not null

Facility Varchar(15) Not null

Minbal Number(10) Not null

Rem1 Varchar(15) null

22
3.CABookIssue:

NAME TYPE NULL VALUE

Vno Number(20) Not null

Vdate date Not null

Trantype Varchar(10) Not null

SbAcno Number(20) Not null

fromNO Number(10) Not null

toNO Number(10) Not null

reqNo Number(10) Not null

Rem1 Varchar(10) null

23
4.CA Main:

NAME TYPE NULL VALUE

Acno Number(20) Not null

Custname Varchar(10) Not null

Address Varchar(100) Not Null

Pincode Number(10) Not Null

Phoneno Number(10) Null

Email Varchar(10) Null

DOB Date Not Null

Gender Varchar(6) Not Null

Actype Varchar(10) Not Null

24
5.CA TRAN:

NAME TYPE NULL VALUE

Tranno Number(10) Not null

trandate date Not null

trantype Varchar(10) Not null

Acno Number(10) Not null

tranamt Number(10) Not null

trandet Varchar(10) Not null

Rem1 Varchar(10) null

25
6.RD A/C DET:

NAME TYPE NULL VALUE

Acno Number(20) Not null

Acname Varchar(10) Not null

Cdate date Not null

Instamt Number(10) Not null

Intper Number(10) Not null

Dyear date Not null

Mamt Number(10) Not null

26
7.RDACPerDet:

NAME TYPE NULL VALUE

Acno Number(20) Not null

custname Varchar(10) Not null

address Varchar(100) Not Null

Pincode Number(10) Not Null

phoneno Number(10) Not Null

email Varchar(10) Null

DOB Date Not Null

gender Varchar(6) Not Null

actype Varchar(10) Not Null

NomineeName Varchar(10) Not Null

8.RD TRAN:

27
NAME TYPE NULL VALUE

Tranno Number(10) Not null

trandate date Not null

trantype Varchar(10) Not null

SBAcno Number(10) Not null

tranamt Number(10) Not null

trandet Varchar(10) Not null

Rem1 Varchar(10) null

9.SB A/C MAIN:

28
NAME TYPE NULL VALUE

Acno Varchar(10) Not null

Custname Varchar(10) Not null

Address Varchar(100) Not Null

Pincode Number(10) Not Null

Phoneno Number(10) Not Null

Email Varchar(10) Null

DOB Date Not Null

Gender Varchar(6) Not Null

Actype Varchar(10) Not Null

10.SBActype:

29
NAME TYPE NULL VALUE

Acname Varchar(10) Not null

Facility Varchar(15) Not null

Minbal Number(10) Not null

Rem1 Varchar(15) null

11.SB CHEQUE BOOK ISSUE:

30
NAME TYPE NULL VALUE

Vno Number(20) Not null

Vdate date Not null

Trantype Varchar(10) Not null

SbAcno Number(20) Not null

fromNo Number(10) Not null

toNo Number(10) Not null

reqNo Number(10) Not null

Rem1 Varchar(10) null

12.SB TRAN:

31
NAME TYPE NULL VALUE

Tranno Number(10) Not null

trandate date Not null

trantype Varchar(10) Not null

SBAcno Number(10) Not null

tranamt Number(10) Not null

trandet Varchar(10) Not null

Rem1 Varchar(10) null

13.LOGIN:

NAME TYPE NULL VALUE

uname Varchar(10) Not Null

password Varchar(10) Not Null

SOURCE CODE

32
• FLASH SCREEN FORM:
Public Class FlashScreen
Dim I As Integer
Private Sub FlashScreen_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

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


System.EventArgs) Handles Timer1.Tick
I=I+1
If I > 5 Then
Timer1.Enabled = False
Me.Hide()
LoginForm.Show()
End If
End Sub
End Class

• 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()

33
Dim Cmd0 As New SqlCommand("select * from loginUserTab where
uName='" & UCase(UsernameTextBox.Text) & "' and pword='" &
PasswordTextBox.Text & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
RiMDI.Show()
Me.Close()
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
• COMPANY DETAILS FORM:
Imports System.Data.SqlClient
Public Class CompDetailsForm
Dim pkVar As String
Private Sub CompDetailsForm_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Me.WindowState = FormWindowState.Maximized
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from BankDetailsTab", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(8).ToString

34
TextBox2.Text = D1(0).ToString
TextBox3.Text = D1(1).ToString
TextBox4.Text = D1(2).ToString
TextBox5.Text = D1(3).ToString
TextBox6.Text = D1(4).ToString
TextBox7.Text = D1(5).ToString
TextBox8.Text = D1(6).ToString
TextBox9.Text = D1(7).ToString
End If
End Sub

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


System.EventArgs) Handles butSave.Click
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 cmd1 As New SqlCommand("Delete from BankDetailsTab", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()

Conn.Open()
q1Var = "insert into BankDetailsTab("
q2Var = " values("
q1Var = q1Var & "RegNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "BankName" & ","
q2Var = q2Var & "'" & UCase(TextBox2.Text) & "',"
q1Var = q1Var & "Add1" & ","

35
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" & ","
q2Var = q2Var & "'" & TextBox7.Text & "',"
q1Var = q1Var & "eMail" & ","
q2Var = q2Var & "'" & TextBox8.Text & "',"
q1Var = q1Var & "website" & ")"
q2Var = q2Var & "'" & TextBox9.Text & "')"

'MsgBox(q1Var & q2Var)


Dim cmd2 As New SqlCommand(q1Var & q2Var, Conn)
cmd2.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Company details saved", MsgBoxStyle.OkOnly)

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 TextBox1_LostFocus(ByVal sender As Object, ByVal e As


System.EventArgs) Handles TextBox1.LostFocus
TextBox1.Text = UCase(TextBox1.Text)

36
End Sub
End Class

• SB A/C TYPE FORM:


Imports System.Data.SqlClient
Public Class sbacTypeform
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("SB type saved", MsgBoxStyle.OkOnly)

End Sub

37
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 acName from SbAcTypeTab where
acName='" & 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 SbAcTypeTab("
q2Var = " values("
q1Var = q1Var & "acName" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "Facility" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "Minbal" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "Rem1" & ")"
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()

38
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 acName,MinBal From
SbAcTypeTab order by acName", 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 SbAcTypeTab where
acName='" & 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
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.Text = ""

39
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 SbAcTypeTab where
acName='" & 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("SB type modified", MsgBoxStyle.OkOnly)

40
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 SbAcTypeTab where
acName='" & 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("SB type deleted", MsgBoxStyle.OkOnly)

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

41
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

• SB CUST FORM:
Imports System.Data.SqlClient
Public Class SBCustForm
Dim pkVar As String
Private Sub BuyerForm_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 Cmd0 As New SqlCommand("select acName from sbacTypeTab order by
acName", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
While D1.Read
ComboAcType.Items.Add(D1(0))
End While
End Sub

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


System.EventArgs)

42
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer details saved", MsgBoxStyle.OkOnly)

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 acNo from sbacMainTab where
acNo='" & 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

43
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
q1Var = "insert into sbacMainTab("
q2Var = " values("
q1Var = q1Var & "acNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "custName" & ","
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" & ","
q2Var = q2Var & "'" & TextBox7.Text & "',"
q1Var = q1Var & "eMail" & ","
q2Var = q2Var & "'" & TextBox8.Text & "',"
q1Var = q1Var & "Dob" & ","
q2Var = q2Var & "'" & DDate.Value & "',"
q1Var = q1Var & "Gender" & ","
q2Var = q2Var & "'" & ComboGender.Text & "',"
q1Var = q1Var & "acType" & ")"
q2Var = q2Var & "'" & ComboacType.Text & "')"

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


cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()

End Sub
Sub disRecords()

44
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select acNo,custName From sbacMainTab
order by acNo", 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 sbacMainTab where acNo='"
& 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
TextBox5.Text = D1(4).ToString
TextBox6.Text = D1(5).ToString
TextBox7.Text = D1(6).ToString
TextBox8.Text = D1(7).ToString
DDate.Value = D1(8).ToString
ComboGender.Text = D1(9).ToString
ComboAcType.Text = D1(10).ToString
butNew.Enabled = True
butSave.Enabled = False

45
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 sbacMainTab where acNo='" &
pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False

46
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer details modified", MsgBoxStyle.OkOnly)

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 sbacMainTab where acNo='" &
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer record deleted", MsgBoxStyle.OkOnly)

End Sub

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


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

47
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

• SB DEPOSIT FORM:
Imports System.Data.SqlClient
Public Class sbDepForm
Dim pkVar As Long
Private Sub SbTranTabForm_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 Cmd0 As New SqlCommand("select acNo from sbAcMainTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)

48
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from SbTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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
ClearTxtControls(Me, 1)

49
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into SbTranTab("
q2Var = " values("
q1Var = q1Var & "TranNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "TranDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "1,"
q1Var = q1Var & "SbAcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "TranAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "TranDet" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.Text & "')"

'MsgBox(q1Var & q2Var)


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

50
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 TranNo,SbAcNO,tranAmt From
SbTranTab where tranType=1 order by TranNo", 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 SbTranTab where TranNo="
& pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("SbAcNo").ToString
TextBox3.Text = D1("tranAmt").ToString
TextBox4.Text = D1("TranDet").ToString
TextBox5.Text = D1("Rem1").ToString

butNew.Enabled = True
butSave.Enabled = False

51
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.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 SbTranTab where TranNo=" &
pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False

52
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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 SbTranTab where TranNo=" &
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()

53
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from SbTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.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

• SB WITHDRAW FORM:
Imports System.Data.SqlClient
Public Class SbWithdrawForm
Dim pkVar As Long

54
Dim amnt As Integer
Private Sub SbTranTabForm_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 Cmd0 As New SqlCommand("select acNo from sbAcMainTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)
End While

vDate.Value = Today.Date
End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from SbTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

TextBox1.Focus()

55
End Sub

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


System.EventArgs) Handles butSave.Click
If (amnt - Val(TextBox3.Text)) < 0 Then
TextBox3.Text = ""
MsgBox("cannot withdraw ")
Exit Sub
End If
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into SbTranTab("
q2Var = " values("
q1Var = q1Var & "TranNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "TranDate" & ","

56
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "2,"
q1Var = q1Var & "SbAcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "TranAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "TranDet" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.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 TranNo,SbAcNO,tranAmt From
SbTranTab where tranType=2 order by TranNo", 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

57
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select * from SbTranTab where TranNo="
& pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("SbAcNo").ToString
TextBox3.Text = D1("tranAmt").ToString
TextBox4.Text = D1("TranDet").ToString
TextBox5.Text = D1("Rem1").ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.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()

58
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 SbTranTab where TranNo=" &
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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 SbTranTab where TranNo=" &
pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()

59
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from SbTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False

End Sub

60
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

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


System.EventArgs) Handles ComboBox1.LostFocus
Dim t1, t2 As Double
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select sum(tranAmt) from sbTranTab
where SbacNo='" & UCase(ComboBox1.Text) & "' and trantype=1", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
t1 = IIf(IsDBNull(D1(0)), 0, D1(0))
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd1 As New SqlCommand("select sum(tranAmt) from sbTranTab
where SbacNo='" & UCase(ComboBox1.Text) & "' and trantype=2", Conn)
Dim D2 As SqlDataReader = Cmd1.ExecuteReader()
If D2.HasRows Then
D2.Read()
t2 = IIf(IsDBNull(D2(0)), 0, D2(0))
End If
amnt = t1 - t2
LabelName.Text = "Balance Amount : " & amnt
End Sub

61
End Class

• SB CHEQUE ISSUE FORM:


Imports System.Data.SqlClient
Public Class SbChequeIssueForm
Dim pkVar As Long
Private Sub SbBookIssueTabForm_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 Cmd0 As New SqlCommand("select acNo from sbAcMainTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(vNo) from SbBookIssueTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()

62
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into SbBookIssueTab("
q2Var = " values("

63
q1Var = q1Var & "vNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "vDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "1,"
q1Var = q1Var & "SbAcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "FromNo" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "toNo" & ","
q2Var = q2Var & "" & Val(TextBox2.Text) & ","
q1Var = q1Var & "ReqNo" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.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 vNo,SbAcNO,FromNo From
SbBookIssueTab order by vNo", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

64
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 SbBookIssueTab where
vNo=" & pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("SbAcNo").ToString
TextBox3.Text = D1("FromNo").ToString
TextBox2.Text = D1("toNo").ToString
TextBox4.Text = D1("ReqNo").ToString
TextBox5.Text = D1("Rem1").ToString

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

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

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

65
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 SbBookIssueTab where vNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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

66
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from SbBookIssueTab where vNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(vNo) from SbBookIssueTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.Focus()
butNew.Enabled = False

67
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

• CA A/C TYPE FORM:


Imports System.Data.SqlClient
Public Class CAacTypeForm
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

68
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("CA type saved", MsgBoxStyle.OkOnly)

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 acName from CAAcTypeTab where
acName='" & 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 CAAcTypeTab("
q2Var = " values("
q1Var = q1Var & "acName" & ","

69
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "Facility" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "Minbal" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "Rem1" & ")"
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 acName,MinBal From
CAAcTypeTab order by acName", 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 CAAcTypeTab where
acName='" & pkVar & "'", Conn)

70
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
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()

71
Conn.Open()
Dim cmd1 As New SqlCommand("Delete from CAAcTypeTab where
acName='" & 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("CA type modified", MsgBoxStyle.OkOnly)

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 CAAcTypeTab where
acName='" & 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
ClearTxtControls(Me, 1)
TextBox1.Focus()

72
MsgBox("CA type deleted", MsgBoxStyle.OkOnly)

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

• CA CUST ENTRY FORM:


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

73
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select acName from caacTypeTab order by
acName", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
While D1.Read
ComboAcType.Items.Add(D1(0))
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
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer details saved", MsgBoxStyle.OkOnly)

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")
Exit Sub

74
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select acNo from CAMainTab where
acNo='" & 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 CAMainTab("
q2Var = " values("
q1Var = q1Var & "acNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "custName" & ","
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" & ","
q2Var = q2Var & "'" & TextBox7.Text & "',"
q1Var = q1Var & "eMail" & ","
q2Var = q2Var & "'" & TextBox8.Text & "',"
q1Var = q1Var & "Dob" & ","
q2Var = q2Var & "'" & DDate.Value & "',"

75
q1Var = q1Var & "Gender" & ","
q2Var = q2Var & "'" & ComboGender.Text & "',"
q1Var = q1Var & "acType" & ")"
q2Var = q2Var & "'" & ComboAcType.Text & "')"

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 acNo,custName From CAMainTab
order by acNo", 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 CAMainTab where acNo='"
& pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString

76
TextBox2.Text = D1(1).ToString
TextBox3.Text = D1(2).ToString
TextBox4.Text = D1(3).ToString
TextBox5.Text = D1(4).ToString
TextBox6.Text = D1(5).ToString
TextBox7.Text = D1(6).ToString
TextBox8.Text = D1(7).ToString
DDate.Value = D1(8).ToString
ComboGender.Text = D1(9).ToString
ComboAcType.Text = D1(10).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

77
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 CAMainTab where acNo='" &
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer details modified", MsgBoxStyle.OkOnly)

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 CAMainTab where acNo='" &
pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
disRecords()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False

78
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Customer details deleted", MsgBoxStyle.OkOnly)

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

• CA A/C DEPOSIT FORM:


Imports System.Data.SqlClient
Public Class CADepForm
Dim pkVar As Long

79
Private Sub CATranTabForm_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 Cmd0 As New SqlCommand("select acNo from CAMainTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from CATranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

80
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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Details saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into CATranTab("
q2Var = " values("
q1Var = q1Var & "TranNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "TranDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "1,"
q1Var = q1Var & "AcNo" & ","

81
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "TranAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "TranDet" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.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 TranNo,AcNO,tranAmt From
CATranTab where tranType=1 order by TranNo", 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 CATranTab where TranNo="
& pkVar & "", Conn)

82
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("AcNo").ToString
TextBox3.Text = D1("tranAmt").ToString
TextBox4.Text = D1("TranDet").ToString
TextBox5.Text = D1("Rem1").ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.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

83
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 CATranTab where TranNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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 CATranTab where TranNo="
& 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

84
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from CATranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.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()

85
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

• CA A/C WITHDRAWL FORM:


Imports System.Data.SqlClient
Public Class CaWithdrawForm
Dim pkVar As Long
Dim amnt As Integer
Private Sub CATranTabForm_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 Cmd0 As New SqlCommand("select acNo from CAMainTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)

86
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from CATranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

TextBox1.Focus()
End Sub

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


System.EventArgs) Handles butSave.Click
If (amnt - Val(TextBox3.Text)) < 0 Then
TextBox3.Text = ""
MsgBox("cannot withdraw ")
Exit Sub
End If
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Details saved", MsgBoxStyle.OkOnly)

87
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()
q1Var = "insert into CATranTab("
q2Var = " values("
q1Var = q1Var & "TranNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "TranDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "2,"
q1Var = q1Var & "AcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "TranAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "TranDet" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.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()

88
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select TranNo,AcNO,tranAmt From
CATranTab where tranType=2 order by TranNo", 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 CATranTab where TranNo="
& pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("AcNo").ToString
TextBox3.Text = D1("tranAmt").ToString
TextBox4.Text = D1("TranDet").ToString
TextBox5.Text = D1("Rem1").ToString

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

89
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 CATranTab where TranNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Records modified", MsgBoxStyle.OkOnly)

90
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 CATranTab where TranNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Records deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from CATranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()

91
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.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

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


System.EventArgs) Handles ComboBox1.LostFocus
Dim t1, t2 As Double
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select sum(tranAmt) from caTranTab
where acNo='" & UCase(ComboBox1.Text) & "' and trantype=1", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()

92
t1 = IIf(IsDBNull(D1(0)), 0, D1(0))
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd1 As New SqlCommand("select sum(tranAmt) from caTranTab
where acNo='" & UCase(ComboBox1.Text) & "' and trantype=2", Conn)
Dim D2 As SqlDataReader = Cmd1.ExecuteReader()
If D2.HasRows Then
D2.Read()
t2 = IIf(IsDBNull(D2(0)), 0, D2(0))
End If
amnt = t1 - t2
LabelName.Text = "Balance Amount : " & amnt
End Sub
End Class

• CA CHEQUE ISSUE FORM:

Imports System.Data.SqlClient
Public Class CAChequeIssueForm
Dim pkVar As Long
Private Sub CABookIssueTabForm_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 Cmd0 As New SqlCommand("select SbAcNo from CABookIssueTab
order by SbAcNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)

93
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(vNo) from CABookIssueTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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
ClearTxtControls(Me, 1)

94
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into CABookIssueTab("
q2Var = " values("
q1Var = q1Var & "vNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "vDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "1,"
q1Var = q1Var & "SbAcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "FromNo" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "toNo" & ","
q2Var = q2Var & "" & Val(TextBox2.Text) & ","
q1Var = q1Var & "ReqNo" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.Text & "')"

'MsgBox(q1Var & q2Var)


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

95
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 vNo,SbAcNO,FromNo From
CABookIssueTab order by vNo", 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 CABookIssueTab where
vNo=" & pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("SbAcNo").ToString
TextBox3.Text = D1("FromNo").ToString
TextBox2.Text = D1("toNo").ToString
TextBox4.Text = D1("ReqNo").ToString
TextBox5.Text = D1("Rem1").ToString

96
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.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 CABookIssueTab where
vNo=" & pkVar & "", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()

97
butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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 CABookIssueTab where
vNo=" & 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)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()

98
Dim Cmd0 As New SqlCommand("select max(vNo) from CABookIssueTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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

• RD CUST ENTRY FORM:

99
Imports System.Data.SqlClient
Public Class RDCustEntryForm
Dim pkVar As String
Private Sub BuyerForm_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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

End Sub
Sub SaveRecord()
If TextBox1.Text = "" Then
MsgBox("Please enter the necessary details")

100
Exit Sub
End If
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select acNo from RDAcDetTab where
acNo='" & 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 RDAcDetTab("
q2Var = " values("
q1Var = q1Var & "acNo" & ","
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "achName" & ","
q2Var = q2Var & "'" & TextBox2.Text & "',"
q1Var = q1Var & "cDate" & ","
q2Var = q2Var & "'" & comDate.Value & "',"
q1Var = q1Var & "InstAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "IntPer" & ","
q2Var = q2Var & "" & Val(TextBox4.Text) & ","
q1Var = q1Var & "DYears" & ","
q2Var = q2Var & "" & Val(TextBox5.Text) & ","
q1Var = q1Var & "MAmt" & ")"
q2Var = q2Var & "" & Val(TextBox6.Text) & ")"
'MsgBox(q1Var & q2Var)
Dim cmd1 As New SqlCommand(q1Var & q2Var, Conn)
cmd1.ExecuteNonQuery()

101
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 acNo,achName From RDAcDetTab
order by acNo", 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 RDAcDetTab where acNo='"
& pkVar & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
TextBox2.Text = D1(1).ToString
comDate.Value = D1(2)
TextBox3.Text = D1(3)
TextBox4.Text = D1(4)
TextBox5.Text = D1(5)
TextBox6.Text = D1(6)
butNew.Enabled = True

102
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 RDAcDetTab where acNo='"
& pkVar & "'", Conn)
cmd1.ExecuteNonQuery()
If Conn.State = ConnectionState.Open Then Conn.Close()
SaveRecord()
butNew.Enabled = True
butSave.Enabled = False

103
butModify.Enabled = False
ButDelete.Enabled = False
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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 RDAcDetTab where acNo='"
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


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

104
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

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


System.EventArgs) Handles butCal1.Click
Dim tAmt, Inst, Rate, Period As Double
Inst = Val(TextBox3.Text)
Rate = Val(TextBox4.Text)
Period = Val(TextBox5.Text)

tAmt = 1 + (Rate * 0.0833 * 0.01)


tAmt = tAmt ^ (Period * 12)
tAmt = (tAmt - 1) / (Rate * 0.0833 * 0.01)
tAmt = Inst * tAmt

TextBox6.Text = Math.Round(tAmt, 0)
End Sub
End Class

105
• RD DEPOSIT FORM:

Imports System.Data.SqlClient
Public Class RDDepForm
Dim pkVar As Long
Private Sub RDTranTabForm_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 Cmd0 As New SqlCommand("select acNo from RDAcdetTab order by
acNo", Conn)
Dim D2 As SqlDataReader = Cmd0.ExecuteReader()
While D2.Read
ComboBox1.Items.Add(D2(0).ToString)
End While

vDate.Value = Today.Date

End Sub

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


System.EventArgs)
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from RDTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then

106
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If

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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record saved", MsgBoxStyle.OkOnly)

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()
q1Var = "insert into RDTranTab("
q2Var = " values("
q1Var = q1Var & "TranNo" & ","

107
q2Var = q2Var & "'" & UCase(TextBox1.Text) & "',"
q1Var = q1Var & "TranDate" & ","
q2Var = q2Var & "'" & vDate.Value & "',"
q1Var = q1Var & "TranType" & ","
q2Var = q2Var & "1,"
q1Var = q1Var & "SbAcNo" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1Var = q1Var & "TranAmt" & ","
q2Var = q2Var & "" & Val(TextBox3.Text) & ","
q1Var = q1Var & "TranDet" & ","
q2Var = q2Var & "'" & TextBox4.Text & "',"
q1Var = q1Var & "Rem1" & ")"
q2Var = q2Var & "'" & TextBox5.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 TranNo,SbAcNO,tranAmt From
RDTranTab where tranType=1 order by TranNo", Conn)
adp.Fill(DS1)
DG1.DataSource = DS1.Tables(0)
If Conn.State = ConnectionState.Open Then Conn.Close()
End Sub

108
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 RDTranTab where TranNo="
& pkVar & "", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = D1(0).ToString
vDate.Value = D1(1)
ComboBox1.Text = D1("SbAcNo").ToString
TextBox3.Text = D1("tranAmt").ToString
TextBox4.Text = D1("TranDet").ToString
TextBox5.Text = D1("Rem1").ToString

butNew.Enabled = True
butSave.Enabled = False
butModify.Enabled = True
ButDelete.Enabled = True
Else
TextBox1.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

109
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 RDTranTab where TranNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record modified", MsgBoxStyle.OkOnly)

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()

110
Dim cmd1 As New SqlCommand("Delete from RDTranTab where TranNo="
& 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
ClearTxtControls(Me, 1)
TextBox1.Focus()
MsgBox("Record deleted", MsgBoxStyle.OkOnly)

End Sub

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


System.EventArgs) Handles butNew.Click
ClearTxtControls(Me, 1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select max(TranNo) from RDTranTab",
Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
TextBox1.Text = IIf(IsDBNull(D1(0)), 0, D1(0)) + 1
Else
TextBox1.Text = "1"
End If
ComboBox1.Focus()
butNew.Enabled = False
butSave.Enabled = True
butModify.Enabled = False

111
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

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


System.EventArgs) Handles ComboBox1.LostFocus
If Conn.State = ConnectionState.Open Then Conn.Close()
Conn.Open()
Dim Cmd0 As New SqlCommand("select achName,InstAmt from
RdAcDetTab where acNo='" & UCase(ComboBox1.Text) & "'", Conn)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
If D1.HasRows Then
D1.Read()
LabelName.Text = D1(0) & " Inst Amt : " & D1(1)
If Conn.State = ConnectionState.Open Then Conn.Close()
Exit Sub
End If
End Sub
End class

112
SCREEN SHOTS

• FLASH SCREEN FORM:

113
• LOGIN FORM:

114
• COMPANY DETAILS FORM:

• SB A/C TYPE FORM:

115
116
SBCUSTFORM:

117
• SB DEPOSIT FORM:

118
• SB WITHDRAW FORM:

119
• SB CHEQUE ISSUE FORM:

120
• CA A/C TYPE FORM:

121
• CA CUST ENTRY FORM:

122
• CA A/C DEPOSIT FORM:

123
124
• CA A/C WITHDRAWL FORM:

125
• CA CHEQUE ISSUE FORM:

126
• RD CUST ENTRY FORM:

• RD ACCOUNT ENTRY FORM:

127
128
• RD DEPOSIT FORM:

DATA REPORT

129
• SB CUST REPORT:

130
• SB DEPOSIT REPORT:

131
• SB WITHDRAWAL REPORT:

• CA A/C CUST ENTRY REPORT:

132
• CA A/C WITHDRAWAL REPORT:

133
• CA A/C WITHDRAWAL REPORT:

134
TESTING DEBUGGING AND VALIDATION

135
In this phases we have tried to check all the modules separately for there proper
formatting.

After this step we have performed a unit test to check the functionality of the
whole system.

Further we have come to know to add certain validation in project as given


below

1) Table name- Bank Details


Field name -Bank name
Data type -Text.

When we enter number in the form then it show wrong .Because it is not
number type
It is a character. So it shows wrong value.

2) Table name _Bank Details


Field name- phone number
Data type- number.

When we put any any character it will not accept and we can enter only 10
numbers.

3) Table name –Bank Details


Field name- pincode
Data type- number

When we Put any other value or character then it will not accept.

CONCLUSION

136
The automated system, which has the current manual system, has reduced a lot of
work load. Our main intention was to provide user-friendly interface and reduce
redundancy inn data. Documentation being done manually involves a lot of
manpower, but for the implementation of records in our project, documentation
becomes an easier task. The paper work has been reduced tremendously as most of
the transactions are performed through soft copies.
Since security is the most sought option in this computer era a lot of protection has
been provided to the package thus making it a lot more secure.

BIBLIOGRAPHY

137
SOFTWARE ENGINEERING

practitioner’s approach by pressman.

MICROSOFT VISUAL BASIC 8.0 EXPRESS EDITION

Programmer’s Guide Msdm Microsoft Press

DATABASE MANAGEMENT SYSTEM

VISITED SITE: GOOGLE

USING VISUAL BASIC 8.0 EXPRESS EDITION

138

Вам также может понравиться