banking system mini project.doc

15

Click here to load reader

Upload: ravi-karthikeyan

Post on 08-Nov-2014

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BANKING SYSTEM MINI PROJECT.doc

BANKING SYSTEM MINI PROJECT

AIM: To create a software package for Banking system which is modeled on realtime banking systems using Visual Basic 6 as front end and Oracle as back end provider

PROBLEM DEFINITION:

1.The login screen should allow two classes of users – ->Bank Customer ->Administrator

2.The customer should be able to deposit, withdraw and check his/her account balance 3.The administrator should be able to add new record, delete an existing record and view database information

Description of Login Table:

Name Null? Type ----------------------------------------- -------- --------------------------

USERNAME VARCHAR2(10) PASSWORD VARCHAR2(10)

Description of Bank Table:

Name Null? Type ----------------------------------------- -------- -----------------------

ANO NOT NULL NUMBER(10) NAME VARCHAR2(10) BALANCE NUMBER(7) TYPE VARCHAR2(3)

Page 2: BANKING SYSTEM MINI PROJECT.doc

VISUAL BASIC CODING:

LOGIN FORM:

Private Sub Command1_Click()Adodc1.RefreshDim str1$Dim str2$str1 = Adodc1.Recordset.Fields(0)str2 = Adodc1.Recordset.Fields(1)Dim str3$Dim str4$Adodc1.RefreshAdodc1.Recordset.MoveNextstr3 = Adodc1.Recordset.Fields(0)str4 = Adodc1.Recordset.Fields(1)If Text1.Text = str1 And Text2.Text = str2 ThenForm2.ShowUnload MeElseIf Text1.Text = str3 And Text2.Text = str4 ThenForm3.ShowUnload MeElseMsgBox "Unknown User or Password"End IfEnd Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

CUSTOMER HOME FORM:Private Sub Command1_Click()Form4.ShowUnload MeEnd Sub

Private Sub Command2_Click()MsgBox "Please Note that the minimum balance is Rs.1000"Form5.ShowUnload MeEnd Sub

Page 3: BANKING SYSTEM MINI PROJECT.doc

Private Sub Command3_Click()Form6.ShowUnload MeEnd Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form1.ShowUnload MeEnd Sub

ADMINISTRATOR HOME FORM:

Private Sub Command1_Click()Form7.ShowUnload MeEnd Sub

Private Sub Command2_Click()Form8.ShowUnload MeEnd Sub

Private Sub Command3_Click()DataReport1.ShowEnd Sub

Private Sub Command4_Click()DataReport2.ShowEnd Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Page 4: BANKING SYSTEM MINI PROJECT.doc

Private Sub mnuhome_Click()Form1.ShowUnload MeEnd Sub

DEPOSIT FORM:

Private Sub Command1_Click()If (Text1.Text = "" Or Text2.Text = "") ThenMsgBox "Please enter account number and amount"Text1.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) <> Val(Text1.Text)) ThenAdodc1.Recordset.MoveNextElseGoTo lab1End IfWendIf (Adodc1.Recordset.EOF = True) ThenMsgBox "Account not found"End If

lab1:If (Option2.Value = True) ThenIf (Len(Text3.Text) <> 10 Or IsNumeric(Text3.Text) = False) ThenMsgBox "Please enter valid cheque number"Text3.SetFocusElseAdodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) + Val(Text2.Text)Adodc1.Recordset.UpdateMsgBox "amount deposited"Adodc1.RefreshEnd IfElseIf (Option1.Value = True) ThenAdodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) + Val(Text2.Text)Adodc1.Recordset.UpdateMsgBox "amount deposited"ElseIf (Option3.Value = True) ThenIf (Text3.Text = "" Or Len(Text3.Text) <> 10 Or IsNumeric(Text3.Text) = False) ThenMsgBox "Please enter valid DD number"Text3.SetFocusElse

Page 5: BANKING SYSTEM MINI PROJECT.doc

Adodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) + Val(Text2.Text)Adodc1.Recordset.UpdateMsgBox "amount deposited"Adodc1.RefreshEnd IfElseMsgBox "please select payment method"End IfEnd Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuclear_Click()Text1.Text = ""Text2.Text = ""Text3.Text = ""Option1.Value = FalseOption3.Value = FalseOption2.Value = FalseEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form2.ShowUnload MeEnd Sub

WITHDRAWAL FORM:

Private Sub Command1_Click()If (Text1.Text = "" Or Text2.Text = "") ThenMsgBox "Please enter account number and amount"Text1.SetFocusExit SubEnd IfAdodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) <> Val(Text1.Text)) ThenAdodc1.Recordset.MoveNextElse

Page 6: BANKING SYSTEM MINI PROJECT.doc

GoTo lab1End IfWendIf (Adodc1.Recordset.EOF = True) ThenMsgBox "Account not found"End If

lab1:If (Option2.Value = True) ThenIf (Text3.Text = "") ThenMsgBox "Please enter destination account number correctly"Exit SubEnd IfAdodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) = Val(Text3.Text)) ThenGoTo lab2ElseAdodc1.Recordset.MoveNextEnd IfWendIf (Adodc1.Recordset.EOF = True) ThenMsgBox "Destination Account not found"End IfElseIf (Option1.Value = True) ThenGoTo lab4ElseMsgBox "choose withdrawal type"Exit SubEnd If

lab2:Adodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) = Val(Text3.Text)) ThenGoTo lab21ElseAdodc1.Recordset.MoveNextEnd IfWendIf (Adodc1.Recordset.EOF = True) ThenUnload MeExit SubEnd If

Page 7: BANKING SYSTEM MINI PROJECT.doc

lab21:If (Adodc1.Recordset.Fields(0) <> Val(Text3.Text)) ThenUnload MeElseAdodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) + Val(Text2.Text)End IfIf Adodc1.Recordset.Fields(2) < 1000 ThenGoTo minElseAdodc1.Recordset.UpdateAdodc1.RefreshEnd IfAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) <> Val(Text1.Text)) ThenAdodc1.Recordset.MoveNextElseGoTo lab42End IfWendAdodc1.RefreshExit Sub

lab4:Adodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) <> Val(Text1.Text)) ThenAdodc1.Recordset.MoveNextElseGoTo lab41End IfWend

lab41:If (Adodc1.Recordset.Fields(0) = Val(Text1.Text)) ThenAdodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) - Val(Text2.Text)If Adodc1.Recordset.Fields(2) < 1000 ThenGoTo minElseAdodc1.Recordset.UpdateMsgBox "Please collect your cash"Adodc1.RefreshEnd IfEnd IfExit Sub

Page 8: BANKING SYSTEM MINI PROJECT.doc

min:MsgBox "Minimum balance reached - Re enter amount"Text2.Text = ""Text2.SetFocusExit Sub

lab42:If (Adodc1.Recordset.Fields(0) = Val(Text1.Text)) ThenAdodc1.Recordset.Fields(2) = Adodc1.Recordset.Fields(2) - Val(Text2.Text)If Adodc1.Recordset.Fields(2) < 1000 ThenGoTo minElseAdodc1.Recordset.UpdateMsgBox "amount transferred"Adodc1.RefreshEnd IfEnd IfExit Sub

l:Text1.Text = ""Text2.Text = ""Text3.Text = ""Exit Sub

End Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuclear_Click()Text1.Text = ""Text2.Text = ""Text3.Text = ""Option1.Value = FalseOption2.Value = FalseEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form2.Show Unload Me End Sub

Page 9: BANKING SYSTEM MINI PROJECT.doc

VIEW BALANCE FORM

Private Sub Command1_Click()Adodc1.RefreshWhile Not (Adodc1.Recordset.EOF = True)If (Adodc1.Recordset.Fields(0) <> Val(Text1.Text)) ThenAdodc1.Recordset.MoveNextElseGoTo dispEnd IfWendIf (Adodc1.Recordset.EOF = True) ThenMsgBox "account not found"Text1.SetFocusExit SubEnd If

disp:Dim s1%s1 = Adodc1.Recordset.Fields(2)MsgBox "your balance is " & s1Exit Sub

End Sub

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuclear_Click()Text1.Text = ""End Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form2.ShowUnload MeEnd Sub

ADD RECORD FORM:

Private Sub Command1_Click()If (Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "") Then

Page 10: BANKING SYSTEM MINI PROJECT.doc

MsgBox "Enter all details correctly"ElseIf (Option1.Value = False And Option2.Value = False) ThenMsgBox "select account type"Exit SubElseGoTo lab1End IfExit Sub

lab1:Adodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not Adodc1.Recordset.EOF = TrueIf Adodc1.Recordset.Fields(0) = Val(Text1.Text) ThenMsgBox "record already exists"Adodc1.RefreshExit SubElseAdodc1.Recordset.MoveNextEnd IfWendAdodc1.Recordset.MoveLastAdodc1.Recordset.AddNewAdodc1.Recordset.Fields(0) = Val(Text1.Text)Adodc1.Recordset.Fields(1) = Text2.TextAdodc1.Recordset.Fields(2) = Val(Text4.Text)If Option1.Value = True ThenAdodc1.Recordset.Fields(3) = "sb"ElseAdodc1.Recordset.Fields(3) = "ca"End IfAdodc1.Recordset.UpdateMsgBox "new record inserted"Adodc1.RefreshEnd IfEnd Sub

Private Sub Command2_Click()Adodc1.RefreshText1.Text = ""Text2.Text = ""Option1.Value = FalseOption2.Value = FalseText4.Text = ""End Sub

Page 11: BANKING SYSTEM MINI PROJECT.doc

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuclear_Click()Text1.Text = ""Text2.Text = ""Text4.Text = ""Option1.Value = FalseOption2.Value = FalseEnd Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form3.ShowUnload MeEnd Sub

DELETE RECORD FORM:

Private Sub Command1_Click()Adodc1.RefreshAdodc1.Recordset.MoveFirstWhile Not Adodc1.Recordset.EOF = TrueIf Adodc1.Recordset.Fields(0) = Val(Text1.Text) ThenGoTo lab1ElseAdodc1.Recordset.MoveNextEnd IfWendMsgBox "account not found"Adodc1.RefreshExit Sublab1:Adodc1.Recordset.DeleteAdodc1.Recordset.UpdateAdodc1.RefreshMsgBox "record deleted"Adodc1.RefreshExit SubEnd Sub

Page 12: BANKING SYSTEM MINI PROJECT.doc

Private Sub mnuabout_Click()MsgBox "Computerised Banking system version 1.0.0", vbInformationEnd Sub

Private Sub mnuclear_Click()Text1.Text = ""End Sub

Private Sub mnuexit_Click()Unload MeEnd Sub

Private Sub mnuhome_Click()Form3.ShowUnload MeEnd Sub