软件工程银行储蓄管理系统设计2.docx
《软件工程银行储蓄管理系统设计2.docx》由会员分享,可在线阅读,更多相关《软件工程银行储蓄管理系统设计2.docx(19页珍藏版)》请在冰豆网上搜索。
软件工程银行储蓄管理系统设计2
软件实现报告
1.设计目的
该阶段是系统开发过程的最后一个阶段,按照前三个阶段的设计,在这个阶段要选择适当的计算机语言来编写程序以及实现该软件的各项功能,并且对软件设计测试方法。
2.软件源代码如下:
(1)银行储蓄系统
PrivateSubcunkuan0_Click()
UnloadMe
cunkuan.Show
EndSub
PrivateSubdenglu1_Click()
UnloadMe
denglu.Show
EndSub
PrivateSubForm_Load()
Ifflag=0Then
denglu1.Enabled=True
zhukong.Enabled=False
tuichu.Enabled=False
Else
Ifflag=1Then
denglu1.Enabled=False
zhukong.Enabled=True
tuichu.Enabled=True
Else
Ifflag=2Then
denglu1.Enabled=False
zhukong.Enabled=False
tuichu.Enabled=False
Else
End
EndIf
EndIf
EndIf
EndSub
PrivateSubkaihu0_Click()
UnloadMe
kaihu.Show
EndSub
PrivateSubqukuan0_Click()
UnloadMe
qukuan.Show
EndSub
PrivateSubtuichu_Click()
flag=0
UnloadMe
kaishi.Show
EndSub
PrivateSubxiaohu0_Click()
UnloadMe
xiaohu.Show
EndSub
PrivateSubxingaimima0_Click()
UnloadMe
xiugaimima.Show
EndSub
PrivateSubzhaxun0_Click()
UnloadMe
chaxun.Show
EndSub
PrivateSubzhuanzhang0_Click()
UnloadMe
zhuanzhang.Show
EndSub
(2)查询
PrivateSubCommand1_Click()
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxiwherezhanghao='"&Text1.Text&"'",con,adOpenKeyset,adLockOptimistic
Ifrst.BOFAndrst.EOFThen
MsgBox"此用户不存在!
"
Else
IfText2.Text=rst!
mimaThen
chaxunyue.Text1.Text=Text1.Text
UnloadMe
chaxunyue.Show
EndIf
EndIf
rst.Close
con.Close
EndSub
PrivateSubCommand2_Click()
flag=1
UnloadMe
kaishi.Show
EndSub
(3)查询余额
PrivateSubCommand1_Click()
cunqukuanrili.Text1.Text=Text1.Text
UnloadMe
cunqukuanrili.Show
EndSub
PrivateSubCommand2_Click()
yonghuxinxi.Text1.Text=Text1.Text
UnloadMe
yonghuxinxi.Show
EndSub
PrivateSubCommand3_Click()
flag=1
UnloadMe
kaishi.Show
EndSub
(4)登录
PrivateSubCommand1_Click()
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromyonghuxixin",con,adOpenKeyset,adLockOptimistic
Ifrst.BOFAndrst.EOFThen
IfText1(0).Text="gyn"AndText2
(1).Text="000"Then
flag=1
UnloadMe
kaishi.Show
Else
MsgBox"输入不正确!
"
EndIf
Else
DoWhileNotrst.EOF
Ifrst!
yonghudaihao=Text1(0).TextThen
Ifrst!
mima=Text2
(1).TextThen
flag=1
UnloadMe
kaishi.Show
EndIf
EndIf
rst.MoveNext
Loop
rst.Close
con.Close
Ifflag=0Then
MsgBox"此用户不存在!
"
EndIf
EndIf
EndSub
PrivateSubCommand2_Click()
flag=0
UnloadMe
kaishi.Show
EndSub
(5)开户
PrivateSubCommand1_Click()
IfText1.Text=""Then
MsgBox"姓名不能为空"
Text1.SetFocus
EndIf
IfText4.Text=""Then
MsgBox"身份证号码不能为空"
Text4.SetFocus
EndIf
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromyonghuxinxi1",con,adOpenKeyset,adLockOptimistic
rst.AddNew
rst!
shenfengzheng=Text4.Text
rst!
xingming=Text1.Text
rst!
xingbie=Text5.Text
rst!
zhuzhi=Text2.Text
rst!
dianhua=Text3.Text
rst.Update
kaihu1.Text2.Text=Text1.Text
kaihu1.Text8.Text=Text5.Text
kaihu1.Text3.Text=Text4.Text
kaihu1.Text4.Text=Text2.Text
kaihu1.Text5.Text=Text3.Text
rst.Close
con.Close
UnloadMe
kaihu1.Show
EndSub
PrivateSubCommand2_Click()
UnloadMe
flag=1
kaishi.Show
EndSub
(6)销户
PrivateSubCommand1_Click()
yonghuxinxi.Text1.Text=Text1.Text
UnloadMe
yonghuxinxi.Show
EndSub
PrivateSubCommand2_Click()
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxi",con,adOpenKeyset,adLockOptimistic
Ifrst.BOFAndrst.EOFThen
MsgBox"无记录,请先插入记录!
"
Else
DoWhileNotrst.EOF
Ifrst!
zhanghao=Text1.TextThen
Ifrst!
mima=Text2.TextThen
rst.Delete
rst.Update
Else
MsgBox"密码不正确!
"
EndIf
EndIf
rst.MoveNext
Loop
Ifrst.EOFThen
MsgBox"此用户不存在!
"
EndIf
rst.Close
con.Close
EndIf
rst.Close
con.Close
EndSub
PrivateSubCommand3_Click()
flag=1
UnloadMe
kaishi.Show
EndSub
(7)修改密码
PrivateSubCommand1_Click()
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxiwherezhanghao='"&Text1.Text&"'",con,adOpenKeyset,adLockOptimistic
Ifrst.BOFAndrst.EOFThen
MsgBox"此用户不存在!
"
Else
IfText2.Text=rst!
mimaThen
xiugaimima1.Text1.Text=Text1.Text
xiugaimima1.Text4.Text=Text2.Text
UnloadMe
xiugaimima1.Show
EndIf
EndIf
rst.Close
con.Close
EndSub
(8)修改密码1
PrivateSubCommand1_Click()
IfText2.Text<>Text3.TextThen
MsgBox"密码不一致!
"
Else
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromyonghuxixinwhereyonghudaihao='"&Text1.Text&"'",con,adOpenKeyset,adLockOptimistic
rst!
mima=Text3.Text
rst.Update
rst.Close
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxiwherezhanghao='"&Text1.Text&"'",con,adOpenKeyset,adLockOptimistic
rst!
mima=Text3.Text
rst.Update
MsgBox"修改成功!
"
rst.Close
con.Close
EndIf
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromcunkuanrili",con,adOpenKeyset,adLockOptimistic
rst.AddNew
rst!
zhanghao=Text1.Text
DimnowtimeAsString
nowtime=Now
rst!
caozuoriqi=Format(nowtime,"yyyy")+"-"+Format(nowtime,"mm")+"-"+Format(nowtime,"dd")+"-"+Format(nowtime,"hh")+":
"+Format(nowtime,"nn")+":
"+Format(nowtime,"ss")
rst!
caozuo="修改密码"
rst.Update
rst.Close
con.Close
EndSub
PrivateSubCommand3_Click()
flag=1
UnloadMe
kaishi.Show
EndSub
(9)转账
PrivateSubCommand1_Click()
Setcon=NewADODB.Connection
con.Openconnectstring
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxiwherezhanghao='"&Text3.Text&"'",con,adOpenKeyset,adLockOptimistic
Ifrst.BOFAndrst.EOFThen
MsgBox"此用户不存在!
"
Else
IfText4.Text=rst!
mimaThen
rst!
zhanghuyue=CInt(rst!
zhanghuyue)-CInt(Text2.Text)
rst.Update
rst.Close
Setrst=NewADODB.Recordset
rst.Open"select*fromzhanghaoxinxiwherezhanghao='"&Text1.Text&"'",con,adOpenKeyset,adLockOptimistic
IfCInt(Text2.Text)>rst!
zhanghuyueThen
MsgBox"余额不足!
"
Else
rst!
zhanghuyue=CInt(rst!
zhanghuyue)+CInt(Text2.Text)
rst.Update
rst.Close
con.Close
EndIf
EndIf
EndIf
EndSub
PrivateSubCommand3_Click()
flag=1
UnloadMe
kaishi.Show
EndSub
3.部分界面如下: