?? admini.frm
字號(hào):
Caption = "還書"
Begin VB.Menu nor
Caption = "普通"
Shortcut = ^L
End
Begin VB.Menu accTime
Caption = "逾期"
Shortcut = ^O
End
End
Begin VB.Menu line2
Caption = "-"
End
Begin VB.Menu backup
Caption = "數(shù)據(jù)備份"
End
Begin VB.Menu deleteBac
Caption = "刪除備份"
End
Begin VB.Menu line1
Caption = "-"
End
Begin VB.Menu exit
Caption = "退出"
Shortcut = ^X
End
End
Begin VB.Menu admin
Caption = "數(shù)據(jù)管理(D)"
Begin VB.Menu read
Caption = "借閱管理"
Shortcut = ^D
End
Begin VB.Menu sno
Caption = "學(xué)號(hào)管理"
Shortcut = ^E
End
Begin VB.Menu sb
Caption = "書號(hào)管理"
Shortcut = ^F
End
End
Begin VB.Menu search
Caption = "數(shù)據(jù)查詢(S)"
Begin VB.Menu info
Caption = "借閱情況"
End
Begin VB.Menu book
Caption = "書庫(kù)查詢"
End
Begin VB.Menu name
Caption = "學(xué)號(hào)查詢"
End
End
Begin VB.Menu set
Caption = "系統(tǒng)設(shè)置(T)"
Begin VB.Menu bg
Caption = "背景"
End
Begin VB.Menu font
Caption = "字體"
End
Begin VB.Menu Bset
Caption = "系統(tǒng)設(shè)置"
End
End
Begin VB.Menu help
Caption = "系統(tǒng)幫助(H)"
Begin VB.Menu title
Caption = "主題"
Shortcut = {F1}
End
Begin VB.Menu about
Caption = "關(guān)于"
Shortcut = ^A
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-------------------------------------------------------------------'
'---本程序付新海版權(quán)所有僅供參考,并可自由使用,請(qǐng)勿用于商業(yè)用途。----'
'------學(xué)號(hào):9735250,E-mail:fxh@astd.com.cn------'
'-----------地址:http://www.xhstudio.net-----------------'
'-------------------------------------------------------------------'
'listview1功能介紹:用于顯示(當(dāng)讀者借書/還書時(shí))該讀者已借閱的所有書籍,方便管理員及讀者了解信息
'adodc1功能介紹:與datagrid1綁定,顯示數(shù)據(jù)查詢信息
Private Sub about_Click()
Form3.Show
End Sub
'數(shù)據(jù)查詢的實(shí)現(xiàn)
Private Sub begin_Click()
'對(duì)應(yīng)不同的選項(xiàng)進(jìn)行查詢
On Error GoTo wrong
Dim LibName As String
If combo1.ListIndex = -1 Or Text1.Text = "" Then
MsgBox "你沒有輸入查詢內(nèi)容或選擇查詢項(xiàng)"
Else
a = Text1.Text
Adodc1.CommandType = adCmdText
i = combo1.ListIndex
b = combo1.List(i)
Set DataGrid1.DataSource = Adodc1
Select Case SSTab1.Tab
Case 2
If i <> 6 Then
Adodc1.RecordSource = "select * from libary where " & b & " like '%" & a & "%'" '借閱信息查詢
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from libary "
Adodc1.Refresh
End If
Case 3
If i <> 7 Then
Adodc1.RecordSource = "select * from S_book where " & b & " like '%" & a & "%'" '書籍查詢
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from S_book "
Adodc1.Refresh
End If
Case 4
If i <> 5 Then
Adodc1.RecordSource = "select * from S_no where " & b & " like '%" & a & "%'" '學(xué)號(hào)查詢
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from S_no "
Adodc1.Refresh
End If
End Select
End If
L1.名稱 = "共找到" & Adodc1.Recordset.RecordCount & "條記錄"
Exit Sub
wrong:
MsgBox Err.Description
End Sub
Private Sub book_Click()
SSTab1.Tab = 3
With combo1
.Clear
.Text = "請(qǐng)選擇類別"
.AddItem "名稱", 0
.AddItem "作者", 1
.AddItem "書號(hào)", 2
.AddItem "名稱", 3
.AddItem "出版社", 4
.AddItem "出版時(shí)間", 5
.AddItem "內(nèi)容介紹", 6
.AddItem "所有記錄", 7
End With
Adodc1.Refresh
End Sub
Private Sub Bset_Click()
Sets.Show
End Sub
Private Sub Combo2_Click()
Text1 = Combo2.Text
Combo2.Visible = False
End Sub
Private Sub Combo2_LostFocus()
Combo2.Visible = False
End Sub
Private Sub exit_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
frmSplash.Show
frmSplash.Refresh
Dim a1, a2
a1 = GetSetting("圖書管理V1.0", "系統(tǒng)設(shè)置", "Btime", "Anonymous")
a2 = GetSetting("圖書管理V1.0", "系統(tǒng)設(shè)置", "Ltime", "Anonymous")
If a1 = "Anonymous" Or a2 = "Anonymous" Then
SaveSetting "圖書管理V1.0", "系統(tǒng)設(shè)置", "Btime", 2
SaveSetting "圖書管理v1.0", "系統(tǒng)設(shè)置", "Ltime", 1
SaveSetting "圖書管理v1.0", "系統(tǒng)設(shè)置", "Backup", 1
SaveSetting "圖書管理v1.0", "系統(tǒng)設(shè)置", "Bcheck", 1
End If
begin.Enabled = False
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2 '使窗體居中
ListView1.ColumnHeaderIcons = Me.ImageList1
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "學(xué)號(hào)", ListView1.Width / 7
ListView1.ColumnHeaders.Add , , "書號(hào)", ListView1.Width / 7, , 1
ListView1.ColumnHeaders.Add , , "借書日期", ListView1.Width / 7
ListView1.ColumnHeaders.Add , , "還書日期", ListView1.Width / 7, , 1
ListView1.ColumnHeaders.Add , , "書籍名稱", ListView1.Width / 7
ListView1.ColumnHeaders.Add , , "書籍介紹", ListView1.Width / 7
ListView1.ColumnHeaders.Add , , "目前狀態(tài)", ListView1.Width / 7 '為listview1添加標(biāo)題
If Not Form2.Data1.Recordset.EOF Then
Form2.Data1.Recordset.MoveLast
End If
begin.Picture = ImageList1.ListImages(4).Picture
For i = 1 To 6
DataGrid1.Columns.Add (i) '為了好看,給dbgrid添加標(biāo)題
Next
Call ResizeInit(Me)
End Sub
Private Sub Form_Resize()
Call ResizeForm(Me) '窗體改變時(shí),控件隨之變化
Toolbar1.Top = (Frame1.Height - Toolbar1.Height + 80) / 2
Text1.Height = combo1.Height
combo1.Left = Text1.Left + Text1.Width + 60
combo1.Top = Text1.Top
With begin
.Left = combo1.Left + combo1.Width + 120
.Top = combo1.Top
.Height = combo1.Height
.Width = .Height '窗體改變時(shí),調(diào)整combol1,beigin按鈕的位置,combol1高度保持不變
End With
If Frame1.Top > 200 Then
Toolbar1.Top = Frame1.Top - 150
End If
End Sub
Private Sub Form_Unload(cancel As Integer)
'徹底卸載所有窗體并退出程序
Shutdown (True)
End Sub
'書籍管理
Private Sub info_Click()
SSTab1.Tab = 2
With combo1
.Clear
.Text = "請(qǐng)選擇類別"
.AddItem "學(xué)號(hào)", 0
.AddItem "書號(hào)", 1
.AddItem "書籍名稱", 2
.AddItem "借書日期", 3
.AddItem "還書日期", 4
.AddItem "書籍介紹", 5
.AddItem "所有記錄", 6
End With
Adodc1.Refresh
End Sub
'學(xué)號(hào)管理
Private Sub name_Click()
SSTab1.Tab = 4
With combo1
.Clear
.Text = "請(qǐng)選擇類別"
.AddItem "學(xué)號(hào)", 0
.AddItem "姓名", 1
.AddItem "性別", 2
.AddItem "專業(yè)", 3
.AddItem "學(xué)院", 4
.AddItem "所有記錄", 5
End With
Adodc1.Refresh
End Sub
'還書
Private Sub nor_Click()
SSTab1.Tab = 1
Form2.Command3.Enabled = False
Form2.Caption = "還書"
Form2.Frame1.Caption = "還書"
Form2.Label3.Caption = "書號(hào)"
Form2.Label4.Caption = "確認(rèn)"
Form2.Text9.Visible = False
Form2.Text10.Visible = False
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Bor.Visible = False
Form2.Bak.Visible = True
Form2.Show
End Sub
'借書
Private Sub normal_Click()
SSTab1.Tab = 0
Form2.Text10.Visible = True
Form2.Text9.Visible = True
Form2.Text7.Visible = False
Form2.Text8.Visible = False
Form2.Bor.Visible = True
Form2.Bak.Visible = False
'得到借書日期和還書日期,由于時(shí)間關(guān)系,沒有考慮閏年,及判斷是否有30號(hào)
Dim a1 As Integer
a1 = GetSetting("圖書管理V1.0", "系統(tǒng)設(shè)置", "Btime", "Anonymous")
Form2.Text11.Text = Year(Now()) & "年" & Month(Now()) & "月" & Day(Now()) & "日"
If Month(Now()) > 12 - a1 Then
Form2.Text12.Text = Year(Now()) + 1 & "年" & Month(Now()) + a1 - 12 & "月" & Day(Now()) & "日"
Else
Form2.Text12.Text = Year(Now()) & "年" & Month(Now()) + a1 & "月" & Day(Now()) & "日" '借書
End If
Form2.Show
BorrowFlag = True
End Sub
'書籍管理
Private Sub sb_Click()
sbook.Show
End Sub
'學(xué)號(hào)管理
Private Sub sno_Click()
S_admin.Show
End Sub
'續(xù)借
Private Sub special_Click()
SSTab1.Tab = 1
Form2.Command3.Enabled = False
Form2.Caption = "續(xù)借"
Form2.Frame1.Caption = "續(xù)借"
Form2.Label3.Caption = "書號(hào)"
Form2.Label4.Caption = "確認(rèn)"
Form2.Text9.Visible = False
Form2.Text10.Visible = False
Form2.Text7.Visible = True
Form2.Text8.Visible = True
Form2.Bor.Visible = False
Form2.Bak.Visible = True
Form2.Command2.Visible = True
Form2.Show
Dim a1 As Integer
a1 = GetSetting("圖書管理V1.0", "系統(tǒng)設(shè)置", "Ltime", "Anonymous")
Form2.Text11.Text = Year(Now()) & "年" & Month(Now()) & "月" & Day(Now()) & "日"
If Month(Now()) > 12 - a1 Then
Form2.Text12.Text = Year(Now()) + 1 & "年" & Month(Now()) - 12 + a1 & "月" & Day(Now()) & "日"
Else
Form2.Text12.Text = Year(Now()) & "年" & Month(Now()) + a1 & "月" & Day(Now()) & "日" '續(xù)借
End If
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
Select Case SSTab1.Tab
Case 2
info_Click
'即時(shí)更新adodc1的數(shù)據(jù)
Case 3
book_Click
Case 4
name_Click
End Select
End Sub
Private Sub SSTab1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Select Case SSTab1.Tab
Case 2
combo1.Enabled = True
combo1.Enabled = True
Text1.Enabled = True
begin.Enabled = True
DataGrid1.Visible = True
begin.Picture = ImageList1.ListImages(3).Picture
Case 3
combo1.Enabled = True
combo1.Enabled = True
Text1.Enabled = True
begin.Enabled = True
DataGrid1.Visible = True
begin.Picture = ImageList1.ListImages(3).Picture
Case 4
combo1.Enabled = True
combo1.Enabled = True
Text1.Enabled = True
begin.Enabled = True
DataGrid1.Visible = True
begin.Picture = ImageList1.ListImages(3).Picture
Case 0, 1
combo1.Enabled = False
combo1.Enabled = False
Text1.Enabled = False
begin.Enabled = False
DataGrid1.Visible = False
begin.Picture = ImageList1.ListImages(4).Picture '即時(shí)改變combol1,begin的狀態(tài),當(dāng)切換到查詢時(shí)有效
End Select
End Sub
Private Sub Text1_Click()
If combo1.Text = "性別" Then
With Combo2
.Left = Text1.Left
.Top = Text1.Top + Text1.Height
Combo2.Visible = True
Combo2.SetFocus
End With
End If
End Sub
Private Sub Timer1_Timer()
Unload frmSplash
Timer1.Enabled = False
End Sub
Private Sub title_Click()
Form3.Show
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim a1 As Integer
a1 = GetSetting("圖書管理V1.0", "系統(tǒng)設(shè)置", "Bcheck", "Anonymous") '得到系統(tǒng)設(shè)置信息
Select Case Button.Index
Case 1
If a1 = 1 Then
PopupMenu Me.borrow, vbPopupMenuLeftAlign, Button.Left + 150, Button.Top + Button.Height + 150 '彈出選擇菜單
Else
normal_Click
End If
Case 2
nor_Click
Case 3
If a1 = 1 Then
PopupMenu Me.search, vbPopupMenuLeftAlign, Button.Left + 150, Button.Top + Button.Height + 150 '彈出選擇菜單
End If
Case 4
S_admin.Show
Case 5
sbook.Show
Case 6
Sets.Show
End Select
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -