📄 frmborrowedit.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form FrmBorrowEdit
BorderStyle = 1 'Fixed Single
Caption = "编辑图书借阅信息"
ClientHeight = 4455
ClientLeft = 45
ClientTop = 330
ClientWidth = 6735
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4455
ScaleWidth = 6735
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Lost
Caption = "图书挂失"
Height = 400
Left = 4697
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 11
Top = 3240
Width = 1300
End
Begin VB.CommandButton Cmd_GoOn
Caption = "图书续借"
Height = 400
Left = 737
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 9
Top = 3240
Width = 1300
End
Begin VB.CommandButton Cmd_Return
Caption = "图书归还"
Height = 400
Left = 2717
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 8
Top = 3240
Width = 1300
End
Begin VB.CommandButton Cmd_OK
Caption = "确 定"
Default = -1 'True
Height = 400
Left = 1517
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 0
Top = 3960
Width = 1300
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取 消"
Height = 400
Left = 3917
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 1
Top = 3960
Width = 1300
End
Begin MSAdodcLib.Adodc AdoCardNo
Height = 375
Left = 0
Top = 3960
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=BookSys"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "BookSys"
OtherAttributes = ""
UserName = "bookman"
Password = "bookman"
RecordSource = "select cardno from cards where Flag=0"
Caption = "AdoCardNo"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Frame Frame1
Height = 3735
Left = 120
TabIndex = 2
Top = 120
Width = 6495
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "FrmBorrowEdit.frx":0000
Height = 330
Left = 1320
TabIndex = 7
Top = 765
Width = 4575
_ExtentX = 8070
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "CARDNO"
Text = "DataCombo1"
End
Begin VB.ComboBox ComboInDate
Height = 300
Left = 1320
TabIndex = 6
Text = "Combo1"
Top = 1380
Width = 4575
End
Begin VB.Label lbl_Forfeit
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "0 元"
Height = 180
Left = 1320
TabIndex = 17
Top = 2520
Width = 360
End
Begin VB.Label lbl_RRdate
Height = 270
Left = 4440
TabIndex = 16
Top = 1995
Width = 1695
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "实际归还日期"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 3185
TabIndex = 15
Top = 1995
Width = 1080
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "应归还日期"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 14
Top = 1995
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "罚款金额"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 13
Top = 2520
Width = 720
End
Begin VB.Label lbl_RDate
Height = 270
Left = 1320
TabIndex = 12
Top = 1995
Width = 1695
End
Begin VB.Label lbl_BookNo
Caption = "BookNo"
Height = 255
Left = 1320
TabIndex = 10
Top = 263
Width = 2415
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "借阅证编号"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 5
Top = 840
Width = 900
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "书 号"
Height = 225
Left = 240
TabIndex = 4
Top = 278
Width = 720
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "借出日期"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 240
TabIndex = 3
Top = 1440
Width = 720
End
End
End
Attribute VB_Name = "FrmBorrowEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Modify As Boolean '插入=false,修改=true
Public OriId As Integer
Public BFlag As Integer
Private Sub Cmd_Cancel_Click()
BFlag = 0
Unload Me
End Sub
Private Sub Cmd_GoOn_Click()
'图书续借,将应归还日期加1月
lbl_RDate.Caption = Str(DateAdd("m", 1, DateValue(lbl_RDate.Caption)))
'保存图书借阅信息
With MyBorrow
.Cardno = MakeStr(DataCombo1.Text)
.Bdate = MakeStr(ComboInDate.Text)
.Rdate = MakeStr(lbl_RDate.Caption)
.RRdate = "--"
.Update (OriId)
End With
'更新图书借阅标记
Call MyBorrow.UpdateFlag(OriId, 1)
BFlag = 0
Unload Me
End Sub
Private Sub Cmd_Lost_Click()
Dim strVal
'要求用户输入图书挂失罚款
strVal = InputBox("请输入罚款金额", "图书挂失罚款", "0")
'图书挂失罚款记录及日期更新
Call MyBorrow.UpdateLost(OriId, Val(strVal))
Unload Me
End Sub
Private Sub Cmd_OK_Click()
'检查用户录入数据的有效性
If Len(Trim(DataCombo1)) = 0 Then
MsgBox "请输入借阅证编号"
DataCombo1.SetFocus
DataCombo1.SelStart = 0
DataCombo1.SelLength = Len(DataCombo1)
Exit Sub
End If
If Len(Trim(ComboInDate)) = 0 Then
MsgBox "请输入借出日期"
ComboInDate.SetFocus
ComboInDate.SelStart = 0
ComboInDate.SelLength = Len(ComboInDate)
Exit Sub
End If
'把用户录入的数据赋值到数据库对象变量中
With MyBorrow
.BookNo = MakeStr(lbl_BookNo.Caption)
.Cardno = MakeStr(DataCombo1.Text)
.Bdate = MakeStr(ComboInDate.Text)
.Rdate = MakeStr(lbl_RDate.Caption)
.RRdate = MakeStr(lbl_RRdate.Caption)
'根据变量Modify的值,决定是插入新数据,还是修改已有的数据
If Modify = False Then
.Insert
Call MyBookInfo.UpdateStoreNum(.BookNo, -1)
Else
Call .Update(OriId)
End If
End With
BFlag = 0
'关闭窗口
Unload Me
End Sub
Private Sub ComboInDate_GotFocus()
'把焦点转移到下一个控件,否则会反复调用此过程
Cmd_OK.SetFocus
'设置FrmDateSel窗体的初始日期
If ComboInDate.Text <> "" Then
FrmDateSel.OriDate = ComboInDate.Text
Else
FrmDateSel.OriDate = ""
End If
FrmDateSel.Left = Me.Left + ComboInDate.Left
FrmDateSel.Top = Me.Top + ComboInDate.Top + ComboInDate.Height - FrmDateSel.Height
'启动选择日期窗体
FrmDateSel.Show 1
'设置返回的日期
ComboInDate.Text = FrmDateSel.OriDate
'应归还日期为借出日期加上3个月
lbl_RDate.Caption = Str(DateAdd("m", 3, DateValue(ComboInDate.Text)))
End Sub
Private Sub Cmd_Return_Click()
'设置归还日期
lbl_RRdate.Caption = Date
'更新图书的库存数量
Call MyBookInfo.UpdateStoreNum(MakeStr(lbl_BookNo.Caption), 1)
'设置图书归还标记
Call MyBorrow.UpdateReturn(OriId)
BFlag = 0
Unload Me
End Sub
Private Sub Form_Load()
If BFlag = 0 Then '借阅
Cmd_GoOn.Enabled = True
Cmd_Return.Enabled = True
Cmd_Lost.Enabled = True
Else
Cmd_OK.Enabled = False
DataCombo1.Enabled = False
ComboInDate.Enabled = False
If BFlag = 1 Then '续借
Cmd_GoOn.Enabled = False
Cmd_Return.Enabled = True
Cmd_Lost.Enabled = True
ElseIf BFlag = 2 Then '归还
Cmd_GoOn.Enabled = False
Cmd_Return.Enabled = False
Cmd_Lost.Enabled = False
ElseIf BFlag = 3 Then '挂失
Cmd_GoOn.Enabled = False
Cmd_Return.Enabled = False
Cmd_Lost.Enabled = False
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -