main_rsgl_pygl.frm
上传用户:wd52qq
上传日期:2022-07-24
资源大小:5366k
文件大小:23k
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
- Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
- Begin VB.Form main_rsgl_pygl
- BorderStyle = 3 'Fixed Dialog
- Caption = "Form1"
- ClientHeight = 5880
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 11820
- Icon = "main_rsgl_pygl.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5880
- ScaleWidth = 11820
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 '屏幕中心
- Begin MSAdodcLib.Adodc Adodc1
- Height = 330
- Left = 60
- Top = 2040
- Visible = 0 'False
- Width = 2040
- _ExtentX = 3598
- _ExtentY = 582
- ConnectMode = 0
- CursorLocation = 3
- IsolationLevel = -1
- ConnectionTimeout= 15
- CommandTimeout = 30
- CursorType = 3
- LockType = 3
- CommandType = 2
- CursorOptions = 0
- CacheSize = 50
- MaxRecords = 0
- BOFAction = 0
- EOFAction = 0
- ConnectStringType= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
- OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = "聘用表"
- Caption = "Adodc1"
- 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 MSComctlLib.ImageList ImageList1
- Left = 1875
- Top = 2730
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 13
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":000C
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":0786
- Key = ""
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":1460
- Key = ""
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":1D3A
- Key = ""
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":2614
- Key = ""
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":2EEE
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":3BC8
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":44A2
- Key = ""
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":4D7C
- Key = ""
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":5656
- Key = ""
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":5F30
- Key = ""
- EndProperty
- BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":6C0A
- Key = ""
- EndProperty
- BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "main_rsgl_pygl.frx":7604
- Key = ""
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar Toolbar1
- Align = 1 'Align Top
- Height = 795
- Left = 0
- TabIndex = 0
- Top = 0
- Width = 11820
- _ExtentX = 20849
- _ExtentY = 1402
- ButtonWidth = 1455
- ButtonHeight = 1349
- Appearance = 1
- Style = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 17
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "查找"
- Key = "find"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "全部"
- Key = "all"
- ImageIndex = 2
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "增加"
- Key = "add"
- ImageIndex = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "修改"
- Key = "modify"
- ImageIndex = 4
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "删除"
- Key = "delete"
- ImageIndex = 5
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "续约"
- Key = "addpact"
- ImageIndex = 6
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "生效"
- Key = "takee"
- ImageIndex = 7
- EndProperty
- BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "解除"
- Key = "undo"
- ImageIndex = 8
- EndProperty
- BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "试用"
- Key = "test"
- ImageIndex = 9
- EndProperty
- BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "转正"
- Key = "change"
- ImageIndex = 10
- EndProperty
- BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "到期处理"
- Key = "atterm"
- ImageIndex = 11
- EndProperty
- BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "Excel"
- Key = "excel"
- ImageIndex = 12
- EndProperty
- BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "关闭"
- Key = "close"
- ImageIndex = 13
- EndProperty
- EndProperty
- BorderStyle = 1
- End
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "main_rsgl_pygl.frx":7EDE
- Height = 5010
- Left = 15
- TabIndex = 1
- Top = 825
- Width = 11760
- _ExtentX = 20743
- _ExtentY = 8837
- _Version = 393216
- AllowUpdate = 0 'False
- HeadLines = 1
- RowHeight = 15
- FormatLocked = -1 'True
- BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "宋体"
- Size = 9
- Charset = 134
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- 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
- ColumnCount = 12
- BeginProperty Column00
- DataField = "员工编号"
- Caption = "员工编号"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column01
- DataField = "员工姓名"
- Caption = "员工姓名"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column02
- DataField = "聘用编号"
- Caption = "聘用编号"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column03
- DataField = "聘用类型"
- Caption = "聘用类型"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column04
- DataField = "聘用开始日期"
- Caption = "聘用开始日期"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column05
- DataField = "聘用结束日期"
- Caption = "聘用结束日期"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column06
- DataField = "聘用期限"
- Caption = "聘用期限"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column07
- DataField = "聘用期工资"
- Caption = "聘用期工资"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column08
- DataField = "试用期"
- Caption = "试用期"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column09
- DataField = "试用期工资"
- Caption = "试用期工资"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column10
- DataField = "备注"
- Caption = "备注"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column11
- DataField = "状态"
- Caption = "状态"
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- SplitCount = 1
- BeginProperty Split0
- MarqueeStyle = 4
- BeginProperty Column00
- ColumnWidth = 915.024
- EndProperty
- BeginProperty Column01
- ColumnWidth = 1365.165
- EndProperty
- BeginProperty Column02
- ColumnWidth = 1814.74
- EndProperty
- BeginProperty Column03
- ColumnWidth = 1365.165
- EndProperty
- BeginProperty Column04
- ColumnWidth = 2085.166
- EndProperty
- BeginProperty Column05
- ColumnWidth = 2085.166
- EndProperty
- BeginProperty Column06
- ColumnWidth = 1275.024
- EndProperty
- BeginProperty Column07
- ColumnWidth = 2085.166
- EndProperty
- BeginProperty Column08
- ColumnWidth = 1094.74
- EndProperty
- BeginProperty Column09
- ColumnWidth = 2085.166
- EndProperty
- BeginProperty Column10
- ColumnWidth = 2085.166
- EndProperty
- BeginProperty Column11
- ColumnWidth = 824.882
- EndProperty
- EndProperty
- End
- End
- Attribute VB_Name = "main_rsgl_pygl"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim rs1 As New ADODB.Recordset
- Dim i As Integer
- Private Sub SetButtons()
- For i = 5 To 12
- Toolbar1.Buttons(i).Enabled = True
- Next i
- End Sub
- Private Sub DataGrid1_DblClick()
- If Adodc1.Recordset.RecordCount > 0 Then
- blnAddPY = False
- Load main_rsgl_pygl_lr
- main_rsgl_pygl_lr.Show 1
- End If
- End Sub
- Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
- On Error Resume Next
- With Adodc1.Recordset
- If .RecordCount > 0 Then
- On Error Resume Next
- SetButtons
- Select Case .Fields("状态")
- Case "到期"
- For i = 9 To 12
- Toolbar1.Buttons(i).Enabled = False
- Next i
- Case "生效"
- Toolbar1.Buttons(8).Enabled = False
- Toolbar1.Buttons(9).Enabled = False
- Toolbar1.Buttons(12).Enabled = False
- Case "解除"
- Toolbar1.Buttons(8).Enabled = False
- Toolbar1.Buttons(10).Enabled = False
- Case "试用"
- Toolbar1.Buttons(8).Enabled = False
- Toolbar1.Buttons(11).Enabled = False
- End Select
- End If
- End With
- End Sub
- Private Sub Form_Activate()
- If sql1 <> "" Then
- Adodc1.RecordSource = sql1
- Adodc1.Refresh
- If Adodc1.Recordset.RecordCount > 0 Then
- Else
- MsgBox "没有找到符合条件的记录!", , "提示窗口"
- End If
- End If
- End Sub
- Private Sub Form_Load()
- Me.Caption = text
- DataGrid1_RowColChange 0, 0
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- sql1 = ""
- End Sub
- Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
- Dim newsql As String
- If sql1 <> "" And tb1 <> "" Then
- newsql = Mid(sql1, Len(tb1), Len(sql1))
- End If
- Select Case Button.Key
- Case "add"
- blnAddPY = True
- main_yyxx.Tag = 4
- Load main_yyxx
- main_yyxx.Show 1
- Case "modify"
- If Adodc1.Recordset.RecordCount > 0 Then
- blnAddPY = False
- Load main_rsgl_pygl_lr
- main_rsgl_pygl_lr.Show 1
- Else
- MsgBox "系统没有要修改的数据!", , "提示窗口"
- End If
- Case "delete"
- If Adodc1.Recordset.RecordCount > 0 Then
- Adodc1.Recordset.Delete
- Adodc1.Refresh
- Else
- For i = 5 To 15
- Toolbar1.Buttons(i).Enabled = False
- Next i
- MsgBox "系统没有要删除的数据!", , "提示窗口"
- End If
- Case "find"
- tb1 = "聘用表"
- Load main_fzfind
- main_fzfind.Show 1
- Case "addpact"
- Load main_pyxy
- main_pyxy.Show 1
- Case "takee"
- If newsql <> "" Then
- Cnn.Execute ("update 聘用表 set 状态='生效'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
- Else
- Cnn.Execute ("update 聘用表 set 状态='生效'where 员工编号='" + DataGrid1.Columns(0) + "'")
- End If
- Adodc1.Refresh
- Case "undo"
- If newsql <> "" Then
- Cnn.Execute ("update 聘用表 set 状态='解除'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
- Else
- Cnn.Execute ("update 聘用表 set 状态='解除' where 员工编号='" + DataGrid1.Columns(0) + "'")
- End If
- Adodc1.Refresh
- Case "test"
- If newsql <> "" Then
- Cnn.Execute ("update 聘用表 set 状态='试用'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
- Else
- Cnn.Execute ("update 聘用表 set 状态='试用'where 员工编号='" + DataGrid1.Columns(0) + "'")
- End If
- Adodc1.Refresh
- Case "change"
- If newsql <> "" Then
- Cnn.Execute ("update 聘用表 set 状态='生效'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'")
- Else
- Cnn.Execute ("update 聘用表 set 状态='生效'where 员工编号='" + DataGrid1.Columns(0) + "'")
- End If
- Adodc1.Refresh
- Case "atterm"
- If newsql <> "" Then
- Cnn.Execute ("update 聘用表 set 状态='到期'" & newsql & " and 员工编号='" + DataGrid1.Columns(0) + "'and 聘用结束日期>" & Date)
- Else
- Cnn.Execute ("update 聘用表 set 状态='到期' where 员工编号='" + DataGrid1.Columns(0) + "'and 聘用结束日期>" & Date)
- End If
- Adodc1.Refresh
- Case "excel"
- Dim r As Integer, c As Integer
- Dim newxls As Excel.Application
- Dim newbook As Excel.Workbook
- Dim newsheet As Excel.Worksheet
- Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
- Set newbook = newxls.Workbooks.Add '创建工作簿
- Set newsheet = newbook.Worksheets(1) '创建工作表
- If sql1 <> "" Then
- Adodc1.RecordSource = sql1
- Adodc1.Refresh
- End If
- If Adodc1.Recordset.RecordCount > 0 Then
- newxls.Visible = True
- For i = 0 To DataGrid1.Columns.Count - 1
- newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
- Next i
- '指定表格内容
- Adodc1.Recordset.MoveFirst
- Do Until Adodc1.Recordset.EOF
- r = Adodc1.Recordset.AbsolutePosition
- For c = 0 To DataGrid1.Columns.Count - 1
- newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
- Next c
- Adodc1.Recordset.MoveNext
- Loop
- ErrSave:
- Exit Sub
- MsgBox Err.Description, , "提示窗口"
- End If
- Case "close"
- Unload Me
- End Select
- End Sub