GongZi.frm
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:28k
源码类别:

SQL Server

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form GongZi 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   7155
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   5670
  8.    LinkTopic       =   "Form1"
  9.    MDIChild        =   -1  'True
  10.    ScaleHeight     =   7155
  11.    ScaleWidth      =   5670
  12.    Begin VB.CommandButton Command2 
  13.       Caption         =   "上 一 条"
  14.       Height          =   375
  15.       Left            =   120
  16.       TabIndex        =   47
  17.       Top             =   6720
  18.       Width           =   1095
  19.    End
  20.    Begin VB.CommandButton Command1 
  21.       Caption         =   "下 一 条"
  22.       Height          =   375
  23.       Left            =   4440
  24.       TabIndex        =   46
  25.       Top             =   6720
  26.       Width           =   1095
  27.    End
  28.    Begin VB.CommandButton QuXiao_GongZi 
  29.       Caption         =   "取   消"
  30.       Height          =   375
  31.       Left            =   3240
  32.       TabIndex        =   35
  33.       Top             =   6720
  34.       Width           =   1095
  35.    End
  36.    Begin VB.CommandButton QueDing_GongZi 
  37.       Caption         =   "修   改"
  38.       Height          =   375
  39.       Left            =   1320
  40.       TabIndex        =   34
  41.       Top             =   6720
  42.       Width           =   1095
  43.    End
  44.    Begin VB.Frame Frame1 
  45.       Height          =   6495
  46.       Left            =   120
  47.       TabIndex        =   0
  48.       Top             =   120
  49.       Width           =   5415
  50.       Begin VB.Frame Frame6 
  51.          Caption         =   "实际工资项"
  52.          Height          =   1095
  53.          Left            =   120
  54.          TabIndex        =   24
  55.          Top             =   4920
  56.          Width           =   5175
  57.          Begin VB.CommandButton JiSuan_GongZi 
  58.             Caption         =   "计算工资"
  59.             Enabled         =   0   'False
  60.             Height          =   375
  61.             Left            =   3360
  62.             TabIndex        =   45
  63.             Top             =   165
  64.             Width           =   975
  65.          End
  66.          Begin VB.ComboBox TexNian_GongZi 
  67.             Height          =   300
  68.             ItemData        =   "GongZi.frx":0000
  69.             Left            =   1200
  70.             List            =   "GongZi.frx":0002
  71.             TabIndex        =   30
  72.             Text            =   "1990"
  73.             Top             =   650
  74.             Width           =   975
  75.          End
  76.          Begin VB.ComboBox TexYue_GongZi 
  77.             Height          =   300
  78.             Left            =   2520
  79.             TabIndex        =   29
  80.             Text            =   "1"
  81.             Top             =   650
  82.             Width           =   735
  83.          End
  84.          Begin VB.ComboBox TexRi_GongZi 
  85.             Height          =   300
  86.             Left            =   3600
  87.             TabIndex        =   28
  88.             Text            =   "1"
  89.             Top             =   650
  90.             Width           =   735
  91.          End
  92.          Begin VB.TextBox Text_GongZi 
  93.             Enabled         =   0   'False
  94.             Height          =   270
  95.             Index           =   10
  96.             Left            =   1200
  97.             TabIndex        =   26
  98.             Top             =   300
  99.             Width           =   1095
  100.          End
  101.          Begin VB.Label Label19 
  102.             AutoSize        =   -1  'True
  103.             Caption         =   "*"
  104.             ForeColor       =   &H008080FF&
  105.             Height          =   180
  106.             Left            =   4680
  107.             TabIndex        =   44
  108.             Top             =   705
  109.             Width           =   90
  110.          End
  111.          Begin VB.Label Label16 
  112.             AutoSize        =   -1  'True
  113.             Caption         =   "年"
  114.             Height          =   180
  115.             Left            =   2200
  116.             TabIndex        =   33
  117.             Top             =   705
  118.             Width           =   180
  119.          End
  120.          Begin VB.Label Label17 
  121.             AutoSize        =   -1  'True
  122.             Caption         =   "月"
  123.             Height          =   180
  124.             Left            =   3280
  125.             TabIndex        =   32
  126.             Top             =   705
  127.             Width           =   180
  128.          End
  129.          Begin VB.Label Label20 
  130.             AutoSize        =   -1  'True
  131.             Caption         =   "日"
  132.             Height          =   180
  133.             Left            =   4380
  134.             TabIndex        =   31
  135.             Top             =   705
  136.             Width           =   180
  137.          End
  138.          Begin VB.Label Label13 
  139.             AutoSize        =   -1  'True
  140.             Caption         =   "计算时间:"
  141.             Height          =   180
  142.             Left            =   240
  143.             TabIndex        =   27
  144.             Top             =   720
  145.             Width           =   900
  146.          End
  147.          Begin VB.Label Label11 
  148.             AutoSize        =   -1  'True
  149.             Caption         =   "总工资:"
  150.             Height          =   180
  151.             Left            =   360
  152.             TabIndex        =   25
  153.             Top             =   360
  154.             Width           =   720
  155.          End
  156.       End
  157.       Begin VB.Frame Frame5 
  158.          Caption         =   "扣除项"
  159.          Height          =   1575
  160.          Left            =   120
  161.          TabIndex        =   15
  162.          Top             =   3240
  163.          Width           =   5175
  164.          Begin VB.TextBox Text_GongZi 
  165.             Height          =   270
  166.             Index           =   9
  167.             Left            =   1440
  168.             TabIndex        =   42
  169.             Top             =   1140
  170.             Width           =   1455
  171.          End
  172.          Begin VB.TextBox Text_GongZi 
  173.             Enabled         =   0   'False
  174.             Height          =   270
  175.             Index           =   8
  176.             Left            =   3840
  177.             TabIndex        =   23
  178.             Top             =   720
  179.             Width           =   975
  180.          End
  181.          Begin VB.TextBox Text_GongZi 
  182.             Enabled         =   0   'False
  183.             Height          =   270
  184.             Index           =   7
  185.             Left            =   1440
  186.             TabIndex        =   21
  187.             Top             =   720
  188.             Width           =   975
  189.          End
  190.          Begin VB.TextBox Text_GongZi 
  191.             Enabled         =   0   'False
  192.             Height          =   270
  193.             Index           =   6
  194.             Left            =   3840
  195.             TabIndex        =   19
  196.             Top             =   300
  197.             Width           =   975
  198.          End
  199.          Begin VB.TextBox Text_GongZi 
  200.             Enabled         =   0   'False
  201.             Height          =   270
  202.             Index           =   5
  203.             Left            =   1440
  204.             TabIndex        =   17
  205.             Top             =   300
  206.             Width           =   975
  207.          End
  208.          Begin VB.Label Label15 
  209.             AutoSize        =   -1  'True
  210.             Caption         =   "个人所得税:"
  211.             Height          =   180
  212.             Left            =   240
  213.             TabIndex        =   41
  214.             Top             =   1200
  215.             Width           =   1080
  216.          End
  217.          Begin VB.Label Label10 
  218.             AutoSize        =   -1  'True
  219.             Caption         =   "医疗保险:"
  220.             Height          =   180
  221.             Left            =   2760
  222.             TabIndex        =   22
  223.             Top             =   780
  224.             Width           =   900
  225.          End
  226.          Begin VB.Label Label9 
  227.             AutoSize        =   -1  'True
  228.             Caption         =   "社会保险:"
  229.             Height          =   180
  230.             Left            =   360
  231.             TabIndex        =   20
  232.             Top             =   780
  233.             Width           =   900
  234.          End
  235.          Begin VB.Label Label8 
  236.             AutoSize        =   -1  'True
  237.             Caption         =   "养老保险:"
  238.             Height          =   180
  239.             Left            =   2760
  240.             TabIndex        =   18
  241.             Top             =   360
  242.             Width           =   900
  243.          End
  244.          Begin VB.Label Label7 
  245.             AutoSize        =   -1  'True
  246.             Caption         =   "考勤扣核项:"
  247.             Height          =   180
  248.             Left            =   240
  249.             TabIndex        =   16
  250.             Top             =   360
  251.             Width           =   1080
  252.          End
  253.       End
  254.       Begin VB.Frame Frame4 
  255.          Caption         =   "奖金项"
  256.          Height          =   735
  257.          Left            =   120
  258.          TabIndex        =   10
  259.          Top             =   2400
  260.          Width           =   5175
  261.          Begin VB.TextBox Text_GongZi 
  262.             Enabled         =   0   'False
  263.             Height          =   270
  264.             Index           =   4
  265.             Left            =   1200
  266.             TabIndex        =   14
  267.             Top             =   300
  268.             Width           =   1095
  269.          End
  270.          Begin VB.TextBox Text_GongZi 
  271.             Enabled         =   0   'False
  272.             Height          =   270
  273.             Index           =   3
  274.             Left            =   3480
  275.             TabIndex        =   12
  276.             Top             =   300
  277.             Width           =   855
  278.          End
  279.          Begin VB.Label Label6 
  280.             AutoSize        =   -1  'True
  281.             Caption         =   "加班费:"
  282.             Height          =   180
  283.             Left            =   360
  284.             TabIndex        =   13
  285.             Top             =   360
  286.             Width           =   720
  287.          End
  288.          Begin VB.Label Label5 
  289.             AutoSize        =   -1  'True
  290.             Caption         =   "补贴:"
  291.             Height          =   180
  292.             Left            =   2760
  293.             TabIndex        =   11
  294.             Top             =   360
  295.             Width           =   540
  296.          End
  297.       End
  298.       Begin VB.Frame Frame3 
  299.          Caption         =   "基本工资项"
  300.          Height          =   735
  301.          Left            =   120
  302.          TabIndex        =   5
  303.          Top             =   1560
  304.          Width           =   5175
  305.          Begin VB.TextBox Text_GongZi 
  306.             Enabled         =   0   'False
  307.             Height          =   270
  308.             Index           =   2
  309.             Left            =   3480
  310.             TabIndex        =   9
  311.             Top             =   315
  312.             Width           =   1095
  313.          End
  314.          Begin VB.TextBox Text_GongZi 
  315.             Enabled         =   0   'False
  316.             Height          =   270
  317.             Index           =   1
  318.             Left            =   1320
  319.             TabIndex        =   7
  320.             Top             =   315
  321.             Width           =   1095
  322.          End
  323.          Begin VB.Label Label4 
  324.             AutoSize        =   -1  'True
  325.             Caption         =   "奖金:"
  326.             Height          =   180
  327.             Left            =   2760
  328.             TabIndex        =   8
  329.             Top             =   360
  330.             Width           =   540
  331.          End
  332.          Begin VB.Label Label3 
  333.             AutoSize        =   -1  'True
  334.             Caption         =   "基本工资:"
  335.             Height          =   180
  336.             Left            =   240
  337.             TabIndex        =   6
  338.             Top             =   360
  339.             Width           =   900
  340.          End
  341.       End
  342.       Begin VB.Frame Frame2 
  343.          Caption         =   "基本信息"
  344.          Height          =   1215
  345.          Left            =   120
  346.          TabIndex        =   1
  347.          Top             =   240
  348.          Width           =   5175
  349.          Begin VB.TextBox ZhiWei_GoZi 
  350.             Enabled         =   0   'False
  351.             Height          =   270
  352.             Left            =   3720
  353.             TabIndex        =   40
  354.             Top             =   800
  355.             Width           =   1335
  356.          End
  357.          Begin VB.TextBox BuMen_GoZi 
  358.             Enabled         =   0   'False
  359.             Height          =   270
  360.             Left            =   1080
  361.             TabIndex        =   38
  362.             Top             =   800
  363.             Width           =   1455
  364.          End
  365.          Begin VB.ComboBox YGbianhao_GongZi 
  366.             Height          =   300
  367.             Left            =   1080
  368.             TabIndex        =   36
  369.             Top             =   300
  370.             Width           =   1455
  371.          End
  372.          Begin VB.TextBox XingMing_GongZi 
  373.             Height          =   270
  374.             Left            =   3840
  375.             TabIndex        =   4
  376.             Top             =   300
  377.             Width           =   1215
  378.          End
  379.          Begin VB.Label Label18 
  380.             AutoSize        =   -1  'True
  381.             Caption         =   "*"
  382.             ForeColor       =   &H008080FF&
  383.             Height          =   180
  384.             Left            =   2640
  385.             TabIndex        =   43
  386.             Top             =   360
  387.             Width           =   90
  388.          End
  389.          Begin VB.Label Label14 
  390.             AutoSize        =   -1  'True
  391.             Caption         =   "工作职位:"
  392.             Height          =   180
  393.             Left            =   2760
  394.             TabIndex        =   39
  395.             Top             =   840
  396.             Width           =   900
  397.          End
  398.          Begin VB.Label Label12 
  399.             AutoSize        =   -1  'True
  400.             Caption         =   "工作部门:"
  401.             Height          =   180
  402.             Left            =   120
  403.             TabIndex        =   37
  404.             Top             =   840
  405.             Width           =   900
  406.          End
  407.          Begin VB.Label Label2 
  408.             AutoSize        =   -1  'True
  409.             Caption         =   "员工姓名:"
  410.             Height          =   180
  411.             Left            =   2880
  412.             TabIndex        =   3
  413.             Top             =   360
  414.             Width           =   900
  415.          End
  416.          Begin VB.Label Label1 
  417.             AutoSize        =   -1  'True
  418.             Caption         =   "员工编号:"
  419.             Height          =   180
  420.             Left            =   120
  421.             TabIndex        =   2
  422.             Top             =   360
  423.             Width           =   900
  424.          End
  425.       End
  426.       Begin VB.Label Label23 
  427.          AutoSize        =   -1  'True
  428.          Caption         =   "条记录"
  429.          Height          =   180
  430.          Left            =   4320
  431.          TabIndex        =   50
  432.          Top             =   6120
  433.          Width           =   540
  434.       End
  435.       Begin VB.Label TiaoShu_GZ 
  436.          AutoSize        =   -1  'True
  437.          Height          =   180
  438.          Left            =   4080
  439.          TabIndex        =   49
  440.          Top             =   6120
  441.          Width           =   90
  442.       End
  443.       Begin VB.Label Label21 
  444.          AutoSize        =   -1  'True
  445.          Caption         =   "一共"
  446.          Height          =   180
  447.          Left            =   3600
  448.          TabIndex        =   48
  449.          Top             =   6120
  450.          Width           =   360
  451.       End
  452.    End
  453. End
  454. Attribute VB_Name = "GongZi"
  455. Attribute VB_GlobalNameSpace = False
  456. Attribute VB_Creatable = False
  457. Attribute VB_PredeclaredId = True
  458. Attribute VB_Exposed = False
  459. Dim LieShu_GongZi As Integer
  460. Dim NianShu_GongZi As Integer
  461. Dim YueShu_GongZi As Integer
  462. Dim RiShu_GongZi As Integer
  463. Dim QueDingShu As Integer
  464. Dim RiQi1 As String
  465. Dim RiQi2 As String
  466. 'Dim SQLstr As String
  467. Dim KouChu As Integer
  468. Dim DengJi As Integer
  469. Dim LShbiao_GZ As New ADODB.Recordset
  470. Private Sub Command1_Click()
  471.   GongZibiaoCZ.MoveNext
  472.   If GongZibiaoCZ.EOF Then GongZibiaoCZ.MovePrevious
  473.   textFuZhi_GongZi
  474. End Sub
  475. Private Sub Command2_Click()
  476.   GongZibiaoCZ.MovePrevious
  477.   If GongZibiaoCZ.BOF Then GongZibiaoCZ.MoveNext
  478.   textFuZhi_GongZi
  479. End Sub
  480. Private Sub Form_Load()
  481.   Me.Height = 7620
  482.   Me.Width = 5790
  483.   NianShu_GongZi = 1980
  484.   Do While NianShu_GongZi < 2006
  485.      TexNian_GongZi.AddItem NianShu_GongZi
  486.      NianShu_GongZi = NianShu_GongZi + 1
  487.   Loop
  488.   For YueShu_GongZi = 1 To 12
  489.       TexYue_GongZi.AddItem YueShu_GongZi
  490.   Next YueShu_GongZi
  491.   For RiShu_GongZ = 1 To 31
  492.       TexRi_GongZi.AddItem RiShu_GongZ
  493.   Next RiShu_GongZ
  494.   If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
  495.   GongZibiaoCZ.Open "select * from pay", MySQL, adOpenKeyset, adLockPessimistic
  496.   If LShbiao_GZ.State = adStateOpen Then LShbiao_GZ.Close
  497.   LShbiao_GZ.Open "select gzid from pay group by gzid", MySQL, adOpenKeyset, adLockPessimistic
  498. '  Set YGbianhao_GongZi.RowSource = GongZibiaoCZ
  499. '      YGbianhao_GongZi.BoundColumn = "员工编号"
  500. '      YGbianhao_GongZi.ListField = "员工编号"
  501.   If GongZiChK_PD Then
  502.     YGbianhaoFuZhi_GongZi
  503.     GongZi.Caption = "查看员工工资信息"
  504.     QueDing_GongZi.Visible = False
  505.     QuXiao_GongZi.Left = 2400
  506.     JiSuan_GongZi.Visible = False
  507.     textFuZhi_GongZi
  508. '  ElseIf GongZiXG_PD Then
  509. '    YGbianhaoFuZhi_GongZi
  510. '    GongZi.Caption = "修改员工工资信息"
  511. '    QueDing_GongZi.Caption = "修   改"
  512. '    textFuZhi_GongZi
  513.   ElseIf GongZiShCh_PD Then
  514.     YGbianhaoFuZhi_GongZi
  515.     GongZi.Caption = "删除员工工资信息"
  516.     QueDing_GongZi.Caption = "删   除"
  517.     JiSuan_GongZi.Visible = False
  518.     textFuZhi_GongZi
  519.   ElseIf GongZiTJ_PD Then
  520.     YGbianhaoFuZhi_GongZi
  521.     GongZi.Caption = "添加员工工资信息"
  522.     QueDing_GongZi.Caption = "添   加"
  523.     Label21.Visible = False: TiaoShu_GZ.Visible = False: Label23.Visible = False
  524.     Command2.Visible = False
  525.     Command1.Visible = False
  526. '    Text_GongZi(1).Enabled = False
  527. '    Text_GongZi(5).Enabled = False
  528. '    Text_GongZi(6).Enabled = False
  529.   End If
  530. End Sub
  531. Sub YGbianhaoFuZhi_GongZi()
  532.   If GongZiTJ_PD Then
  533.     If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  534.     ChaKanJB.Open "select ygid from manrecord", MySQL, adOpenKeyset, adLockPessimistic
  535.     Do While Not ChaKanJB.EOF
  536.       YGbianhao_GongZi.AddItem ChaKanJB.Fields(0)
  537.       ChaKanJB.MoveNext
  538.     Loop
  539.   Else
  540.     Do While Not LShbiao_GZ.EOF
  541.       YGbianhao_GongZi.AddItem LShbiao_GZ.Fields(0)
  542.       LShbiao_GZ.MoveNext
  543.     Loop
  544. '    LShbiao_GZ.MoveFirst
  545.   End If
  546. End Sub
  547. Sub textFuZhi_GongZi()
  548.   For LieShu_GongZi = 1 To 10
  549.     If GongZibiaoCZ.Fields(LieShu_GongZi) <> "" Then
  550.       Text_GongZi(LieShu_GongZi) = GongZibiaoCZ.Fields(LieShu_GongZi)
  551.     Else
  552.       Text_GongZi(LieShu_GongZi) = ""
  553.     End If
  554.   Next LieShu_GongZi
  555.   YGbianhao_GongZi.Text = GongZibiaoCZ.Fields(0)
  556.   JiBen_GongZi
  557.   RiQiFuZhi (Trim(Str(GongZibiaoCZ.Fields(11))))
  558.   TexNian_GongZi.Text = Nian
  559.   TexYue_GongZi.Text = Yue
  560.   RishuBH
  561. '  TexRi_GongZi.Text = Ri
  562.   TiaoShu_GZ.Caption = GongZibiaoCZ.RecordCount
  563. End Sub
  564. Sub RishuBH()
  565.   TexRi_GongZi.Clear
  566.   For RiShu_GongZi = 1 To RiShu
  567.     TexRi_GongZi.AddItem RiShu_GongZi
  568.   Next RiShu_GongZi
  569.   TexRi_GongZi.Text = Ri
  570. End Sub
  571. Private Sub Form_Unload(Cancel As Integer)
  572.   If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
  573.   If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  574.   If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
  575.   Set GongZibiaoCZ = Nothing
  576.   Set ChaKanJB = Nothing
  577.   Set KQbiaoCZ = Nothing
  578. End Sub
  579. Private Sub JiSuan_GongZi_Click()
  580.   QueDingShu = MsgBox("请确定你所选择的员工编号和计算时间!", 67, "公司员工管理系统")
  581.   If QueDingShu = 6 Then
  582. '    DengJibiaoCZ.CursorLocation = adUseClient
  583.     If DengJibiaoCZ.State = adStateOpen Then DengJibiaoCZ.Close
  584.       DengJibiaoCZ.Open "select Djgrading from ranking where DJbusi='" & ZhiWei_GoZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  585.       If DengJibiaoCZ.RecordCount = 0 Then
  586.         MsgBox "此职位不存在于职位等级表中!请添加相关项!", 48, "公司员工管理系统"
  587.         Exit Sub
  588.       Else
  589.         DengJi = DengJibiaoCZ.Fields(0)
  590.         Text_GongZi(1) = 800 * DengJibiaoCZ.Fields(0)
  591.         Text_GongZi(3) = 10 * DengJibiaoCZ.Fields(0)
  592.         Text_GongZi(6) = Val(Text_GongZi(1)) * 0.05
  593.         Text_GongZi(7) = Val(Text_GongZi(1)) * 0.02
  594.         Text_GongZi(8) = Val(Text_GongZi(1)) * 0.03
  595.       End If
  596.     RiQi1 = Trim(TexNian_GongZi.Text) & "-" & Trim(TexYue_GongZi.Text) & "-" & 1
  597.     RiQi1 = Format(RiQi1, "yyyy-m-d")
  598.     RiQi2 = Trim(TexNian_GongZi.Text) & "-" & Trim(TexYue_GongZi.Text) & "-" & Trim(TexRi_GongZi)
  599.     RiQi2 = Format(RiQi2, "yyyy-m-d")
  600.     SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
  601.     If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close
  602.     KQbiaoCZ.Open SQLstr, MySQL, adOpenKeyset, adLockPessimistic
  603.     If KQbiaoCZ.RecordCount = 0 Then
  604. '      Text_GongZi(2) = 100
  605.       Text_GongZi(4) = 0
  606.       Text_GongZi(5) = 0
  607.     Else
  608.       Do While Not KQbiaoCZ.EOF
  609.         If GuiZebiaoCZ.State = adStateOpen Then GuiZebiaoCZ.Close: Set GuiZebiaoCZ = Nothing
  610.         GuiZebiaoCZ.Open "select gdmoney,gdrank,gdjiajian from regulate where gdterm='" & KQbiaoCZ.Fields(1) & "'", MySQL, adOpenKeyset, adLockPessimistic
  611.         If GuiZebiaoCZ.RecordCount = 0 Then
  612.           MsgBox "规则表里没有相关奖罚规定!请添加相关规定!", 48, "公司员工管理系统"
  613.           Exit Sub
  614.         Else
  615.           If GuiZebiaoCZ.Fields(2) = 1 Then
  616.               Text_GongZi(4) = Val(Text_GongZi(4)) + GuiZebiaoCZ.Fields(0)
  617.           Else
  618.             If GuiZebiaoCZ.Fields(1) = 1 Then
  619.               Text_GongZi(5) = Val(Text_GongZi(5)) + Val(GuiZebiaoCZ.Fields(0)) * DengJi
  620.             Else
  621.               Text_GongZi(5) = Val(Text_GongZi(5)) + Val(GuiZebiaoCZ.Fields(0))
  622.             End If
  623.           End If
  624.         End If
  625.         KQbiaoCZ.MoveNext
  626.       Loop
  627.     End If
  628.     If Text_GongZi(5) = Str(0) Or Text_GongZi(5) = "" Then
  629.       Text_GongZi(2) = 100
  630.     Else
  631.       Text_GongZi(2) = 0
  632.     End If
  633.     If Val(Text_GongZi(1)) > 1000 Then
  634.       Text_GongZi(9) = Val(Text_GongZi(1)) * 0.08
  635.     Else
  636.       Text_GongZi(9) = 0
  637.     End If
  638.     Text_GongZi(10) = Val(Text_GongZi(1)) + Val(Text_GongZi(2)) + Val(Text_GongZi(3)) + Val(Text_GongZi(4)) - Val(Text_GongZi(5)) - Val(Text_GongZi(6)) _
  639.     - Val(Text_GongZi(7)) - Val(Text_GongZi(8)) - Val(Text_GongZi(9))
  640. '    KQjisuan
  641. '    If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 10 * KQbiaoCZ.RecordCount
  642. '    SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='迟到' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
  643. '    KQjisuan
  644. '    If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 20 * KQbiaoCZ.RecordCount
  645. '    SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='早退' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
  646. '    KQjisuan
  647. '    If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 30 * KQbiaoCZ.RecordCount
  648. '    SQLstr = "select * from checkin where kqid='" & YGbianhao_GongZi & "'and kqoutline='旷工' and (kqdata>='" & RiQi1 & "'and kqdata<='" & RiQi2 & "') "
  649. '    KQjisuan
  650. '    If KQbiaoCZ.RecordCount <> 0 Then KouChu = KouChu + 50 * KQbiaoCZ.RecordCount
  651.     
  652.   End If
  653. End Sub
  654. Private Sub QueDing_GongZi_Click()
  655. '  If QueDing_GongZi.Caption = "修   改" Then
  656. '     QueDingShu = MsgBox("确定修改相关项吗?", 51, "公司员工管理系统")
  657. '     If QueDingShu = 6 Then
  658. '       If YGbianhao_GongZi.Text <> GongZibiaoCZ.Fields(0) Then
  659. '         MsgBox "不能修改员工编号!", 48, "公司员工管理系统"
  660. '         Exit Sub
  661. '       End If
  662. '       ShuJuFuZhi_GongZi
  663. '       GongZibiaoCZ.Update
  664. '     End If
  665.   If QueDing_GongZi.Caption = "删   除" Then
  666.      QueDingShu = MsgBox("确定删除此条记录么?", 51, "公司员工管理系统")
  667.      If QueDingShu = 6 Then
  668.        GongZibiaoCZ.Delete
  669.        GongZibiaoCZ.MoveFirst
  670.        textFuZhi_GongZi
  671.      End If
  672.   ElseIf QueDing_GongZi.Caption = "添   加" Then
  673.      QueDingShu = MsgBox("确定添加此条记录吗?", 51, "公司员工管理系统")
  674.      If QueDingShu = 6 Then
  675. '       If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  676. '       ChaKanJB.Open "select ygid from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  677. '       If ChaKanJB.RecordCount = -1 Then
  678. '         MsgBox "不存在此编号员工的基本信息!" & vbCrLf & "请先添加此编号的员工基本信息!", 48, "公司员工管理系统"
  679. '         Exit Sub
  680. '       End If
  681.        If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
  682.        GongZibiaoCZ.Open "select gzdata from pay where gzid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  683.        If GongZibiaoCZ.RecordCount <> 0 Then
  684.          Do While Not GongZibiaoCZ.EOF
  685.            RiQiFuZhi (GongZibiaoCZ.Fields("gzdata"))
  686.            If TexNian_GongZi = Nian And TexYue_GongZi = Yue Then
  687.              MsgBox "此编号员工的这个月工资信息已经存在!", 48, "公司员工管理系统"
  688.              Exit Sub
  689.            Else
  690.              GongZibiaoCZ.MoveNext
  691.            End If
  692.          Loop
  693.        End If
  694.        If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
  695.        GongZibiaoCZ.Open "pay", MySQL, adOpenKeyset, adLockPessimistic
  696.        GongZibiaoCZ.AddNew
  697.        ShuJuFuZhi_GongZi
  698.        GongZibiaoCZ.Update
  699.      End If
  700.   End If
  701. End Sub
  702. Private Sub QuXiao_GongZi_Click()
  703.   Unload Me
  704. End Sub
  705. Private Sub TexNian_GongZi_Click()
  706.   RiShu = RiJS(Trim(TexNian_GongZi), Trim(TexYue_GongZi))
  707.   RishuBH
  708. End Sub
  709. 'Private Sub Text_GongZi_Change(Index As Integer)
  710. '  If Index <> 1 Then
  711. '    Text_GongZi(10) = Val(Trim(Text_GongZi(2))) + Val(Trim(Text_GongZi(3))) + Val(Trim(Text_GongZi(4))) _
  712. '    + Val(Trim(Text_GongZi(5))) - Val(Trim(Text_GongZi(6))) - Val(Trim(Text_GongZi(7))) - Val(Trim(Text_GongZi(8))) - Val(Trim(Text_GongZi(9)))
  713. '    Text_GongZi(11) = Text_GongZi(10)
  714. '  End If
  715. 'End Sub
  716. Private Sub TexYue_GongZi_Click()
  717.   RiShu = RiJS(Trim(TexNian_GongZi), Trim(TexYue_GongZi))
  718.   RishuBH
  719. End Sub
  720. Private Sub YGbianhao_GongZi_Click()
  721.   If GongZiTJ_PD Then
  722. '    If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  723. '    ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  724. '    Text_GongZi(1).Text = ChaKanJB.Fields(0)
  725.     JiBen_GongZi
  726.     JiSuan_GongZi.Enabled = True
  727.   Else
  728.     If GongZibiaoCZ.State = adStateOpen Then GongZibiaoCZ.Close
  729.     GongZibiaoCZ.Open "select * from pay where gzid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  730.     textFuZhi_GongZi
  731.   End If
  732. End Sub
  733. Sub ShuJuFuZhi_GongZi()
  734.   For LieShu_GongZi = 1 To 10
  735.     GongZibiaoCZ.Fields(LieShu_GongZi) = Trim(Text_GongZi(LieShu_GongZi))
  736.   Next LieShu_GongZi
  737.   GongZibiaoCZ.Fields(0) = YGbianhao_GongZi.Text
  738.   GongZibiaoCZ.Fields(11) = Trim(TexNian_GongZi) & "-" & Trim(TexYue_GongZi) & "-" & Trim(TexRi_GongZi)
  739. End Sub
  740. Sub JiBen_GongZi()
  741.   If ChaKanJB.State = adStateOpen Then ChaKanJB.Close
  742.   ChaKanJB.Open "select ygname from manrecord where ygid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  743.   If ChaKanJB.RecordCount = 0 Then
  744.     MsgBox "没有此编号的员工基本信息!请先添加相关的员工基本信息!", 48, "公司员工管理系统"
  745.     JiSuan_GongZi.Enabled = False
  746.     Exit Sub
  747.   Else
  748.     XingMing_GongZi = ChaKanJB.Fields(0)
  749.   End If
  750.   If GZbiaoCZ.State = adStateOpen Then GZbiaoCZ.Close
  751.   GZbiaoCZ.Open "select wdept,wbusi from manappraise where wid='" & YGbianhao_GongZi & "'", MySQL, adOpenKeyset, adLockPessimistic
  752.   If GZbiaoCZ.RecordCount = 0 Then
  753.     MsgBox "没有此编号的员工工作信息!请先添加相关的员工工作信息!", 48, "公司员工管理系统"
  754.     BuMen_GoZi = ""
  755.     ZhiWei_GoZi = ""
  756.     JiSuan_GongZi.Enabled = False
  757.     Exit Sub
  758.   Else
  759.     BuMen_GoZi = GZbiaoCZ.Fields(0)
  760.     ZhiWei_GoZi = GZbiaoCZ.Fields(1)
  761.   End If
  762. End Sub
  763. Private Sub YGbianhao_GongZi_LostFocus()
  764.   JiSuan_GongZi.Enabled = True
  765.   JiBen_GongZi
  766. End Sub
  767. 'Sub KQjisuan()
  768. '  If KQbiaoCZ.State = adStateOpen Then KQbiaoCZ.Close: Set KQbiaoCZ = Nothing
  769. '  KQbiaoCZ.Open SQLstr, MySQL, adOpenKeyset, adLockPessimistic
  770. 'End Sub