main_gzgl_kqgl.frm
上传用户:ake0106
上传日期:2022-07-23
资源大小:4052k
文件大小:15k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  4. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  5. Begin VB.Form main_gzgl_kqgl 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Form1"
  8.    ClientHeight    =   4845
  9.    ClientLeft      =   45
  10.    ClientTop       =   330
  11.    ClientWidth     =   9390
  12.    Icon            =   "main_gzgl_kqgl.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4845
  17.    ScaleWidth      =   9390
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  '屏幕中心
  20.    Begin MSAdodcLib.Adodc Adodc1 
  21.       Height          =   330
  22.       Left            =   60
  23.       Top             =   2040
  24.       Visible         =   0   'False
  25.       Width           =   2040
  26.       _ExtentX        =   3598
  27.       _ExtentY        =   582
  28.       ConnectMode     =   0
  29.       CursorLocation  =   3
  30.       IsolationLevel  =   -1
  31.       ConnectionTimeout=   15
  32.       CommandTimeout  =   30
  33.       CursorType      =   3
  34.       LockType        =   3
  35.       CommandType     =   1
  36.       CursorOptions   =   0
  37.       CacheSize       =   50
  38.       MaxRecords      =   0
  39.       BOFAction       =   0
  40.       EOFAction       =   0
  41.       ConnectStringType=   1
  42.       Appearance      =   1
  43.       BackColor       =   -2147483643
  44.       ForeColor       =   -2147483640
  45.       Orientation     =   0
  46.       Enabled         =   -1
  47.       Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  48.       OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_manpowerinfo"
  49.       OLEDBFile       =   ""
  50.       DataSourceName  =   ""
  51.       OtherAttributes =   ""
  52.       UserName        =   ""
  53.       Password        =   ""
  54.       RecordSource    =   "select * from 考勤表"
  55.       Caption         =   "Adodc1"
  56.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  57.          Name            =   "宋体"
  58.          Size            =   9
  59.          Charset         =   134
  60.          Weight          =   400
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       _Version        =   393216
  66.    End
  67.    Begin MSComctlLib.ImageList ImageList1 
  68.       Left            =   1875
  69.       Top             =   2715
  70.       _ExtentX        =   1005
  71.       _ExtentY        =   1005
  72.       BackColor       =   -2147483643
  73.       ImageWidth      =   32
  74.       ImageHeight     =   32
  75.       MaskColor       =   12632256
  76.       _Version        =   393216
  77.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  78.          NumListImages   =   6
  79.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.             Picture         =   "main_gzgl_kqgl.frx":000C
  81.             Key             =   ""
  82.          EndProperty
  83.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  84.             Picture         =   "main_gzgl_kqgl.frx":0CE6
  85.             Key             =   ""
  86.          EndProperty
  87.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  88.             Picture         =   "main_gzgl_kqgl.frx":15C0
  89.             Key             =   ""
  90.          EndProperty
  91.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  92.             Picture         =   "main_gzgl_kqgl.frx":1E9A
  93.             Key             =   ""
  94.          EndProperty
  95.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  96.             Picture         =   "main_gzgl_kqgl.frx":2614
  97.             Key             =   ""
  98.          EndProperty
  99.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  100.             Picture         =   "main_gzgl_kqgl.frx":300E
  101.             Key             =   ""
  102.          EndProperty
  103.       EndProperty
  104.    End
  105.    Begin MSComctlLib.Toolbar Toolbar1 
  106.       Align           =   1  'Align Top
  107.       Height          =   795
  108.       Left            =   0
  109.       TabIndex        =   0
  110.       Top             =   0
  111.       Width           =   9390
  112.       _ExtentX        =   16563
  113.       _ExtentY        =   1402
  114.       ButtonWidth     =   1455
  115.       ButtonHeight    =   1349
  116.       Appearance      =   1
  117.       Style           =   1
  118.       ImageList       =   "ImageList1"
  119.       _Version        =   393216
  120.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  121.          NumButtons      =   8
  122.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  123.             Caption         =   "当前月份"
  124.             Key             =   "all"
  125.             ImageIndex      =   1
  126.          EndProperty
  127.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  128.             Caption         =   "批量修改"
  129.             Key             =   "modifyall"
  130.             ImageIndex      =   2
  131.          EndProperty
  132.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  133.             Caption         =   "修改"
  134.             Key             =   "modify"
  135.             ImageIndex      =   3
  136.          EndProperty
  137.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  138.             Style           =   3
  139.          EndProperty
  140.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  141.             Caption         =   "查找"
  142.             Key             =   "find"
  143.             ImageIndex      =   4
  144.          EndProperty
  145.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  146.             Caption         =   "Excel"
  147.             Key             =   "excel"
  148.             ImageIndex      =   5
  149.          EndProperty
  150.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  151.             Style           =   3
  152.          EndProperty
  153.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  154.             Caption         =   "关闭"
  155.             Key             =   "close"
  156.             ImageIndex      =   6
  157.          EndProperty
  158.       EndProperty
  159.       BorderStyle     =   1
  160.    End
  161.    Begin MSDataGridLib.DataGrid DataGrid1 
  162.       Bindings        =   "main_gzgl_kqgl.frx":38E8
  163.       Height          =   3990
  164.       Left            =   15
  165.       TabIndex        =   1
  166.       Top             =   825
  167.       Width           =   9330
  168.       _ExtentX        =   16457
  169.       _ExtentY        =   7038
  170.       _Version        =   393216
  171.       AllowUpdate     =   0   'False
  172.       HeadLines       =   1
  173.       RowHeight       =   15
  174.       FormatLocked    =   -1  'True
  175.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  176.          Name            =   "宋体"
  177.          Size            =   9
  178.          Charset         =   134
  179.          Weight          =   400
  180.          Underline       =   0   'False
  181.          Italic          =   0   'False
  182.          Strikethrough   =   0   'False
  183.       EndProperty
  184.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  185.          Name            =   "宋体"
  186.          Size            =   9
  187.          Charset         =   134
  188.          Weight          =   400
  189.          Underline       =   0   'False
  190.          Italic          =   0   'False
  191.          Strikethrough   =   0   'False
  192.       EndProperty
  193.       ColumnCount     =   8
  194.       BeginProperty Column00 
  195.          DataField       =   "所属工资月份"
  196.          Caption         =   "所属工资月份"
  197.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  198.             Type            =   0
  199.             Format          =   ""
  200.             HaveTrueFalseNull=   0
  201.             FirstDayOfWeek  =   0
  202.             FirstWeekOfYear =   0
  203.             LCID            =   2052
  204.             SubFormatType   =   0
  205.          EndProperty
  206.       EndProperty
  207.       BeginProperty Column01 
  208.          DataField       =   "员工编号"
  209.          Caption         =   "员工编号"
  210.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  211.             Type            =   0
  212.             Format          =   ""
  213.             HaveTrueFalseNull=   0
  214.             FirstDayOfWeek  =   0
  215.             FirstWeekOfYear =   0
  216.             LCID            =   2052
  217.             SubFormatType   =   0
  218.          EndProperty
  219.       EndProperty
  220.       BeginProperty Column02 
  221.          DataField       =   "员工姓名"
  222.          Caption         =   "员工姓名"
  223.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  224.             Type            =   0
  225.             Format          =   ""
  226.             HaveTrueFalseNull=   0
  227.             FirstDayOfWeek  =   0
  228.             FirstWeekOfYear =   0
  229.             LCID            =   2052
  230.             SubFormatType   =   0
  231.          EndProperty
  232.       EndProperty
  233.       BeginProperty Column03 
  234.          DataField       =   "出勤天数"
  235.          Caption         =   "出勤天数"
  236.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  237.             Type            =   0
  238.             Format          =   ""
  239.             HaveTrueFalseNull=   0
  240.             FirstDayOfWeek  =   0
  241.             FirstWeekOfYear =   0
  242.             LCID            =   2052
  243.             SubFormatType   =   0
  244.          EndProperty
  245.       EndProperty
  246.       BeginProperty Column04 
  247.          DataField       =   "请假天数"
  248.          Caption         =   "请假天数"
  249.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  250.             Type            =   0
  251.             Format          =   ""
  252.             HaveTrueFalseNull=   0
  253.             FirstDayOfWeek  =   0
  254.             FirstWeekOfYear =   0
  255.             LCID            =   2052
  256.             SubFormatType   =   0
  257.          EndProperty
  258.       EndProperty
  259.       BeginProperty Column05 
  260.          DataField       =   "迟到或早退次数"
  261.          Caption         =   "迟到或早退次数"
  262.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  263.             Type            =   0
  264.             Format          =   ""
  265.             HaveTrueFalseNull=   0
  266.             FirstDayOfWeek  =   0
  267.             FirstWeekOfYear =   0
  268.             LCID            =   2052
  269.             SubFormatType   =   0
  270.          EndProperty
  271.       EndProperty
  272.       BeginProperty Column06 
  273.          DataField       =   "旷工天数"
  274.          Caption         =   "旷工天数"
  275.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  276.             Type            =   0
  277.             Format          =   ""
  278.             HaveTrueFalseNull=   0
  279.             FirstDayOfWeek  =   0
  280.             FirstWeekOfYear =   0
  281.             LCID            =   2052
  282.             SubFormatType   =   0
  283.          EndProperty
  284.       EndProperty
  285.       BeginProperty Column07 
  286.          DataField       =   "加班次数"
  287.          Caption         =   "加班次数"
  288.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  289.             Type            =   0
  290.             Format          =   ""
  291.             HaveTrueFalseNull=   0
  292.             FirstDayOfWeek  =   0
  293.             FirstWeekOfYear =   0
  294.             LCID            =   2052
  295.             SubFormatType   =   0
  296.          EndProperty
  297.       EndProperty
  298.       SplitCount      =   1
  299.       BeginProperty Split0 
  300.          MarqueeStyle    =   4
  301.          BeginProperty Column00 
  302.             ColumnWidth     =   1289.764
  303.          EndProperty
  304.          BeginProperty Column01 
  305.             ColumnWidth     =   915.024
  306.          EndProperty
  307.          BeginProperty Column02 
  308.             ColumnWidth     =   1365.165
  309.          EndProperty
  310.          BeginProperty Column03 
  311.             ColumnWidth     =   975.118
  312.          EndProperty
  313.          BeginProperty Column04 
  314.             ColumnWidth     =   854.929
  315.          EndProperty
  316.          BeginProperty Column05 
  317.             ColumnWidth     =   1365.165
  318.          EndProperty
  319.          BeginProperty Column06 
  320.             ColumnWidth     =   794.835
  321.          EndProperty
  322.          BeginProperty Column07 
  323.             ColumnWidth     =   989.858
  324.          EndProperty
  325.       EndProperty
  326.    End
  327. End
  328. Attribute VB_Name = "main_gzgl_kqgl"
  329. Attribute VB_GlobalNameSpace = False
  330. Attribute VB_Creatable = False
  331. Attribute VB_PredeclaredId = True
  332. Attribute VB_Exposed = False
  333. Dim rs1 As New ADODB.Recordset
  334. Private Sub Form_Activate()
  335.   If sql1 <> "" Then
  336.      Adodc1.RecordSource = "select * from " & sql1
  337.      Adodc1.Refresh
  338.      If Adodc1.Recordset.RecordCount > 0 Then
  339.      Else
  340.         MsgBox "没有找到符合条件的记录!", , "提示窗口"
  341.      End If
  342.   End If
  343. End Sub
  344. Private Sub Form_Load()
  345.   Me.Caption = text
  346.   Adodc1.RecordSource = "select * from 考勤表 where 考勤表.所属工资月份=(select 月份 from 月份表)"
  347.   Adodc1.Refresh
  348.   If Adodc1.Recordset.RecordCount > 0 Then
  349.   Else
  350.     Cnn.Execute ("insert into 考勤表(员工编号,员工姓名) select 编号,姓名 from 人事表")
  351.     Cnn.Execute ("update 考勤表 set 所属工资月份=月份 from 月份表 where 所属工资月份 is null")
  352.     Adodc1.Refresh
  353.   End If
  354. End Sub
  355. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  356.   sql1 = ""
  357. End Sub
  358. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  359.   Select Case Button.Key
  360.      Case "all"
  361.        If Toolbar1.Buttons(1).Caption = "当前月份" Then
  362.           Toolbar1.Buttons(1).Caption = "所有月份"
  363.        Else
  364.           Toolbar1.Buttons(1).Caption = "当前月份"
  365.        End If
  366.        If Toolbar1.Buttons(1).Caption = "所有月份" Then
  367.          Adodc1.RecordSource = "select * from 考勤表 order by 所属工资月份,员工编号"
  368.          Adodc1.Refresh
  369.        Else
  370.          Adodc1.RecordSource = "select * from 考勤表 where 考勤表.所属工资月份=(select 月份 from 月份表)"
  371.          Adodc1.Refresh
  372.        End If
  373.      Case "modify"
  374.        If Adodc1.Recordset.RecordCount > 0 Then
  375.          Load main_gzgl_kqgl_lr
  376.          main_gzgl_kqgl_lr.Show 1
  377.        Else
  378.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  379.        End If
  380.      Case "modifyall"
  381.        If Adodc1.Recordset.RecordCount > 0 Then
  382.           Load main_gzgl_kqgl_pl
  383.           main_gzgl_kqgl_pl.Show 1
  384.        Else
  385.          MsgBox "系统没有要修改的数据!", , "提示窗口"
  386.        End If
  387.      Case "find"
  388.        tb1 = "考勤表"
  389.        Load main_fzfind
  390.        main_fzfind.Show 1
  391.      Case "excel"
  392.        Dim r As Integer, c As Integer
  393.        Dim newxls As Excel.Application
  394.        Dim newbook As Excel.Workbook
  395.        Dim newsheet As Excel.Worksheet
  396.        Set newxls = CreateObject("Excel.Application") '创建excel应用程序,打开excel2000
  397.        Set newbook = newxls.Workbooks.Add   '创建工作簿
  398.        Set newsheet = newbook.Worksheets(1) '创建工作表
  399.        If sql1 <> "" Then
  400.          Adodc1.RecordSource = sql1
  401.          Adodc1.Refresh
  402.        End If
  403.        If Adodc1.Recordset.RecordCount > 0 Then
  404.          newxls.Visible = True
  405.          For i = 0 To DataGrid1.Columns.Count - 1
  406.               newsheet.Cells(1, i + 1) = DataGrid1.Columns(i).Caption
  407.          Next i
  408.          '指定表格内容
  409.          Adodc1.Recordset.MoveFirst
  410.          Do Until Adodc1.Recordset.EOF
  411.               r = Adodc1.Recordset.AbsolutePosition
  412.               For c = 0 To DataGrid1.Columns.Count - 1
  413.                   newsheet.Cells(r + 1, c + 1) = DataGrid1.Columns(c)
  414.               Next c
  415.               Adodc1.Recordset.MoveNext
  416.          Loop
  417. ErrSave:
  418.            Exit Sub
  419.            MsgBox Err.Description, , "提示窗口"
  420.          End If
  421.      Case "close"
  422.        Unload Me
  423.   End Select
  424. End Sub