📄 frmmain.frm
字号:
TabIndex = 8
Top = 1560
Width = 2295
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "访问我的主页:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 7
Top = 1260
Width = 2595
End
Begin VB.Label 操作用户
BackStyle = 0 'Transparent
Caption = "admin"
Height = 195
Left = 1320
TabIndex = 6
Top = 660
Width = 1755
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "操作用户:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 5
Top = 660
Width = 975
End
Begin VB.Label 当前日期
BackStyle = 0 'Transparent
Caption = "2006年12月31日"
Height = 195
Left = 1320
TabIndex = 4
Top = 300
Width = 1755
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "当前日期:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 3
Top = 300
Width = 975
End
End
Begin MSAdodcLib.Adodc m_checkado
Height = 375
Left = 6720
Top = -180
Width = 2595
_ExtentX = 4577
_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 = "check"
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 MSComDlg.CommonDialog dlgCommonDialog
Left = 8880
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DefaultExt = "*.bkp"
Filter = "bkp file(*.bkp)|*.bkp|"
End
Begin MSComctlLib.StatusBar sbStatusBar
Align = 2 'Align Bottom
Height = 270
Left = 0
TabIndex = 0
Top = 6405
Width = 9285
_ExtentX = 16378
_ExtentY = 476
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 2
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
AutoSize = 1
Object.Width = 13256
Text = "欢迎使用仓库管理系统!"
TextSave = "欢迎使用仓库管理系统!"
EndProperty
BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Style = 5
AutoSize = 2
TextSave = "14:32"
EndProperty
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
End
Begin MSComctlLib.ImageList imlToolbarIcons
Left = 8460
Top = 60
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 24
ImageHeight = 24
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 12
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":4008
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":5D12
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":602C
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":647E
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":68D0
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":6BEA
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":6F04
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":7356
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":79D0
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":804A
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":8924
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmMain.frx":9776
Key = ""
EndProperty
EndProperty
End
Begin VB.Menu M登记信息
Caption = "登记信息(&F)"
HelpContextID = 21
Index = 1
Begin VB.Menu M货物信息
Caption = "货物信息"
HelpContextID = 211
End
Begin VB.Menu M仓库信息
Caption = "仓库信息"
HelpContextID = 212
End
Begin VB.Menu M供应商
Caption = "供应商"
HelpContextID = 212
End
Begin VB.Menu M往来客户
Caption = "往来客户"
HelpContextID = 214
End
Begin VB.Menu M库存状况
Caption = "库存状况"
HelpContextID = 215
End
Begin VB.Menu mnuFileBar1
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "退出(&X)"
End
End
Begin VB.Menu M单据管理
Caption = "单据管理(&c)"
HelpContextID = 22
Begin VB.Menu M入库单
Caption = "入库单管理"
HelpContextID = 221
End
Begin VB.Menu M出库单
Caption = "出库单管理"
HelpContextID = 222
End
Begin VB.Menu M调拔单
Caption = "调拔单管理"
HelpContextID = 225
End
Begin VB.Menu M报损单
Caption = "报损单管理"
HelpContextID = 226
End
End
Begin VB.Menu 查询统计
Caption = "查询统计(&J)"
HelpContextID = 23
Begin VB.Menu M库存查询
Caption = "库存查询"
HelpContextID = 232
End
Begin VB.Menu M货物出入统计
Caption = "货物出入统计"
HelpContextID = 236
End
Begin VB.Menu M职员操作统计
Caption = "职员操作统计"
HelpContextID = 237
End
End
Begin VB.Menu M维护设置
Caption = "维护设置"
HelpContextID = 24
Begin VB.Menu M职员信息
Caption = "职员信息"
HelpContextID = 242
End
Begin VB.Menu mnuModifyPassword
Caption = "修改密码(&E)"
HelpContextID = 249
End
Begin VB.Menu mnuUserManage
Caption = "用户管理(&M)"
HelpContextID = 2410
End
Begin VB.Menu M换用户登陆
Caption = "换用户登陆"
HelpContextID = 2411
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public Sub InitPurview()
'初始化17种权限状态
Dim i As Integer
For i = 16 To 0 Step -1
If GetBit(Purview, i + 1) = 0 Then
权限类别(16 - i) = 0
Else
权限类别(16 - i) = 1
End If
Next
End Sub
'根据用户权限来初始化菜单
Private Sub InitMenu()
If 权限类别(0) = 0 Then
M新增入库单.Enabled = False
M新增出库单.Enabled = False
M新增调拔单.Enabled = False
M新增报损单.Enabled = False
新增单据(0).MouseIcon = Picture1.MouseIcon
新增单据(1).MouseIcon = Picture1.MouseIcon
新增单据(2).MouseIcon = Picture1.MouseIcon
新增单据(3).MouseIcon = Picture1.MouseIcon
tbToolBar.Buttons(2).Enabled = False
End If
If 权限类别(4) = 0 Then
M供应商.Enabled = False
登记新供应商.MouseIcon = Picture1.MouseIcon
End If
If 权限类别(5) = 0 Then
M往来客户.Enabled = False
登记新客户.MouseIcon = Picture1.MouseIcon
End If
If 权限类别(6) = 0 Then
M单据查询.Enabled = False
M库存查询.Enabled = False
M货物出入统计.Enabled = False
M职员操作统计.Enabled = False
L货物出入统计.MouseIcon = Picture1.MouseIcon
L职员操作统计.MouseIcon = Picture1.MouseIcon
L单据查询.MouseIcon = Picture1.MouseIcon
L库存查询.MouseIcon = Picture1.MouseIcon
tbToolBar.Buttons(5).Enabled = False
tbToolBar.Buttons(8).Enabled = False
End If
If 权限类别(10) = 0 Then
M职员信息.Enabled = False
登记新职员.MouseIcon = Picture1.MouseIcon
End If
If 权限类别(11) = 0 Then
M仓库信息.Enabled = False
创建新仓库.MouseIcon = Picture1.MouseIcon
End If
If 权限类别(12) = 0 Then
M货物信息.Enabled = False
登记新货物.MouseIcon = Picture1.MouseIcon
End If
If 权限类别(16) = 0 Then
mnuUserManage.Enabled = False
L用户管理.MouseIcon = Picture1.MouseIcon
End If
End Sub
Public Function WriteLog(inf As String)
On Error Resume Next
Me.m_checkado.RecordSource = "select * from 系统日志"
Me.m_checkado.Refresh
If Me.m_checkado.Recordset.RecordCount > 0 Then
Me.m_checkado.Recordset.MoveLast
End If
Me.m_checkado.Recordset.AddNew
Me.m_checkado.Recordset.Fields("用户名").Value = UserName
Me.m_checkado.Recordset.Fields("操作时间").Value = Date + Time
Me.m_checkado.Recordset.Fields("操作内容").Value = inf
Me.m_checkado.Recordset.update
Me.m_checkado.Refresh
End Function
'还原数据库后初始化各类信息
Private Sub InitAfterResume()
'更改数据库中的用户信息
m_checkado.RecordSource = "select * from 用户管理 where 用户名='" + UserName + "'"
m_checkado.Refresh
'如果已存在记录则更新
If m_checkado.Recordset.RecordCount > 0 Then
m_checkado.Recordset.Fields("用户密码").Value = UserPas
m_checkado.Recordset.Fields("用户权限").Value = Purview
m_checkado.Recordset.update
m_checkado.Refresh
Else '新建用户记录
m_checkado.Recordset.AddNew
m_checkado.Recordset.Fields("用户名").Value = UserName
m_checkado.Recordset.Fields("用户密码").Value = UserPas
m_checkado.Recordset.Fields("用户权限").Value = Purview
m_checkado.Recordset.update
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -