📄 form17.frm
字号:
VERSION 5.00
Begin VB.Form Form17
BorderStyle = 0 'None
Caption = "取款"
ClientHeight = 8745
ClientLeft = -60
ClientTop = -75
ClientWidth = 9630
LinkTopic = "Form17"
ScaleHeight = 8745
ScaleWidth = 9630
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "返回"
Height = 495
Left = 4200
TabIndex = 11
Top = 4920
Width = 1215
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 2880
TabIndex = 10
Top = 4200
Width = 1575
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 375
Left = 2880
TabIndex = 8
Top = 3600
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "确认"
Height = 495
Left = 2280
TabIndex = 4
Top = 4920
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 315
ItemData = "Form17.frx":0000
Left = 2880
List = "Form17.frx":0010
TabIndex = 3
Text = "请选择"
Top = 1920
Width = 1575
End
Begin VB.TextBox Text1
Height = 495
Left = 2880
TabIndex = 1
Text = "Text1"
Top = 2760
Width = 2295
End
Begin VB.Label Label6
Caption = "共计"
Height = 255
Left = 1800
TabIndex = 9
Top = 4200
Width = 615
End
Begin VB.Label Label5
Caption = "利息"
Height = 255
Left = 1800
TabIndex = 7
Top = 3600
Width = 615
End
Begin VB.Label Label4
Caption = "储蓄类型"
Height = 255
Left = 3960
TabIndex = 6
Top = 840
Width = 1095
End
Begin VB.Label Label3
Caption = "帐户类型"
Height = 255
Left = 1800
TabIndex = 5
Top = 840
Width = 1335
End
Begin VB.Label Label2
Caption = "金额"
Height = 255
Left = 1800
TabIndex = 2
Top = 2880
Width = 615
End
Begin VB.Label Label1
Caption = "币种"
Height = 255
Left = 1800
TabIndex = 0
Top = 1920
Width = 615
End
End
Attribute VB_Name = "Form17"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dead_time As Date
Dim draw_tmie As Date
Dim rate As Double
Private Sub Command1_Click()
If Combo1.Text = "请选择" Then
MsgBox "请选择币种"
ElseIf Text1.Text = "" Then
MsgBox "请输入取款金额"
ElseIf Label3.Caption = "信用卡帐户" Then
cmd.CommandText = "select * from xinxi0504_23_credit_balance where credit_id='" & Trim(account_id) & "' and money_type='" & Trim(Combo1.Text) & "'"
Set rs = cmd.Execute
If rs.EOF = True Then
MsgBox "该币种没有余额"
ElseIf Val(Text1.Text) > Val(rs.Fields("balance")) Then
MsgBox "余额不足"
Text1.Text = ""
Else
cmd.CommandText = "insert into xinxi0504_23_draw_record values('" & Trim(account_id) & "','" & Str(DateTime.Now) & "','" & Trim(account_type) & "','" & Trim(Combo1.Text) & "'," & Val(Text1.Text) & ",'" & employee_id & "')"
cmd.Execute
cmd.CommandText = "update xinxi0504_23_credit_balance set balance=balance-" & Val(Text1.Text) & " where credit_id='" & Trim(account_id) & "' and money_type='" & Trim(Combo1.Text) & "'"
cmd.Execute
MsgBox "取款成功"
End If
ElseIf Label3.Caption = "储蓄帐户" Then
cmd.CommandText = "select * from xinxi0504_23_account where account_id='" & Trim(account_id) & "'"
Set rs = cmd.Execute
dead_time = DateAdd("yyyy", Val(rs.Fields("deadline")), DateValue(rs.Fields("account_create_time")))
Select Case rs.Fields("account_type")
Case "定期"
If draw_time < dead_time Then
MsgBox "未到取款日期,取款日期为dead_time"
Else
cmd.CommandText = "insert into xinxi0504_23_draw_record values('" & Trim(account_id) & "','" & Str(DateTime.Now) & "','" & Trim(account_type) & "','" & Trim(Combo1.Text) & "'," & Val(Text1.Text) & ",'" & employee_id & "')"
cmd.Execute
cmd.CommandText = "delete from xinxi0504_23_account_balance where account_id='" & Trim(account_id) & "'"
cmd.Execute
cmd.CommandText = "delete from xinxi0504_23_account where account_id='" & Trim(account_id) & "'"
cmd.Execute
MsgBox "取款成功"
End If
Case "活期"
cmd.CommandText = "select * from xinxi0504_23_account_balance where credit_id='" & Trim(account_id) & "' and money_type='" & Trim(Combo1.Text) & "'"
Set rs = cmd.Execute
If rs.EOF = True Then
MsgBox "该币种没有余额"
ElseIf Val(Text1.Text) > Val(rs.Fields("balance")) Then
MsgBox "余额不足"
Text1.Text = ""
Else
cmd.CommandText = "insert into xinxi0504_23_draw_record values('" & Trim(account_id) & "','" & Str(DateTime.Now) & "','" & Trim(account_type) & "','" & Trim(Combo1.Text) & "'," & Val(Text1.Text) & ",'" & employee_id & "')"
cmd.Execute
cmd.CommandText = "update xinxi0504_23_account_balance set balance=balance-" & Val(Text1.Text) & " where account_id='" & Trim(account_id) & "' and money_type='" & Trim(Combo1.Text) & "'"
cmd.Execute
MsgBox "取款成功"
End If
End Select
End If
End Sub
Private Sub Command2_Click()
Form16.Show
Unload Form17
End Sub
Private Sub Form_Load()
Combo1.Text = "请选择"
Combo1.Enabled = True
Text1.Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label5.Visible = False
Label6.Visible = False
Text2.Visible = False
Text3.Visible = False
draw_time = DateTime.Date
Label3.Caption = account_type
Set rs = New ADODB.Recordset
cmd.CommandType = adCmdText
If Label3.Caption = "信用卡帐户" Then
Label4.Caption = ""
ElseIf Label3.Caption = "储蓄帐户" Then
cmd.CommandText = "select * from xinxi0504_23_account where account_id='" & Trim(account_id) & "'"
Set rs = cmd.Execute
Label4.Caption = rs.Fields("account_type")
rate = Val(rs.Fields("rate"))
End If
If Label4.Caption = "定期" Then
cmd.CommandText = "select * from xinxi0504_23_account_balance where account_id='" & Trim(account_id) & "'"
Set rs = cmd.Execute
Combo1.Text = rs.Fields("money_type")
Combo1.Enabled = False
Text1.Text = rs.Fields("balance")
Text1.Enabled = False
Label5.Visible = True
Label6.Visible = True
Text2.Visible = True
Text3.Visible = True
Text2.Enabled = False
Text3.Enabled = False
Text2.Text = Str(rate * Val(Text1.Text))
Text3.Text = Str((rate + 1) * Val(Text1.Text))
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -