📄 frm_rcgl.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Frm_rcgl
Caption = "人才资源管理系统"
ClientHeight = 6210
ClientLeft = 2175
ClientTop = 1380
ClientWidth = 7860
Icon = "Frm_rcgl.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6210
ScaleWidth = 7860
StartUpPosition = 1 '所有者中心
WindowState = 2 'Maximized
Begin MSComctlLib.ListView ListView1
Height = 5595
Left = 0
TabIndex = 1
Top = 600
Width = 7815
_ExtentX = 13785
_ExtentY = 9869
View = 3
LabelEdit = 1
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
Icons = "ImageList1"
SmallIcons = "ImageList1"
ColHdrIcons = "ImageList1"
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin MSComctlLib.ImageList ImageList1
Left = 60
Top = 600
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 8
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1272
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":13CC
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1526
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1680
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":17DA
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1934
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1A8E
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Frm_rcgl.frx":1BE8
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 570
Left = 0
TabIndex = 0
Top = 0
Width = 7860
_ExtentX = 13864
_ExtentY = 1005
ButtonWidth = 820
ButtonHeight = 953
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 6
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刷新"
Key = "renovate"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "查询"
Key = "query"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "添加"
Key = "add"
ImageIndex = 3
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "edit"
ImageIndex = 4
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "删除"
Key = "del"
ImageIndex = 5
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "exit"
ImageIndex = 7
EndProperty
EndProperty
Begin VB.OptionButton Option2
Caption = "管理人才"
Height = 255
Left = 4500
TabIndex = 3
Top = 120
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "技术人才"
Height = 195
Left = 3180
TabIndex = 2
Top = 180
Value = -1 'True
Width = 1095
End
End
End
Attribute VB_Name = "Frm_rcgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "姓名", 1200
ListView1.ColumnHeaders.Add , , "性别", 800
ListView1.ColumnHeaders.Add , , "出生日期", 1100
ListView1.ColumnHeaders.Add , , "文化程度", 800
ListView1.ColumnHeaders.Add , , "政治面貌", 800
ListView1.ColumnHeaders.Add , , "技术职称", 1000
ListView1.ColumnHeaders.Add , , "家庭住址", 1600
ListView1.ColumnHeaders.Add , , "技术特长", 1600
ListView1.ColumnHeaders.Add , , "何种奖励", 1600
ListView1.ColumnHeaders.Add , , "科研成果", 1600
ListView1.ColumnHeaders.Add , , "ID", 0
End Sub
Private Sub Form_Resize()
If Me.Height > 1000 Then ListView1.Height = Me.Height - 1000
If Me.Width > 200 Then ListView1.Width = Me.Width - 200
End Sub
Private Sub Option1_Click()
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "姓名", 1200
ListView1.ColumnHeaders.Add , , "性别", 800
ListView1.ColumnHeaders.Add , , "出生日期", 1100
ListView1.ColumnHeaders.Add , , "文化程度", 800
ListView1.ColumnHeaders.Add , , "政治面貌", 800
ListView1.ColumnHeaders.Add , , "技术职称", 1000
ListView1.ColumnHeaders.Add , , "家庭住址", 1600
ListView1.ColumnHeaders.Add , , "技术特长", 1600
ListView1.ColumnHeaders.Add , , "何种奖励", 1600
ListView1.ColumnHeaders.Add , , "科研成果", 1600
ListView1.ColumnHeaders.Add , , "ID", 0
End Sub
Private Sub Option2_Click()
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "姓名", 1200
ListView1.ColumnHeaders.Add , , "性别", 800
ListView1.ColumnHeaders.Add , , "出生日期", 1100
ListView1.ColumnHeaders.Add , , "文化程度", 800
ListView1.ColumnHeaders.Add , , "政治面貌", 800
ListView1.ColumnHeaders.Add , , "技术职称", 1000
ListView1.ColumnHeaders.Add , , "家庭住址", 1600
ListView1.ColumnHeaders.Add , , "类别", 1000
ListView1.ColumnHeaders.Add , , "简历", 2000
ListView1.ColumnHeaders.Add , , "ID", 0
End Sub
Private Sub renovate()
Dim cn As ADODB.Connection
Dim rst As New ADODB.Recordset
Dim dbfile As String
Dim lt As ListItem
' dbfile = App.Path & "\date\人才数据库.mdb"
' cn.CursorLocation = adUseClient
' cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbfile & "; Persist Security Info=False"
Set cn = GetCn
' cn.Open
If Option1 Then
rst.Open "select 姓名,性别,出生日期,文化程度,政治面貌,技术职称,家庭住址,技术特长,何种奖励,科研成果,id from 技术人才数据表", cn, 0, 1
Else
rst.Open "select 姓名,性别,出生日期,文化程度,政治面貌,技术职称,家庭住址,类别,简历,id from 管理人才数据表", cn, 0, 1
End If
If rst.BOF And rst.EOF Then
MsgBox "数据库中没有数据!", vbExclamation, "提示"
rst.Close
cn.Close
Exit Sub
End If
ListView1.ListItems.Clear
Do While Not rst.EOF
Set lt = ListView1.ListItems.Add(, , Trim(rst(0)), 8, 8)
For i = 1 To rst.Fields.Count - 1
lt.SubItems(i) = Trim(rst(i) & "")
Next i
rst.MoveNext
Loop
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "renovate"
renovate
Case "query"
Frm_query.Show 1
Case "add"
If Option1.Value Then
Frm_add.Show 1
Else
Frm_addgl.Show 1
End If
Case "edit"
If ListView1.ListItems.Count = 0 Then Exit Sub
If Option1.Value Then
Frm_edit.Show 1
Else
Frm_editgl.Show 1
End If
Case "del"
If ListView1.ListItems.Count = 0 Then Exit Sub
del
Case "exit"
Unload Me
End Select
End Sub
Private Sub del()
On Error GoTo myerr
Dim cn As ADODB.Connection
msg = MsgBox("是否删除该条记录?", vbYesNo + vbQuestion, "提示")
If msg = vbNo Then Exit Sub
Set cn = GetCn
If Option1.Value Then
cn.Execute "delete from 技术人才数据表 where id=" & ListView1.SelectedItem.SubItems(10)
Else
cn.Execute "delete from 管理人才数据表 where id=" & ListView1.SelectedItem.SubItems(9)
End If
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
MsgBox "已成功删除!", vbExclamation, "提示"
cn.Close
Exit Sub
myerr:
MsgBox Error, vbExclamation, "提示"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -