📄 frm_rndtimecard00.frm
字号:
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 1
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
bgtm = DTPicker1(0).Value & " " & SETIMER1(6).Text
t1 = DateDiff("n", SETIMER1(6).Text, SETIMER1(7).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 0
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
MsgBox "ok!"
Case 1
strSQL2 = "delete from emplytmp"
mDB.ExecuteSQL strSQL2
For i = 0 To List1.ListCount - 1
strSQL2 = "insert into emplytmp select emplyid,serial from emply,depart where depart.dptid=emply.dptid and emply.empcrdyn=1 and dptname ='" & List1.List(i) & "'"
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
Next i
'GurhanButton1(0).BackColor = vbBlue
'GurhanButton1(0).BackColor = &H8000000F
'Dim mancount As Integer
strSQL2 = "select * from emplytmp"
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
mancount = adoprimaryRS2.RecordCount
'strSQL2 = "select emplytmp.emplyid,emplytmp.serial from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "' amd ((outdate is null) or (outdate<'" & DTPicker1(0).Value & "'))"
strSQL2 = "delete from emplytp"
mDB.ExecuteSQL strSQL2
'strSQL2 = "insert into emplytp select emplytmp.emplyid,emplytmp.serial from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "' and outdate<='" & DTPicker1(0).Value & "'"
strSQL2 = "insert into emplytp select emplytmp.emplyid,emplytmp.serial,outdate from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "'"
mDB.ExecuteSQL strSQL2
'strSQL2 = "select emplytp.emplyid,serial from emplytp,emply2 where emplytp.emplyid=emply2.emplyid and ((outdate is null) or (outdate>'" & DTPicker1(0).Value & "'))"
strSQL2 = "select emplytp.emplyid,serial from emplytp where (outdate is null) or (outdate>'" & DTPicker1(0).Value & "')"
Debug.Print DTPicker1(0).Value
Debug.Print strSQL2
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
If adoprimaryRS2.RecordCount = 0 Then
MsgBox "你所选择的部门无员工,请重新选择。谢谢。", vbOKOnly, "NewAsia"
Exit Sub
Else
MsgBox "共有" & mancount & "_" & adoprimaryRS2.RecordCount & "人参与考勤", vbOKOnly, "NewAsia"
End If
bgtm = DTPicker1(0).Value & " " & SETIMER1(0).Text
t1 = DateDiff("n", SETIMER1(0).Text, SETIMER1(1).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 1
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
bgtm = DTPicker1(0).Value & " " & SETIMER1(2).Text
t1 = DateDiff("n", SETIMER1(2).Text, SETIMER1(3).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 0
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
bgtm = DTPicker1(0).Value & " " & SETIMER1(4).Text
t1 = DateDiff("n", SETIMER1(4).Text, SETIMER1(5).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 1
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
bgtm = DTPicker1(0).Value & " " & SETIMER1(6).Text
t1 = DateDiff("n", SETIMER1(6).Text, SETIMER1(7).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 0
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 0
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
MsgBox "ok!"
''GurhanButton1(0).BackColor = &H8000000F
''GurhanButton1(1).BackColor = vbBlue
'SQLtmp10.Show
Case 2
SQLtmp2.Show
Case 3
'Dim mancount As Integer
strSQL2 = "delete from emplytmp"
mDB.ExecuteSQL strSQL2
For i = 0 To List1.ListCount - 1
strSQL2 = "insert into emplytmp select emplyid,serial from emply,depart where depart.dptid=emply.dptid and emply.empcrdyn=1 and dptname ='" & List1.List(i) & "'"
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
Next i
strSQL2 = "select * from emplytmp"
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
mancount = adoprimaryRS2.RecordCount
'strSQL2 = "select emplytmp.emplyid,emplytmp.serial from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "' amd ((outdate is null) or (outdate<'" & DTPicker1(0).Value & "'))"
strSQL2 = "delete from emplytp"
mDB.ExecuteSQL strSQL2
'strSQL2 = "insert into emplytp select emplytmp.emplyid,emplytmp.serial from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "'"
strSQL2 = "insert into emplytp select emplytmp.emplyid,emplytmp.serial,outdate from emplytmp,emply2 where emplytmp.emplyid=emply2.emplyid and indate<='" & DTPicker1(0).Value & "'"
mDB.ExecuteSQL strSQL2
strSQL2 = "select emplytp.emplyid,serial from emplytp where (outdate is null) or (outdate>'" & DTPicker1(0).Value & "')"
Debug.Print strSQL2
Set adoprimaryRS2 = mDB.adoprimaryRS(strSQL2)
If adoprimaryRS2.RecordCount = 0 Then
MsgBox "你所选择的部门无员工,请重新选择。谢谢。", vbOKOnly, "NewAsia"
Exit Sub
Else
MsgBox "共有" & mancount & "_" & adoprimaryRS2.RecordCount & "人参与考勤", vbOKOnly, "NewAsia"
End If
'strSQL2 = "delete from emplytmp"
'mDB.ExecuteSQL strSQL2
'
'For i = 0 To List1.ListCount - 1
'strSQL2 = "insert into emplytmp select emplyid,serial from emply,depart where depart.dptid=emply.dptid and emply.empcrdyn=1 and dptname ='" & List1.List(i) & "'"
'Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
'Next i
'
''GurhanButton1(0).BackColor = vbBlue
''GurhanButton1(0).BackColor = &H8000000F
'
'strSQL2 = "select * from emplytmp"
'Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
'
'strSQL2 = "select * from emplytmp"
'Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
'If adoPrimaryRS2.RecordCount = 0 Then
'MsgBox "你所选择的部门无员工,请重新选择。谢谢。", vbOKOnly, "NewAsia"
'Exit Sub
'Else
'MsgBox "共有" & adoprimaryRS.RecordCount & "人参与考勤", vbOKOnly, "NewAsia"
'End If
bgtm = DTPicker1(0).Value & " " & SETIMER1(8).Text
t1 = DateDiff("n", SETIMER1(8).Text, SETIMER1(9).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 1
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 1
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
bgtm = DTPicker1(0).Value & " " & SETIMER1(10).Text
t1 = DateDiff("n", SETIMER1(10).Text, SETIMER1(11).Text)
adoprimaryRS2.MoveFirst
Do Until adoprimaryRS2.EOF
With adoprimaryRS
.AddNew
.Fields("crdtmid").Value = Maxid + 1
.Fields("emplyid").Value = adoprimaryRS2.Fields("emplyid").Value
.Fields("empcrdno").Value = adoprimaryRS2.Fields("serial").Value
.Fields("deviceid").Value = Int(Rnd * 2) + 1
.Fields("reasonid").Value = 0
.Fields("inorout").Value = 0
.Fields("cdatetime").Value = DateAdd("n", Int(t1 * Rnd) + 1, bgtm)
.Fields("isovertime").Value = 1
.Fields("recordtype").Value = 0
.Fields("operid").Value = "000001"
.Update
End With
Maxid = Maxid + 1
adoprimaryRS2.MoveNext
Loop
Case 4
GurhanButton1(0).BackColor = vbBlue
GurhanButton1(0).BackColor = &H8000000F
End Select
End Sub
''''=======================================================
Private Sub List1_Click()
End Sub
Private Sub List1_DblClick()
List1.RemoveItem List1.ListIndex
End Sub
Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
'If Button = 2 Then List1.Clear
If Button = 2 Then
''List1.Clear
Dim i As Integer
Dim lTmp As Long
On Error Resume Next
lTmp = oMenu.Popup("清除选定")
If lTmp = 1 Then
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
''Debug.Print Val(Left(list1(0).List(I), InStr(list1(0).List(I), ",") - 1))
'strSQL3 = "update j_fac set ifx=false where fac_id=" & Val(Left(List1(0).List(i), InStr(List1(0).List(i), ",") - 1))
'mDB.ExecuteSQL strSQL3
''List1(1).AddItem List1(0).List(i)
'List1.RemoveItem List1.List(i)
List1.RemoveItem List1.ListIndex
End If
Next i
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -