⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_rpt_kaoqinyc.frm

📁 考勤系统,智能判断刷卡异常,是一大型ERP系统的一个分支
💻 FRM
📖 第 1 页 / 共 4 页
字号:
                .GetFindV2 "请输入特殊原因备注和工时:", "特殊原因:", "工时:"
                sTmp = .GetFindVar1
                iHour = Val(.GetFindVar2)
                End With
                
                If sTmp <> "" Then
                strSQL = "insert into Yuanyin(emplyid,yuanyinLX,Djdate,hours,ratifier,makeid,bzsm) values('" & DataGrid1.Columns(0).Text & "','特殊原因','" & DataGrid1.Columns(2).Text & "'," & iHour & ",'" & UserName & "','" & OperID & "','" & sTmp & "')"
                mDB.ExecuteSQL strSQL
        strSQL = "update wktmrslt set QueRen=4,latertime1=0,earlytime1=0,latertime2=0,earlytime2=0,datwktm=" & standwktm & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
      mDB.ExecuteSQL strSQL
      Toolbar1_ButtonClick Toolbar1.Buttons(3)
                Else
                
                Exit Sub
                End If
            Case 3
            ''''''''''''''漏刷卡;(不扣工时)
               With sForm
                .GetFindV2 "请输入漏刷卡原因备注和工时:", "漏刷卡原因:", "工时:"
                sTmp = .GetFindVar1
                iHour = Val(.GetFindVar2)
                End With
                
                If sTmp <> "" Then
                strSQL = "insert into Yuanyin(emplyid,yuanyinLX,Djdate,hours,ratifier,makeid,bzsm) values('" & DataGrid1.Columns(0).Text & "','漏刷卡','" & DataGrid1.Columns(2).Text & "'," & iHour & ",'" & UserName & "','" & OperID & "','" & sTmp & "')"
                mDB.ExecuteSQL strSQL
        strSQL = "update wktmrslt set QueRen=6,datwktm=" & standwktm & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
      mDB.ExecuteSQL strSQL
      Toolbar1_ButtonClick Toolbar1.Buttons(3)
                Else
                
                Exit Sub
                End If
              Case 5
              ''''''''''请假;(扣工时)
            strSQL = "select holidayid,holidaydecs from holidaykind"
            Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
                With Frm_Kao_holiday
                .endtm1 = endtm1
                .bgtm2 = bgntm2
                
                  .txtFields(0).Text = DataGrid1.Columns(0).Text
                    .txtFields(1).Text = DataGrid1.Columns(1).Text
                    .Check1 = 1
                    .DTPicker1(0).Value = DataGrid1.Columns(2).Text
                    .DTPicker1(1).Value = DataGrid1.Columns(2).Text
                    '.txtFields(2).Text = DataGrid1.Columns(0).Text
                   Set .DataCombo1(0).RowSource = adoprimaryRS
                   .DataCombo1(0).BoundColumn = "holidayid"
                   .DataCombo1(0).ListField = "holidaydecs"
                   .DataCombo1(0).Refresh
                   
                    .txtFields(3).Text = UserName
                    .Show vbModal
                End With
            
          
            
            Case 6
            '''''''''''''''休息;(扣工时)
               With sForm
                .GetFindV2 "请输入原因备注和调休工时:", "调休原因:", "调休工时:"
                sTmp = .GetFindVar1
                iHour = Val(.GetFindVar2)
                End With
                
                If sTmp <> "" Then
                If standwktm - iHour - tDatWktm < 0.1 Then
                    strSQL = "insert into Yuanyin(emplyid,yuanyinLX,Djdate,hours,ratifier,makeid,bzsm) values('" & DataGrid1.Columns(0).Text & "','调休','" & DataGrid1.Columns(2).Text & "'," & iHour & ",'" & UserName & "','" & OperID & "','" & sTmp & "')"
                    mDB.ExecuteSQL strSQL
                    strSQL = "update wktmrslt set QueRen=3,holidaysum=" & standwktm - tDatWktm & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
                    mDB.ExecuteSQL strSQL
                    Toolbar1_ButtonClick Toolbar1.Buttons(3)
                Else
                MsgBox "你确认的休息时间不够。请退出重新确认。"
                Exit Sub
                
                End If
                Else
                
                Exit Sub
                End If
            
            Case 7
            ''''''''(迟到、早退、旷工);(扣工时)在核算时已经扣工时,在此不变;
            
            If MsgBox("", vbYesNo) = vbYes Then
            strSQL = "update wktmrslt set QueRen=7 where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
            mDB.ExecuteSQL strSQL
            Toolbar1_ButtonClick Toolbar1.Buttons(3)
            
            End If
            
            Case 8
            ''''''''(迟到、早退、旷工)+漏刷卡;(扣工时)只扣(迟到、早退、旷工)部分工时;
            If MsgBox("", vbYesNo) = vbYes Then
            strSQL = "update wktmrslt set QueRen=7,datwktm=" & standwktm - tLaterEarly & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
            mDB.ExecuteSQL strSQL
            Toolbar1_ButtonClick Toolbar1.Buttons(3)
            
            End If
            
'With sForm
' .GetFindV2 "请输入原因备注或处理建议:", "原因:", "工时:"
' sTmp = .GetFindVar1
' iHour = Val(.GetFindVar2)
' End With
'
' If sTmp <> "" Then
' strSQL = "insert into Yuanyin(emplyid,yuanyinLX,Djdate,hours,ratifier,makeid,bzsm) values('" & DataGrid1.Columns(0).Text & "','无原因','" & DataGrid1.Columns(2).Text & "'," & iHour & ",'" & UserName & "','" & OperID & "','" & sTmp & "')"
' mDB.ExecuteSQL strSQL
'strSQL = "update wktmrslt set QueRen=7 where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
'mDB.ExecuteSQL strSQL
'Toolbar1_ButtonClick Toolbar1.Buttons(3)
' Else
'
' Exit Sub
' End If
            Case 10
    
                'strSQL = "select dptname as 部门,empcrdtm.emplyid as 工号,emplyname as 姓名,cdatetime as 时间 from depart,emply,empcrdtm where depart.dptid=emply.dptid and emply.emplyid=empcrdtm.emplyid and emply.emplyid='" & DataGrid1.Columns(0).Text & "' and cdatetime between '" & DTPicker1(0).Value & " 05:01:00' and '" & DTPicker1(1).Value + 1 & "  05:00:00'"         '' order by empcrdtm.emplyid,cdatetime"
                strSQL = "select dptname as 部门,empcrdtm.emplyid as 工号,emplyname as 姓名,cdatetime as 时间 from depart,emply,empcrdtm where depart.dptid=emply.dptid and emply.emplyid=empcrdtm.emplyid and emply.emplyid='" & DataGrid1.Columns(0).Text & "' and cdatetime between '" & bgnwktm1 & "' and '" & bgnwktm1END & "'"         '' order by empcrdtm.emplyid,cdatetime"
                Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
                Dim frmY As New NM_Bas
                With frmY
                    .Caption = DataGrid1.Columns(1).Text & DataGrid1.Columns(2).Text & "--原始考勤记录"
                    .reload_datagrid adoprimaryRS
                    .Show vbModal
                End With
                Set frmY = Nothing
    
        End Select
        
        
        
    
    End If
    Exit Sub
Err1:
    MsgBox Err.Description
End Sub
Public Sub DJ_holiday()
With Frm_Kao_holiday
      If .bSave Then
      strSQL = "select * from holidayreg where 1=2"
      Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
      adoprimaryRS.AddNew
      adoprimaryRS.Fields("emplyid").Value = .txtFields(0).Text
      adoprimaryRS.Fields("holidayid").Value = .DataCombo1(0).BoundText
      If .Check1 = 1 Then
      adoprimaryRS.Fields("bgndatetime").Value = .DTPicker1(0).Value
      adoprimaryRS.Fields("enddatetime").Value = .DTPicker1(1).Value
      adoprimaryRS.Fields("isday").Value = 1
      
      Else
      adoprimaryRS.Fields("bgndatetime").Value = .DTPicker1(0).Value & " " & .SETIMER1(0).Text
      adoprimaryRS.Fields("enddatetime").Value = .DTPicker1(1).Value & " " & .SETIMER1(1).Text
      adoprimaryRS.Fields("isday").Value = 0
      End If
        adoprimaryRS.Fields("makeid").Value = emplyid
        adoprimaryRS.Fields("hours").Value = IIf(.txtFields(2).Text = "", 0, .txtFields(2).Text)
        adoprimaryRS.Fields("ratifier").Value = .txtFields(3).Text
        adoprimaryRS.Fields("bzsm").Value = .txtFields(4).Text
        adoprimaryRS.Update
        '''strSQL = "update wktmrslt set QueRen=1 where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
        strSQL = "update wktmrslt set QueRen=1,latertime1=0,earlytime1=0,latertime2=0,earlytime2=0,holidaysum=" & IIf(.txtFields(2).Text = "", 0, .txtFields(2).Text) & ",datwktm=" & standwktm - IIf(.txtFields(2).Text = "", 0, .txtFields(2).Text) & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
      mDB.ExecuteSQL strSQL
      Toolbar1_ButtonClick Toolbar1.Buttons(3)

      End If
End With
Unload Frm_Kao_holiday
End Sub
Public Sub DJ_evection()
With Frm_Kao_Evection
      If .bSave Then
      strSQL = "select * from evectionreg where 1=2"
      Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
      adoprimaryRS.AddNew
      adoprimaryRS.Fields("emplyid").Value = .txtFields(0).Text
      adoprimaryRS.Fields("evectionid").Value = .DataCombo1(0).BoundText
      If .Check1 = 1 Then
      adoprimaryRS.Fields("bgndatetime").Value = .DTPicker1(0).Value
      adoprimaryRS.Fields("enddatetime").Value = .DTPicker1(1).Value
      adoprimaryRS.Fields("isday").Value = 1
      
      Else
      adoprimaryRS.Fields("bgndatetime").Value = .DTPicker1(0).Value & " " & .SETIMER1(0).Text
      adoprimaryRS.Fields("enddatetime").Value = .DTPicker1(1).Value & " " & .SETIMER1(1).Text
      adoprimaryRS.Fields("isday").Value = 0
      End If
        adoprimaryRS.Fields("makeid").Value = emplyid
        adoprimaryRS.Fields("hours").Value = IIf(.txtFields(2).Text = "", 0, .txtFields(2).Text)
        adoprimaryRS.Fields("ratifier").Value = .txtFields(3).Text
        adoprimaryRS.Fields("bzsm").Value = .txtFields(4).Text
        adoprimaryRS.Update
'        strSQL = "update wktmrslt set QueRen=2 where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
        strSQL = "update wktmrslt set QueRen=2,latertime1=0,earlytime1=0,latertime2=0,earlytime2=0,evectionsum=" & IIf(.txtFields(2).Text = "", 0, .txtFields(2).Text) & ",datwktm=" & standwktm & " where emplyid='" & DataGrid1.Columns(0).Text & "' and caldate='" & DataGrid1.Columns(2).Text & "'"
      mDB.ExecuteSQL strSQL
      Toolbar1_ButtonClick Toolbar1.Buttons(3)

      End If
End With
Unload Frm_Kao_Evection
End Sub
Private Sub DTPicker1_CloseUp(Index As Integer)
    Dim d As Date
    Dim d1 As Date
    Select Case Index
        Case 0
            d = DTPicker1(0).Value
            d1 = DateAdd("m", 1, d)
            DTPicker1(1).Value = DTPicker1(0).Value       ''' DateSerial(Year(d1), Month(d1), 1) - 1

        Case 1
    End Select

End Sub

    ' =====================================================

    ' =====================================================
    ' =====================================================
    ' =====================================================



    ' =====================================================

Private Sub Form_Load()
    Set mDB = New mDB
    
    strconnDR = SQLConnKQ
    
    mDB.InitDB_RY strconnDR
    '    mDB.InitDB_RY SQLConnDR

    '    SaveSetting "temp", "tempint", "tmpi", 2
    
'Frm_Login.Show vbModal

strSQL = "select count(*) from depart where managerid='" & emplyid & "'"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
If adoprimaryRS(0).Value = 0 Then
MsgBox "没有部门需要你确认,请联系管理员。"
End
End If



    ''strSQL = "select dptid,dptname from depart"
    '    strSQL = "select dptid,dptname from depart where ify=1 order by dptname asc"
    'Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
    '
    '        With DataCombo1
    '            Set .RowSource = adoprimaryRS
    '            .BoundColumn = "dptID"
    '            .ListField = "dptname"
    '           .Refresh
    '        End With





'    Me.Move 0, 0, width00 - 80, height00 - 80

    'strSQL4 = "select ID,iYear,iMonth,emplyid,emplyname,iFen,iDay from NM_ZaGong where iYear=" & Combo1(0).Text & " and iMonth=" & Combo1(1).Text
    'Set adoprimaryRS4 = mDB.adoprimaryRS(strSQL4)
    '
    '
    ''Reload_DataGrid
    'Toolbar1_ButtonClick Toolbar1.Buttons(3)

    'Option1(0).Value = True
    Option2(1).Value = True

    sFldString = GetSqlString()
    DTPicker1(0).Value = Date - 8    ''''' DateSerial(Year(Date), Month(Date), 1)
    DTPicker1(1).Value = Date - 1

Toolbar1_ButtonClick Toolbar1.Buttons(3)

End Sub




Private Sub Form_Resize()
    If Me.height < 2000 Then Exit Sub
    Frame1.width = Me.width - 300 - 2060
    DataGrid1.Move 100, 1440, Frame1.width + 2060, Me.height - 1880
End Sub

    ' =====================================================

    
    ' =====================================================

Private Sub Form_Unload(Cancel As Integer)
    mDB.KillDB
    Set mDB = Nothing
End Sub









Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    On Error GoTo Err1

    Select Case Button.Index
        Case 1


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -