VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{E0A0BB77-0F89-427B-8CEB-5A1F420544FE}#1.0#0"; "prjExplorerBar.ocx"
Begin VB.Form frm侧边栏
BorderStyle = 0 'None
Caption = "侧边栏"
ClientHeight = 5535
ClientLeft = 0
ClientTop = 0
ClientWidth = 2700
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5535
ScaleWidth = 2700
ShowInTaskbar = 0 'False
Begin VB.Timer Timer2
Interval = 50
Left = 1200
Top = 1800
End
Begin VB.Timer Timer1
Interval = 50
Left = 240
Top = 1680
End
Begin MSComctlLib.ImageList ImageList1
Left = 1440
Top = 4200
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 13
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":08DA
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":395C
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":49AE
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":7160
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":85E2
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":8B7C
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":9116
Key = ""
EndProperty
BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":B250
Key = ""
EndProperty
BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":C2A2
Key = ""
EndProperty
BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":F12C
Key = ""
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":F6C6
Key = ""
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frm侧边栏.frx":FC60
Key = ""
EndProperty
EndProperty
End
Begin Project1.ctlExplorerBar XPmenu
Height = 10095
Left = 0
TabIndex = 0
Top = 0
Width = 2700
_ExtentX = 4763
_ExtentY = 17806
End
End
Attribute VB_Name = "frm侧边栏"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim l As Integer
Private Sub Form_Load()
XPmenu.AddSpecialItem "系统(S)", , ImageList1.ListImages(1).Picture '隔离条名称,图片,下拉栏图片
XPmenu.AddSubItem 1, "系统日志", ImageList1.ListImages(2).Picture
XPmenu.AddSubItem 1, "用户管理", ImageList1.ListImages(3).Picture
XPmenu.AddSubItem 1, "修改密码", ImageList1.ListImages(4).Picture
XPmenu.AddSubItem 1, "退出系统", ImageList1.ListImages(12).Picture
XPmenu.AddNormalItem "数据维护(D)", True '隔离条名称
XPmenu.AddSubItem 2, "增加", ImageList1.ListImages(6).Picture
XPmenu.AddSubItem 2, "修改", ImageList1.ListImages(7).Picture
XPmenu.AddSubItem 2, "删除", ImageList1.ListImages(8).Picture
XPmenu.AddSubItem 2, "数据备份", ImageList1.ListImages(9).Picture
XPmenu.AddSubItem 2, "恢复备份", ImageList1.ListImages(10).Picture
XPmenu.AddSubItem 2, "数据初始化", ImageList1.ListImages(13).Picture
XPmenu.AddNormalItem "帮助(H)", False '隔离条名称
XPmenu.AddSubItem 3, "...关于(A)...", ImageList1.ListImages(11).Picture
End Sub
Private Sub Form_Resize()
XPmenu.Height = Me.Height
End Sub
Private Sub XPmenu_SubItemClick(ByVal Index As Integer, ByVal SubItemIndex As Integer)
Select Case Index
Case 1
Select Case SubItemIndex
Case 1
frm开始.Line4.Visible = True
FrmLogMan.Show
Timer1.Enabled = False
Timer2.Enabled = True
Case 2
Timer1.Enabled = False
Timer2.Enabled = True
If CurUser.User_type = 4 Then
MsgBox "没有足够能的权限"
Else
FrmUserMan.Show 1
End If
Case 3
Timer1.Enabled = False
Timer2.Enabled = True
With FrmUserEdit
.Caption = "修改密码"
.OriUser = CurUser.name
.txtUserName = CurUser.name
If CurUser.User_type = 1 Then
.ComboType.AddItem "超级用户"
ElseIf CurUser.User_type = 2 Then
.ComboType.AddItem "系统管理员"
ElseIf CurUser.User_type = 3 Then
.ComboType.AddItem "系统操作员"
Else
.ComboType.AddItem "普通用户"
End If
.ComboType.ListIndex = 0
.ComboType.Enabled = False
.txtUserName = Trim(CurUser.name) '用户名
.txtUserName.Enabled = False '不允许修改用户名
.Modify = True
.Show 1
End With
'添加系统日志信息
MyLog.Title = "成员:" + Trim(Me.Caption)
MyLog.Body = "修改用户密码"
MyLog.LogType = "修改"
MyLog.UserName = CurUser.name
MyLog.Save
Case 4
Dim yn As String
yn = MsgBox("确定要退出系统吗?", vbYesNo, "退出确定")
If yn = vbYes Then
End
End If
End Select
Case 2
Select Case SubItemIndex
Case 1
Timer1.Enabled = False
Timer2.Enabled = True
If CurUser.User_type = 4 Then
MsgBox "没有足够能的权限"
Else
frm增加.Cmbbm.Text = ""
frm增加.txtxm.Text = ""
frm增加.txtdx.Text = ""
frm增加.txtbt.Text = ""
frm增加.txtjj.Text = ""
frm增加.txtft.Text = ""
frm增加.txtylbx.Text = ""
frm增加.txtylbxj.Text = ""
frm增加.txtzfgjj.Text = ""
frm增加.Show 1
End If
Case 2
Timer1.Enabled = False
Timer2.Enabled = True
If CurUser.User_type = 4 Or CurUser.User_type = 3 Then
MsgBox "没有足够能的权限"
Else
frm修改.Show 1
End If
Case 3
Timer1.Enabled = False
Timer2.Enabled = True
If CurUser.User_type = 4 Or CurUser.User_type = 3 Or CurUser.User_type = 2 Then
MsgBox "没有足够能的权限"
Else
frm删除.cmbxm.Text = ""
frm删除.txtbm = ""
frm删除.txtdx = ""
frm删除.txtbt = ""
frm删除.txtjj = ""
frm删除.txtft = ""
frm删除.txtylbx = ""
frm删除.txtylbxj = ""
frm删除.txtzfgjj = ""
frm删除.txtyf = ""
frm删除.txtsds = ""
frm删除.txtsf = ""
frm删除.Show 1
End If
Case 4
If CurUser.User_type 1 Then
MsgBox "没有足够能的权限"
Else
Dim mfile As String, mfile2 As String
On Error Resume Next
MkDir App.Path + "\Backup"
mfile = App.Path & "\data\职工工资管理.mdb"
mfile2 = App.Path & "\Backup\$Back%.inf"
If Trim(mfile2) = "" Then Exit Sub
If Dir(mfile2) "" Then
If MsgBox(Dir(mfile2) & " 文件已经存在,是否替换?", vbYesNo, "警告") = vbNo Then Exit Sub
End If
Dim buff() As Byte, i As Long
i = FileLen(mfile)
ReDim buff(i - 1)
Open mfile For Binary As #1
Get #1, , buff
Close #1
Open mfile2 For Binary As #1
Put #1, , buff
Close #1
MsgBox "备份完毕!"
'添加系统日志信息
MyLog.Title = "成员:备份当前数据库记录"
MyLog.Body = "数据备份"
MyLog.LogType = "数据备份"
MyLog.UserName = CurUser.name
MyLog.Save
End If
Case 5
If CurUser.User_type 1 Then
MsgBox "没有足够能的权限"
Else
On Error Resume Next
mfile = App.Path + "\Backup\$Back%.inf"
mfile2 = App.Path + "\data\职工工资管理.mdb"
If Dir(mfile) = "" Then
MsgBox "没有发现可以恢复的数据库!", vbOKOnly + vbCritical, "警告"
RmDir App.Path + "\Backup"
ElseIf Dir(mfile) "" Then
If MsgBox("确定要恢复备份文件吗?", vbYesNo, "请确认") = vbYes Then
i = FileLen(mfile)
ReDim buff(i - 1)
Open mfile For Binary As #1
Get #1, , buff
Close #1
Open mfile2 For Binary As #1
Put #1, , buff
Close #1
Kill App.Path + "\Backup\$Back%.inf"
MsgBox "恢复备份成功"
RmDir App.Path + "\Backup"
End If
End If
'添加系统日志信息
MyLog.Title = "成员:恢复数据库记录"
MyLog.Body = "恢复备份"
MyLog.LogType = "恢复备份"
MyLog.UserName = CurUser.name
MyLog.Save
End If
Case 6
If CurUser.User_type 1 Then
MsgBox "没有足够能的权限"
Else
End If
End Select
Case 3
Select Case SubItemIndex
Case 1
Timer1.Enabled = False
Timer2.Enabled = True
frm关于.Show 1
End Select
End Select
End Sub
Private Sub Timer1_Timer()
If l = 0 Then
Timer1.Enabled = False
Exit Sub
End If
l = l + 1
frm侧边栏.Visible = True
frm侧边栏.Height = frm开始.ScaleHeight
frm侧边栏.Left = frm侧边栏.Left + 360 '292.5
End Sub
Private Sub Timer2_Timer()
If l = -10 Then
Timer2.Enabled = False
frm侧边栏.Visible = False
Exit Sub
End If
l = l - 1
frm侧边栏.Left = frm侧边栏.Left - 360 ' 292.5
End Sub