📄 frmborrowedit.frm
字号:
VERSION 5.00
Begin VB.Form frmBorrowEdit
BorderStyle = 1 'Fixed Single
Caption = "借阅编辑第一步"
ClientHeight = 3945
ClientLeft = 45
ClientTop = 435
ClientWidth = 8025
Icon = "frmBorrowEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3945
ScaleWidth = 8025
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取 消"
Height = 495
Left = 4560
TabIndex = 8
Top = 3120
Width = 1215
End
Begin VB.CommandButton cmdNext
Caption = "生成信息"
Default = -1 'True
Height = 495
Left = 2040
TabIndex = 7
Top = 3120
Width = 1215
End
Begin VB.Frame frmCard
Caption = "第一步:填写借阅人信息"
Height = 2535
Left = 120
TabIndex = 0
Top = 240
Width = 7695
Begin VB.TextBox txtCNo
Height = 330
Left = 1560
MaxLength = 16
TabIndex = 1
Top = 360
Width = 1935
End
Begin VB.TextBox txtReader
Enabled = 0 'False
Height = 330
Left = 5280
TabIndex = 2
Top = 360
Width = 1935
End
Begin VB.TextBox txtMaxCount
Enabled = 0 'False
Height = 330
Left = 5280
TabIndex = 4
Top = 1080
Width = 1935
End
Begin VB.TextBox txtMaxDays
Enabled = 0 'False
Height = 330
Left = 1560
TabIndex = 5
Top = 1800
Width = 1935
End
Begin VB.TextBox txtTypeName
Enabled = 0 'False
Height = 330
Left = 1560
TabIndex = 3
Top = 1080
Width = 1935
End
Begin VB.TextBox txtBCount
Enabled = 0 'False
Height = 330
Left = 5280
TabIndex = 6
Top = 1800
Width = 1935
End
Begin VB.Label lblCNo
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 = 420
Width = 1080
End
Begin VB.Label lblReader
AutoSize = -1 'True
Caption = "姓 名"
Height = 180
Left = 3960
TabIndex = 13
Top = 420
Width = 1080
End
Begin VB.Label lblMaxCount
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 = 3960
TabIndex = 12
Top = 1140
Width = 1080
End
Begin VB.Label lblMaxDays
AutoSize = -1 'True
Caption = "最多借阅天数"
Height = 180
Left = 240
TabIndex = 11
Top = 1860
Width = 1080
End
Begin VB.Label lblTypeName
AutoSize = -1 'True
Caption = "类 型"
Height = 180
Left = 240
TabIndex = 10
Top = 1140
Width = 1080
End
Begin VB.Label lblBCount
AutoSize = -1 'True
Caption = "已经借阅数量"
Height = 180
Left = 3960
TabIndex = 9
Top = 1860
Width = 1080
End
End
End
Attribute VB_Name = "frmBorrowEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'生成信息(及下一步)按钮
Private Sub cmdNext_Click()
'===========生成信息===============
If cmdNext.Caption = "生成信息" Then
'判断框的有效性
If Trim(txtCNo.Text) = "" Then
MsgBox "输入的借阅证号为空", vbInformation, "信息提示"
txtCNo.SetFocus
Exit Sub
End If
'判断是否存在此借阅证号
If Not objCardInfo.IsExistCNo(txtCNo.Text) Then
MsgBox "无此借阅证号,请输入正确的借阅证号", vbInformation, "信息提示"
txtCNo.SetFocus
txtCNo.SelStart = 0
txtCNo.SelLength = Len(txtCNo.Text)
Exit Sub
End If
'确认此借阅证号为正确的
If MsgBox("此借阅证号是否为所需的" + vbCrLf _
+ "生成其他信息后,借阅证号将不能被修改", vbQuestion + vbYesNo _
+ vbDefaultButton1, "询问") = vbNo Then
Exit Sub
End If
'对控件属性进行修改
txtCNo.Enabled = False
objCardInfo.GetInfo txtCNo.Text
txtReader.Text = Trim(objCardInfo.Reader)
objCardInfo.GetInfo txtCNo.Text
txtTypeName.Text = Trim(objCardType.GetTypeName(objCardInfo.CTypeID))
objCardType.GetInfo txtTypeName.Text
txtMaxCount.Text = Trim(Str(objCardType.MaxCount))
txtMaxDays.Text = Trim(Str(objCardType.MaxDays))
txtBCount.Text = Trim(Str(objBorrowInfo.GetCount(txtCNo.Text)))
cmdNext.Caption = "下一步"
'===========下一步=================
Else
'判断此借阅证是否已经借满书籍
If Val(txtBCount.Text) >= Val(txtMaxCount.Text) Then
MsgBox "此借阅证最多只能借阅" + Trim(txtMaxCount.Text) + "本书" + vbCrLf _
+ "不能再借阅其他书籍", vbInformation, "信息提示"
Unload Me
Exit Sub
End If
'给frmBorrowNextEdit填写内容
frmBorrowNextEdit.txtCNo.Text = txtCNo.Text
frmBorrowNextEdit.txtReader.Text = txtReader.Text
frmBorrowNextEdit.txtBorrowDate.Text = Format(Now, "yyyy-mm-dd")
frmBorrowNextEdit.txtReturnDate.Text = Format(Now _
+ Val(txtMaxDays.Text), "yyyy-mm-dd")
frmBorrowNextEdit.txtBNo = ""
frmBorrowNextEdit.txtBName = ""
frmBorrowNextEdit.txtAuthor = ""
frmBorrowNextEdit.txtPublisher = ""
frmBorrowNextEdit.txtPrice = ""
frmBorrowNextEdit.txtTypeName = ""
Me.Visible = False
frmBorrowNextEdit.Show 1
Unload Me
End If
End Sub
'取消按钮
Private Sub cmdCancel_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -