?? frmreturnedit.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FrmReturnEdit
BorderStyle = 1 'Fixed Single
Caption = "編輯圖書歸還信息"
ClientHeight = 5175
ClientLeft = 45
ClientTop = 330
ClientWidth = 9660
Icon = "FrmReturnEdit.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5175
ScaleWidth = 9660
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Cmd_Lost
Caption = "丟 失"
Height = 375
Left = 5160
TabIndex = 18
Top = 4560
Width = 1215
End
Begin VB.CommandButton Cmd_GoOn
Caption = "續(xù) 借"
Height = 375
Left = 3000
TabIndex = 17
Top = 4560
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 7680
Top = 1440
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
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.CommandButton Cmd_Return
Caption = "歸 還"
Height = 375
Left = 840
TabIndex = 16
Top = 4560
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmReturnEdit.frx":0442
Height = 2775
Left = 120
TabIndex = 15
Top = 1560
Width = 9375
_ExtentX = 16536
_ExtentY = 4895
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Frame Frame3
Caption = "借閱人信息"
Height = 1335
Left = 120
TabIndex = 1
Top = 120
Width = 9375
Begin VB.TextBox txtAddDays
Enabled = 0 'False
Height = 330
Left = 5760
TabIndex = 19
Top = 825
Width = 615
End
Begin VB.TextBox txtBCount
Enabled = 0 'False
Height = 330
Left = 8520
TabIndex = 14
Top = 825
Width = 615
End
Begin VB.TextBox txtCardType
Enabled = 0 'False
Height = 330
Left = 7440
TabIndex = 12
Top = 360
Width = 1095
End
Begin VB.TextBox txtMaxDays
Enabled = 0 'False
Height = 330
Left = 3480
TabIndex = 10
Top = 825
Width = 615
End
Begin VB.TextBox txtMaxCount
Enabled = 0 'False
Height = 330
Left = 1320
TabIndex = 8
Top = 825
Width = 615
End
Begin VB.TextBox txtName
Enabled = 0 'False
Height = 330
Left = 4440
TabIndex = 6
Top = 360
Width = 1095
End
Begin VB.CommandButton Cmd_SchCard
Caption = "查 找"
Height = 375
Left = 2600
TabIndex = 4
Top = 360
Width = 855
End
Begin VB.TextBox txtCardNo
Height = 330
Left = 1320
TabIndex = 3
Top = 360
Width = 1095
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "最多續(xù)借天數(shù)"
Height = 180
Left = 4440
TabIndex = 20
Top = 900
Width = 1080
End
Begin VB.Label Label14
AutoSize = -1 'True
Caption = "已經(jīng)借閱數(shù)量"
Height = 180
Left = 7080
TabIndex = 13
Top = 900
Width = 1080
End
Begin VB.Label Label13
AutoSize = -1 'True
Caption = "類型"
Height = 180
Left = 6840
TabIndex = 11
Top = 420
Width = 360
End
Begin VB.Label Label12
AutoSize = -1 'True
Caption = "最多借閱天數(shù)"
Height = 180
Left = 2280
TabIndex = 9
Top = 900
Width = 1080
End
Begin VB.Label Label11
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "最大借閱數(shù)量"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Left = 120
TabIndex = 7
Top = 900
Width = 1080
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "姓名"
Height = 180
Left = 3960
TabIndex = 5
Top = 420
Width = 360
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 = 120
TabIndex = 2
Top = 420
Width = 900
End
End
Begin VB.CommandButton Cmd_Exit
Cancel = -1 'True
Caption = "返 回"
Height = 400
Left = 7320
MousePointer = 99 'Custom
Style = 1 'Graphical
TabIndex = 0
Top = 4560
Width = 1300
End
End
Attribute VB_Name = "FrmReturnEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Exit_Click()
Unload Me
End Sub
'圖書續(xù)借
Private Sub Cmd_GoOn_Click()
'使用Adodc1.Recordset.EOF判斷當前是否選擇了記錄
If Adodc1.Recordset.EOF = True Then
MsgBox "請選擇記錄"
Exit Sub
End If
'初始化FrmReturnDetail窗體
FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0) '編號
FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
FrmReturnDetail.txtGDate = Date
'最大續(xù)借天數(shù)
FrmReturnDetail.nAddDays = Val(txtAddDays)
'圖書續(xù)借應(yīng)歸還日期為續(xù)借日期加上允許的最大續(xù)借天數(shù)
FrmReturnDetail.txtReturnDate = CStr(DateAdd("d", Val(txtAddDays), Date))
FrmReturnDetail.txtRRDate = ""
FrmReturnDetail.txtForfeit = 0
FrmReturnDetail.cob_Status.Text = "續(xù)借"
FrmReturnDetail.Show 1
GridRefresh
End Sub
Private Sub Cmd_Lost_Click()
'使用Adodc1.Recordset.EOF判斷當前是否選擇了記錄
If Adodc1.Recordset.EOF = True Then
MsgBox "請選擇記錄"
Exit Sub
End If
'初始化FrmReturnDetail窗體
FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0) '編號
FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
FrmReturnDetail.txtReturnDate = Adodc1.Recordset.Fields(4)
FrmReturnDetail.txtGDate = ""
FrmReturnDetail.txtRRDate = Date
FrmReturnDetail.txtForfeit = 0
FrmReturnDetail.cob_Status.Text = "丟失"
FrmReturnDetail.Show 1
'更改借閱數(shù)量
If FrmReturnDetail.ClickOK Then
txtBCount = Val(txtBCount) - 1
End If
GridRefresh
End Sub
Private Sub Cmd_Return_Click()
'使用Adodc1.Recordset.EOF判斷當前是否選擇了記錄
If Adodc1.Recordset.EOF = True Then
MsgBox "請選擇記錄"
Exit Sub
End If
'初始化FrmReturnDetail窗體
FrmReturnDetail.OriId = Adodc1.Recordset.Fields(0) '編號
FrmReturnDetail.txtBookNo = Adodc1.Recordset.Fields(1)
FrmReturnDetail.txtBookName = Adodc1.Recordset.Fields(2)
FrmReturnDetail.txtReturnDate = Adodc1.Recordset.Fields(4)
FrmReturnDetail.txtGDate = ""
FrmReturnDetail.txtRRDate = Date
FrmReturnDetail.txtForfeit = 0
FrmReturnDetail.cob_Status.Text = "歸還"
FrmReturnDetail.Show 1
'更改借閱數(shù)量
If FrmReturnDetail.ClickOK Then
txtBCount = Val(txtBCount) - 1
End If
GridRefresh
End Sub
Private Sub Cmd_SchCard_Click()
'根據(jù)輸入的借閱證號查找相關(guān)信息
If Len(Trim(txtCardNo)) = 0 Then
MsgBox ("請輸入借閱證號")
txtCardNo.SetFocus
Exit Sub
End If
'判斷此借閱證號是否存在
If MyCards.GetInfo(Trim(txtCardNo)) = False Then
MsgBox ("沒有這個借閱證號,請重新輸入")
txtCardNo.SetFocus
Exit Sub
Else
txtName = MyCards.Name
'根據(jù)類型查找類型信息
If MyCardType.GetInfo(MyCards.TypeId) = True Then
txtCardType = MyCardType.TypeName
txtMaxCount = MyCardType.MaxCount
txtMaxDays = MyCardType.MaxDays
txtAddDays = MyCardType.AddDays
Else
MsgBox ("此借閱證的類型已經(jīng)不存在,請重新輸入")
Exit Sub
End If
'在借閱記錄中查找該借閱證借閱數(shù)量
txtBCount = MyBorrowList.GetBorrowCount(Trim(txtCardNo))
End If
GridRefresh
End Sub
Private Sub Form_Load()
GridRefresh
End Sub
Private Sub GridRefresh()
'設(shè)置ADO控件的連接字符串
Adodc1.ConnectionString = conn
'設(shè)置數(shù)據(jù)源
Adodc1.RecordSource = "SELECT l.Id AS 編號,l.BookNo AS 圖書編號,b.BookName AS 圖書名稱," _
+ "l.BorrowCount AS 借閱數(shù)量,l.ReturnDate AS 應(yīng)歸還日期,l.GDate AS 續(xù)借日期," _
+ "l.RealReturnDate AS 實際歸還日期,l.Forfeit AS 罰金,l.Status AS 狀態(tài)" _
+ " FROM BorrowList l,BookInfo b,Borrow w " _
+ " WHERE l.BookNo=b.BookNo AND w.CardNo='" + Trim(txtCardNo) + "' AND " _
+ "w.BorrowNo=l.BorrowNo AND l.Status NOT IN ('丟失','歸還')"
Adodc1.Refresh
DataGrid1.Columns(0).Width = 800
DataGrid1.Columns(1).Width = 1200
DataGrid1.Columns(2).Width = 1400
DataGrid1.Columns(3).Width = 1200
DataGrid1.Columns(4).Width = 1200
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -