📄 frmcangguanmain.frm
字号:
End
Begin VB.Menu line
Caption = "-"
End
Begin VB.Menu MCGS_HYGL
Caption = "会员管理"
End
End
Begin VB.Menu MCG_Help
Caption = "系统帮助(&H)"
Begin VB.Menu MCGH_about
Caption = "关于宛枫书社图书管理系统... "
End
Begin VB.Menu MCGH_hlp
Caption = "帮助"
Shortcut = {F1}
End
Begin VB.Menu MCGH_line
Caption = "-"
End
Begin VB.Menu MCGH_webHlp
Caption = "联机帮助"
End
End
End
Attribute VB_Name = "FrmCangGuanMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub searchBook(keyWords As String, fenLei As String)
Dim strSQL As String
SSTabGuest.Tab = 1
If keyWords = "" Then
MsgBox "请输入检索的关键词!", vbOKOnly + vbExclamation, "图书检索"
TxtKeyWords_Click
Exit Sub
End If
If fenLei = "" Or fenLei = "选择分类" Then
MsgBox "请输入检索的依据!", vbOKOnly + vbExclamation, "图书检索"
ComboLeiBie.SetFocus
Exit Sub
End If
On Error GoTo errEnd
strSQL = "select * from [读者查询] where [" & fenLei & "] like '%" & keyWords & "%'"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strSQL
Adodc1.Refresh
Set DataGrid2.DataSource = Adodc1
DataGrid2.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "没有找到你要的相关记录!", vbOKOnly + vbInformation, "图书检索"
End If
LabResult.Caption = "共找到 " & Adodc1.Recordset.RecordCount & " 条相关记录"
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "检索错误"
End Sub
Private Sub CmdReset_Click()
TxtName.Text = ""
TxtDanWei.Text = ""
TxtDiZhi.Text = ""
TxtEmail.Text = ""
TxtInfo.Text = ""
End Sub
Private Sub CmdSearch_Click()
Dim strSQL As String
If TxtKeyWords.Text = "" Or TxtKeyWords.Text = "关键词" Then
MsgBox "请输入检索的关键词!", vbOKOnly + vbExclamation, "图书检索"
TxtKeyWords_Click
Exit Sub
End If
If ComboLeiBie.Text = "" Or ComboLeiBie.Text = "选择分类" Then
MsgBox "请输入检索的依据!", vbOKOnly + vbExclamation, "图书检索"
ComboLeiBie.SetFocus
Exit Sub
End If
On Error GoTo errEnd
strSQL = "select * from [读者查询] where [" & ComboLeiBie.Text & "] like '%" & TxtKeyWords.Text & "%'"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = strSQL
Adodc1.Refresh
Set DataGrid2.DataSource = Adodc1
DataGrid2.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
MsgBox "没有找到你要的相关记录", vbOKOnly + vbInformation, "图书检索"
End If
LabResult.Caption = "共找到 " & Adodc1.Recordset.RecordCount & " 条记录"
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "检索错误"
End Sub
Private Sub CmdSubmit_Click()
On Error GoTo errEnd
If TxtName.Text = "" Then
MsgBox "请输入你的姓名!", vbOKOnly + vbExclamation, "信息反馈"
TxtName.SetFocus
Exit Sub
End If
If TxtDanWei.Text = "" Then
TxtDanWei.Text = "未知"
End If
If TxtDiZhi.Text = "" Then
TxtDiZhi.Text = "未知"
End If
If TxtEmail.Text = "" Then
TxtEmail.Text = "未知"
End If
If TxtInfo.Text = "" Then
MsgBox "请填写反馈信息!", vbOKOnly + vbExclamation, "信息反馈"
TxtInfo.SetFocus
Exit Sub
End If
Adodc1.Recordset.AddNew
Adodc1.Recordset!姓名 = TxtName.Text
Adodc1.Recordset!身份 = UserShenFen
If SexMan.Value Then
Adodc1.Recordset!性别 = "男"
Else
Adodc1.Recordset!性别 = "女"
End If
Adodc1.Recordset!单位 = TxtDanWei.Text
Adodc1.Recordset!地址 = TxtDiZhi.Text
Adodc1.Recordset!电子邮件 = TxtEmail.Text
Adodc1.Recordset!反馈信息 = TxtInfo.Text
Adodc1.Recordset!反馈日期 = Now
Adodc1.Recordset.Update
MsgBox "感谢你的意见或建议!", vbOKOnly + vbInformation, "信息反馈"
Call CmdReset_Click
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "数据库错误"
End Sub
Private Sub ComboDengJi_Click()
If ComboDengJi.Text <> "请选择会员级别" Then
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select * from [会员政策] where [会员级别]=""" & ComboDengJi.Text & """"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc2.Recordset.MoveFirst
ComboJinE.Clear
ComboJinE.Text = Adodc2.Recordset!会员标准 & ""
ComboJinE.AddItem Adodc2.Recordset!会员标准 & ""
ComboDaZhe.Clear
ComboDaZhe.Text = Adodc2.Recordset!打折 & ""
ComboDaZhe.AddItem Adodc2.Recordset!打折 & ""
TxtLiPin.Text = Adodc2.Recordset!赠送礼品 & ""
TxtQT.Text = Adodc2.Recordset!备注 & ""
Else
MsgBox "数据丢失!请与程序员联系!", vbOKOnly + vbExclamation, "数据库错误"
End If
End If
End Sub
Private Sub Form_Activate()
Call Form_Resize
Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "读者查询"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
DataGrid1.Refresh
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Adodc2.ConnectionString = connSTR
SSTabGuest.Tab = 0
FrmMain.FrmMainSBar.Panels(1).Text = "就绪"
Exit Sub
errEnd:
MsgBox "连接数据库失败!", vbOKOnly + vbExclamation, "打开数据库出错"
End
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
On Error Resume Next
End Sub
Private Sub Form_Resize()
If Me.WindowState <> 2 Then
Me.WindowState = 2
End If
SSTabGuest.Left = 0
SSTabGuest.Top = Toolbar1.Height
SSTabGuest.Width = Me.ScaleWidth
SSTabGuest.Height = Me.ScaleHeight - Toolbar1.Height
If SSTabGuest.Tab = 0 Then
DataGrid1.Left = 100
DataGrid1.Top = 450
DataGrid1.Width = Me.ScaleWidth - 230
DataGrid1.Height = Me.ScaleHeight - Toolbar1.Height - 550
ElseIf SSTabGuest.Tab = 1 Then
DataGrid2.Left = 100
DataGrid2.Top = 560 + ComboLeiBie.Height
DataGrid2.Width = Me.ScaleWidth - 230
DataGrid2.Height = Me.ScaleHeight - Toolbar1.Height - 660 - ComboLeiBie.Height
ElseIf SSTabGuest.Tab = 2 Then
Frame1.Left = 100
Frame1.Top = 450
Frame1.Width = SSTabGuest.Width \ 3 + 200
Frame1.Height = SSTabGuest.Height - 550
TxtLiPin.Width = Frame1.Width - 1380
TxtQT.Width = TxtLiPin.Width
If FrmMain.WindowState = 2 Then
TxtQT.Height = Frame1.Height \ 2 + 200
ElseIf FrmMain.WindowState = 0 Then
TxtQT.Height = Frame1.Height \ 3 + 600
ComboDengJi.Width = TxtLiPin.Width
End If
Frame2.Left = 200 + Frame1.Width
Frame2.Top = 450
Frame2.Width = (SSTabGuest.Width \ 3) * 2 - 600
Frame2.Height = SSTabGuest.Height - 550
DataGrid4.Left = 100
DataGrid4.Top = 300
DataGrid4.Width = Frame2.Width - 200
DataGrid4.Height = Frame2.Height - 400
ElseIf SSTabGuest.Tab = 3 Then
Frame3.Left = 100
Frame3.Top = 450
Frame3.Width = SSTabGuest.Width \ 3 - 200
Frame3.Height = SSTabGuest.Height - 550
If FrmMain.WindowState = 2 Then
TxtName.Width = Frame3.Width \ 2 + 600
TxtDanWei.Width = TxtName.Width
TxtDiZhi.Width = TxtName.Width
TxtEmail.Width = TxtName.Width
TxtInfo.Width = TxtName.Width
TxtInfo.Height = Frame3.Height \ 2
CmdSubmit.Top = TxtInfo.Height + 2600
CmdReset.Top = CmdSubmit.Top
CmdSubmit.Left = 500
CmdReset.Left = CmdSubmit.Width + 800
ElseIf FrmMain.WindowState = 0 Then
TxtName.Width = Frame3.Width \ 2
TxtDanWei.Width = TxtName.Width
TxtDiZhi.Width = TxtName.Width
TxtEmail.Width = TxtName.Width
TxtInfo.Width = TxtName.Width
TxtInfo.Height = Frame3.Height \ 3
CmdSubmit.Top = TxtInfo.Height + 2500
CmdReset.Top = CmdSubmit.Top
CmdSubmit.Left = 200
CmdReset.Left = CmdSubmit.Width + 300
End If
Frame4.Left = 200 + Frame3.Width
Frame4.Top = 450
Frame4.Width = (SSTabGuest.Width \ 3) * 2 - 200
Frame4.Height = SSTabGuest.Height - 550
DataGrid3.Left = 100
DataGrid3.Top = 300
DataGrid3.Width = Frame4.Width - 200
DataGrid3.Height = Frame4.Height - 400
ElseIf SSTabGuest.Tab = 4 Then
Frame5.Left = 100
Frame5.Top = 450
Frame5.Width = SSTabGuest.Width \ 2 - 200
Frame5.Height = SSTabGuest.Height - 550
TxtShopName.Left = 120
TxtShopName.Top = 360
TxtShopName.Width = Frame5.Width - 240
TxtShopJianJie.Left = 120
TxtShopJianJie.Top = 840
TxtShopJianJie.Width = TxtShopName.Width
TxtShopJianJie.Height = Frame5.Height - 950
Frame6.Left = 200 + Frame5.Width
Frame6.Top = 450
Frame6.Width = SSTabGuest.Width \ 2 - 200
Frame6.Height = SSTabGuest.Height - 550
TxtDianHua.Left = 1080
TxtDianHua.Width = Frame6.Width - 1300
TxtShouJi.Left = 1080
TxtShouJi.Width = TxtDianHua.Width
TxtMail.Left = 1080
TxtMail.Width = TxtDianHua.Width
TxtShopWeb.Left = 1080
TxtShopWeb.Width = TxtDianHua.Width
TxtShopDiZhi.Left = 1080
TxtShopDiZhi.Width = TxtDianHua.Width
TxtLianXiRen.Left = 1080
TxtLianXiRen.Width = TxtDianHua.Width
TxtQiT.Left = 1080
TxtQiT.Width = TxtDianHua.Width
If FrmMain.WindowState = 2 Then
TxtQiT.Height = Frame6.Height \ 3
ElseIf FrmMain.WindowState = 0 Then
TxtQiT.Height = Frame6.Height \ 7
End If
ElseIf SSTabGuest.Tab = 5 Then
DataGrid5.Left = 100
DataGrid5.Top = 450
DataGrid5.Width = Me.ScaleWidth - 230
DataGrid5.Height = Me.ScaleHeight - Toolbar1.Height - 550
ElseIf SSTabGuest.Tab = 6 Then
DataGrid6.Left = 100
DataGrid6.Top = 450
DataGrid6.Width = Me.ScaleWidth - 230
DataGrid6.Height = Me.ScaleHeight - Toolbar1.Height - 550
ElseIf SSTabGuest.Tab = 7 Then
DataGrid7.Left = 100
DataGrid7.Top = 450
DataGrid7.Width = Me.ScaleWidth - 230
DataGrid7.Height = Me.ScaleHeight - Toolbar1.Height - 550
ElseIf SSTabGuest.Tab = 8 Then
DataGrid8.Left = 100
DataGrid8.Top = 450
DataGrid8.Width = Me.ScaleWidth - 230
DataGrid8.Height = Me.ScaleHeight - Toolbar1.Height - 550
End If
End Sub
Private Sub MCangGuanB_dengJi_Click()
Load FrmGYS
FrmGYS.Show vbModal
End Sub
Private Sub MCangGuanB_gengZheng_Click()
Load FrmBookMemo
FrmBookMemo.Show vbModal
End Su
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -