📄 光盘归还.frm
字号:
Width = 735
End
Begin VB.Label LCheck
Height = 255
Left = 240
TabIndex = 22
Top = 1440
Width = 735
End
Begin VB.Label Label1
Caption = "天"
Height = 255
Left = 2040
TabIndex = 21
Top = 720
Width = 255
End
Begin VB.Label LBreak_money
Caption = "赔偿金额"
Height = 375
Left = 240
TabIndex = 14
Top = 1080
Width = 855
End
Begin VB.Label L违章类型
Caption = "违章类型"
Height = 255
Left = 240
TabIndex = 13
Top = 360
Width = 855
End
Begin VB.Label LOverdays
Caption = "超期天数"
Height = 375
Left = 240
TabIndex = 11
Top = 720
Width = 975
End
End
Begin VB.TextBox Ttotal_foregift
Height = 375
Left = 7080
TabIndex = 9
Top = 4080
Width = 1095
End
Begin VB.TextBox Ttotal_num
Height = 375
Left = 4680
TabIndex = 8
Top = 4080
Width = 1095
End
Begin VB.TextBox TAdminID
Height = 375
Left = 7080
TabIndex = 5
Top = 120
Width = 1455
End
Begin VB.TextBox TTdate
Height = 375
Left = 960
TabIndex = 3
Top = 120
Width = 1575
End
Begin VB.Frame FrameSearch_CD
Caption = "搜索光盘"
Height = 1575
Left = 5760
TabIndex = 0
Top = 720
Width = 3135
Begin VB.CommandButton Com_select
Caption = "搜索"
Enabled = 0 'False
Height = 375
Left = 2280
TabIndex = 18
Top = 960
Width = 615
End
Begin VB.TextBox Tcondition
Height = 375
Left = 1320
TabIndex = 1
Top = 360
Width = 1695
End
Begin VB.Label 条形码
Caption = "条形码:"
Height = 375
Left = 360
TabIndex = 34
Top = 360
Width = 975
End
End
Begin VB.Label 元
Caption = "元"
Height = 375
Left = 8280
TabIndex = 35
Top = 4080
Width = 255
End
Begin VB.Label L押金
Caption = "总押金"
Height = 495
Left = 6360
TabIndex = 7
Top = 4080
Width = 1215
End
Begin VB.Label Ltotal_num
Caption = "总数量"
Height = 375
Left = 3840
TabIndex = 6
Top = 4080
Width = 1095
End
Begin VB.Label LAdminID
Caption = "管理员ID:"
Height = 375
Left = 6000
TabIndex = 4
Top = 120
Width = 975
End
Begin VB.Label LTdate
Caption = "今天日期"
Height = 375
Left = 120
TabIndex = 2
Top = 120
Width = 975
End
End
Attribute VB_Name = "光盘归还"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private cnRecordSet As ADODB.Recordset
Dim boolBreak As Boolean
Dim CDcnt As Integer
Dim Breakmoney As Integer
Dim Totalmoney As Integer
'Dim sqlselect As String
Private Sub Com_confirm_Click()
If OptionY.Value = False Then
If OptionN.Value = False Then
MsgBox "请判断是否为会员", 0 + vbInformation, "Warning"
Exit Sub
End If
End If
If OptionY.Value = True Then
Dim sql As String
sql = "select * from Member_Basic_Info where Card_ID ='" + TMem_ID.Text + "'" ' and Password = " + TMem_password.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then ''如果不存在用户,则没有记录
MsgBox "会员编号不存在!", 0 + vbInformation, "Warning"
TMem_ID.Text = ""
TMem_password.Text = ""
Exit Sub
End If
sql = sql + "and Password = " + " '" + TMem_password.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then
MsgBox "密码错误!", 0 + vbInformation, "Warning"
TMem_password.Text = ""
Exit Sub
End If
sql = " select * from Member_dynamic_Info where Card_ID = '" + TMem_ID.Text + "' and Mem_type = '" + Combo_Mem_type.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then
MsgBox "会员类型错误!", 0 + vbInformation, "Warning"
Combo_Mem_type.Text = ""
Exit Sub
End If
MsgBox "登陆成功!", vbOKOnly + vbExclamation, "ok"
End If
If OptionN.Value = True Then
TMem_ID.Enabled = False
TMem_password.Enabled = False
End If
Com_select.Enabled = True
End Sub
Private Sub Com_goon_Click()
Com_select.Enabled = True
End Sub
Private Sub Com_select_Click()
Dim sqlselect As String
If Tcondition.Text = "" Then
MsgBox "搜索内容不能为空!", 0 + vbInformation, "Warning"
Exit Sub
End If
sqlselect = "Execute Select_Bar_code '%" + Tcondition.Text + "%'"
Adodc1.RecordSource = sqlselect
Adodc1.Refresh
If Adodc1.Recordset.EOF = True Then
MsgBox "查询无纪录或者此盘没有在租借记录中!"
Exit Sub
End If
If Adodc1.Recordset.EOF = False Then
CDcnt = CDcnt + 1
Totalmoney = Totalmoney + Adodc1.Recordset.Fields(5)
Ttotal_num.Text = CDcnt
Ttotal_foregift.Text = Totalmoney
If Adodc1.Recordset.Fields(4) < Date Then
MsgBox "此碟超期了"
TOverdays.Text = CInt(Date - Adodc1.Recordset.Fields(4))
boolBreak = True
Combo_Break_type.Text = "超期"
End If
End If
Command_Return.Enabled = True
Com_select.Enabled = False
Command_deal.Enabled = True
End Sub
Private Sub Command_deal_Click()
Dim sqlinsert As String
Dim sqlupdate As String
Dim sqlprice As String
Dim sqlagio As String
Dim CD_price As Integer
Dim Break_agio As Double
If Combo_Break_type.Text = "" Then
MsgBox "违章类型不能为空!", vbOKOnly + vbExclamation, "Warning"
Exit Sub
End If
If boolBreak = False Then
If Combo_Break_type.Text = "损坏或丢失" Then
sqlprice = " select CD_money from CD_inInfo where Bar_code = '" + Adodc1.Recordset.Fields(0) + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlprice)
CD_price = cnRecordSet.Fields(0).Value
sqlagio = "select Break_agio from Memgrade_Info where Mem_type = '" + Combo_Mem_type.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlagio)
Break_agio = cnRecordSet.Fields(0).Value
TBreak_money.Text = CD_price * Break_agio
sqlupdate = "update Member_dynamic_Info set Card_money = Card_money - '" + TBreak_money.Text + "' where Card_ID = '" + TMem_ID.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlupdate)
MsgBox "成功处理!", vbOKOnly + vbExclamation, "ok"
sqlinsert = "insert into Break_Info values('" + Adodc1.Recordset.Fields(0) + "'," + "'" + TMem_ID.Text + "','" + TOverdays.Text + "','"
sqlinsert = sqlinsert + Combo_Break_type.Text + "','"
sqlinsert = sqlinsert + TAdminID.Text + "'," + "'" + Combo_Mem_type.Text + "','" + TBreak_money.Text + "')"
Set cnRecordSet = Form1.cnTest.Execute(sqlinsert)
End If
End If
If boolBreak = True Then
If OptionY.Value = True Then
If Combo_Break_type.Text = "超期" Then
sqlupdate = "update Member_dynamic_Info set Overdays = Overdays + '" + TOverdays.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlupdate)
MsgBox "成功处理!", vbOKOnly + vbExclamation, "ok"
End If
If Combo_Break_type.Text = "损坏或丢失" Then
sqlprice = " select CD_money from CD_inInfo where Bar_code = '" + Adodc1.Recordset.Fields(0) + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlprice)
CD_price = cnRecordSet.Fields(0).Value
sqlagio = "select Break_agio from Memgrade_Info where Mem_type = '" + Combo_Mem_type.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlagio)
Break_agio = cnRecordSet.Fields(0).Value
TBreak_money.Text = CD_price * Break_agio
sqlupdate = "update Member_dynamic_Info set Card_money = Card_money - '" + TBreak_money.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlupdate)
MsgBox "成功处理!", vbOKOnly + vbExclamation, "ok"
End If
sqlinsert = "insert into Break_Info values('" + Adodc1.Recordset.Fields(0) + "'," + "'" + TMem_ID.Text + "','" + TOverdays.Text + "','"
sqlinsert = sqlinsert + Combo_Break_type.Text + "','"
sqlinsert = sqlinsert + TAdminID.Text + "'," + "'" + Combo_Mem_type.Text + "','" + TBreak_money.Text + "')"
Set cnRecordSet = Form1.cnTest.Execute(sqlinsert)
End If
If OptionN.Value = True Then
If Combo_Break_type.Text = "超期" Then
TBreak_money.Text = Form1.Borrow_money * TOverdays.Text
End If
If Combo_Break_type.Text = "损坏或丢失" Then
sqlprice = " select CD_money from CD_inInfo where Bar_code = '" + Adodc1.Recordset.Fields(0) + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlprice)
CD_price = cnRecordSet.Fields(0).Value
sqlagio = "select Break_agio from Memgrade_Info where Mem_type = '非会员'"
Set cnRecordSet = Form1.cnTest.Execute(sqlagio)
Break_agio = cnRecordSet.Fields(0).Value
TBreak_money.Text = CD_price * Break_agio
End If
sqlinsert = "insert into Break_Info values('" + Adodc1.Recordset.Fields(0) + "',' ','"
sqlinsert = sqlinsert + TOverdays.Text + "','" + Combo_Break_type.Text + "','"
sqlinsert = sqlinsert + TAdminID.Text + "',' ','" + TBreak_money.Text + "')"
Set cnRecordSet = Form1.cnTest.Execute(sqlinsert)
MsgBox "成功处理!", vbOKOnly + vbExclamation, "ok"
End If
End If
'Combo_Break_type.Text = ""
'TBreak_money.Text = ""
End Sub
Private Sub Command_exit_Click()
Unload 光盘归还
TMem_ID.Text = ""
TMem_password.Text = ""
Combo_Mem_type.Text = ""
Tcondition.Text = ""
Ttotal_num.Text = ""
Ttotal_foregift.Text = ""
End Sub
Private Sub Command_Return_Click()
Dim sql As String
Dim sqlupdate As String
Dim sqlsub As String
sql = "execute Have_Return '" + Tcondition.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If Combo_Break_type.Text = "损坏或丢失" Then
sqlupdate = "update CD_Info set CD_state ='损坏或丢失' where Bar_code = '" + Adodc1.Recordset.Fields(0) + "'"
Else
sqlupdate = " Execute Update_state '" + Adodc1.Recordset.Fields(0) + "'"
End If
Set cnRecordSet = Form1.cnTest.Execute(sqlupdate)
sqlsub = "update Member_dynamic_Info set CD_num = CD_num - 1 where Card_ID = '" + TMem_ID.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sqlsub)
'If cnRecordSet.EOF = True Then
'MsgBox "归还失败!", vbOKOnly + vbExclamation, "ok"
'Exit Sub
'End If
MsgBox "归还成功!", vbOKOnly + vbExclamation, "ok"
Combo_Break_type.Text = ""
TBreak_money.Text = ""
Com_goon.Enabled = True
Command_Return.Enabled = False
End Sub
Private Sub Form_Load()
TTdate.Text = Date
TAdminID.Text = Form1.AdminID
End Sub
Private Sub OptionN_Click()
'TMem_ID.Enabled = False
'TMem_password.Enabled = False
'Combo_Mem_type.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -