📄 frm_rndtimecard.frm
字号:
EndProperty
MouseIcon = "frm_Rndtimecard.frx":08D2
MousePointer = 99
XPStyle = -1 'True
End
Begin GButton.GurhanButton GurhanButton1
Height = 855
Index = 1
Left = 5760
TabIndex = 18
Top = 1755
Width = 1335
_ExtentX = 2355
_ExtentY = 1508
Caption = "早中晚四次 "
OriginalPicSizeW= 0
OriginalPicSizeH= 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_Rndtimecard.frx":0BEC
MousePointer = 99
XPStyle = -1 'True
End
Begin GButton.GurhanButton GurhanButton1
Height = 855
Index = 2
Left = 5760
TabIndex = 19
Top = 2805
Width = 1335
_ExtentX = 2355
_ExtentY = 1508
Caption = "全部加班 "
OriginalPicSizeW= 0
OriginalPicSizeH= 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_Rndtimecard.frx":0F06
MousePointer = 99
XPStyle = -1 'True
End
Begin GButton.GurhanButton GurhanButton1
Height = 855
Index = 3
Left = 5760
TabIndex = 20
Top = 3840
Width = 1335
_ExtentX = 2355
_ExtentY = 1508
Caption = "部分加班 "
OriginalPicSizeW= 0
OriginalPicSizeH= 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_Rndtimecard.frx":1220
MousePointer = 99
XPStyle = -1 'True
End
Begin GButton.GurhanButton cmdright
Height = 1935
Left = 2520
TabIndex = 34
Top = 960
Width = 780
_ExtentX = 1376
_ExtentY = 3413
Caption = ""
Picture = "frm_Rndtimecard.frx":153A
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_Rndtimecard.frx":198C
MousePointer = 99
End
Begin GButton.GurhanButton cmdleft
Height = 2295
Left = 2520
TabIndex = 35
Top = 2880
Width = 780
_ExtentX = 1376
_ExtentY = 4048
Caption = ""
Picture = "frm_Rndtimecard.frx":1CA6
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "frm_Rndtimecard.frx":20F8
MousePointer = 99
End
End
Attribute VB_Name = "frm_Rndtimecard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mDB As New mDB
'Dim strConn As String
'Dim strConn0 As String
Dim strSQL As String
Dim WithEvents adoprimaryRS As ADODB.Recordset
Attribute adoprimaryRS.VB_VarHelpID = -1
Dim strSQL2 As String
Dim WithEvents adoPrimaryRS2 As ADODB.Recordset
Attribute adoPrimaryRS2.VB_VarHelpID = -1
Dim strSQL3 As String
Dim WithEvents adoPrimaryRS3 As ADODB.Recordset
Attribute adoPrimaryRS3.VB_VarHelpID = -1
Dim strSQL4 As String
Dim WithEvents adoprimaryRS4 As ADODB.Recordset
Attribute adoprimaryRS4.VB_VarHelpID = -1
Dim mvList() As String
Dim db As ADODB.Connection
Private Sub Database_Refresh(xMode As Integer)
On Error Resume Next
Set db = New ADODB.Connection
db.CursorLocation = adUseClient
db.ConnectionString = strconnDR
db.Open '连接数据库
If xMode = 0 Then
Set adoprimaryRS = New ADODB.Recordset
adoprimaryRS.Open strSQL, db, adOpenStatic, adLockOptimistic
ElseIf xMode = 1 Then
Set adoPrimaryRS2 = New ADODB.Recordset
adoPrimaryRS2.Open strSQL2, db, adOpenStatic, adLockOptimistic
ElseIf xMode = 2 Then
Set adoPrimaryRS3 = New ADODB.Recordset
adoPrimaryRS3.Open strSQL3, db, adOpenStatic, adLockOptimistic
ElseIf xMode = 3 Then
Set adoprimaryRS4 = New ADODB.Recordset
adoprimaryRS4.Open strSQL4, db, adOpenStatic, adLockOptimistic
End If
End Sub
Private Sub cmdright_Click()
Dim i As Integer
On Error Resume Next
For i = 0 To List2.ListCount - 1
If List2.Selected(i) = True Then
judgeList List1, List2.List(i)
'List1.Selected(List1.ListCount - 1) = True
End If
Next i
For i = 0 To List2.ListCount - 1
If List2.Selected(i) = True Then
List2.RemoveItem List2.ListIndex
End If
Next i
End Sub
Private Sub cmdleft_Click()
Dim i As Integer
On Error Resume Next
For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then
' 'strSQL3 = "update j_fac set ifx=true where fac_id=" & Val(Left(list1(1).List(i), InStr(list1(1).List(i), ",") - 1))
' strSQL3 = "update gongxu set flg=false where htcode='" & DataCombo1.Text & "' and htcode_pro='" & Left(List1(1).List(i), InStr(List1(1).List(i), ",") - 1) & "'"
' mDB.ExecuteSQL strSQL3
'' List1.RemoveItem List1.List(i)
judgeList List2, List1.List(i)
'List12.AddItem List1.List(i)
'List2.Selected(List2.ListCount - 1) = True
End If
Next i
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
'i = i + 1
End If
Next i
' DataCombo1_Click 2
'Reload_PrimaryRS 1
End Sub
Private Sub DataCombo1_Click(Index As Integer, Area As Integer)
Select Case Index
Case 0
If DataCombo1(0).Text <> "" Then
'List1.AddItem DataCombo1(0).Text
judgeList List1, DataCombo1(0).Text
End If
End Select
End Sub
Private Sub Form_Load()
Screen.MousePointer = vbHourglass
'strConn = SQLcon
'strConn0 = SQLcon0
Set mDB = New mDB
mDB.InitDB_RY strconnDR
'Debug.Print strconnDR
strSQL = "select dptid,dptname from depart where ify=1 order by dptname asc"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
'Debug.Print adoprimaryRS.RecordCount
With DataCombo1(0)
Set .RowSource = adoprimaryRS
.BoundColumn = "dptid"
.ListField = "dptname"
.Refresh
End With
With adoprimaryRS
.MoveFirst
Do Until .EOF
List1.AddItem .Fields("dptname").Value
.MoveNext
Loop
End With
strSQL = "select max(cdatetime) as maxdate from empcrdtm" '' order by begdate asc"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
DTPicker1(0).Value = Format(adoprimaryRS.Fields("maxdate").Value + 1, "yyyy-mm-dd") ''' Date
' DTPicker1(1).Value = Date
' Option1(0).Value = True
' SETIMER1(0).Text = "00:00:01"
' SETIMER1(1).Text = "23:59:59"
' strSQL = "select * from wktm2" '' order by begdate asc"
strSQL = "select * from wktm where wktmid=2"
Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
SETIMER1(0).Text = TimeSerial(Hour(adoprimaryRS("bgnwktm1").Value), Minute(adoprimaryRS("bgnwktm1").Value), 0) '''' "00:00:01"
SETIMER1(1).Text = TimeSerial(Hour(adoprimaryRS("bgntm1").Value), Minute(adoprimaryRS("bgntm1").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(2).Text = TimeSerial(Hour(adoprimaryRS("endtm1").Value), Minute(adoprimaryRS("endtm1").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(3).Text = TimeSerial(Hour(adoprimaryRS("endwktm1").Value), Minute(adoprimaryRS("endwktm1").Value), 0) '''' "00:00:01"
SETIMER1(4).Text = TimeSerial(Hour(adoprimaryRS("bgnwktm2").Value), Minute(adoprimaryRS("bgnwktm2").Value), 0) '''' "00:00:01"
SETIMER1(5).Text = TimeSerial(Hour(adoprimaryRS("bgntm2").Value), Minute(adoprimaryRS("bgntm2").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(6).Text = TimeSerial(Hour(adoprimaryRS("endtm2").Value), Minute(adoprimaryRS("endtm2").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(7).Text = TimeSerial(Hour(adoprimaryRS("endwktm2").Value), Minute(adoprimaryRS("endwktm2").Value), 0) '''' "00:00:01"
SETIMER1(8).Text = TimeSerial(Hour(adoprimaryRS("bgnwktm3").Value), Minute(adoprimaryRS("bgnwktm3").Value), 0) '''' "00:00:01"
SETIMER1(9).Text = TimeSerial(Hour(adoprimaryRS("bgntm3").Value), Minute(adoprimaryRS("bgntm3").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(10).Text = TimeSerial(Hour(adoprimaryRS("endtm3").Value), Minute(adoprimaryRS("endtm3").Value), 0) '''' "00:00:01""23:59:59"
SETIMER1(11).Text = TimeSerial(Hour(adoprimaryRS("endwktm3").Value), Minute(adoprimaryRS("endwktm3").Value), 0) '''' "00:00:01"
CenterForm Me
' Debug.Print DateDiff("n", SETIMER1(0).Text, SETIMER1(1).Text)
'''''''将人员表数据导入sqlserver数据库
''strSQL2 = "delete from emply2"
''Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
''''''''''***********************************一定要是ACCESS等桌面数据库,绝对位置,单引号***********************************
'' Dim MD As New mDB
'' MD.InitDB
'' strSQL = "select * into emppp in 'e:\sjk\data\hisdata1.mdb' from emply2"
''' adoprimaryRS.Save emp.rst
''MD.MakeTables strSQL, "emppp"
''''
''strSQL = "select * from emppp"
''MD.CreateRS adoprimaryRS, strSQL
''''''''''**********************************************************************
''Debug.Print adoprimaryRS.RecordCount
''
''strSQL2 = "select * from emply2"
''Set adoPrimaryRS2 = mDB.adoprimaryRS(strSQL2)
''With adoprimaryRS
'' .MoveFirst
''Do Until .EOF
'' adoPrimaryRS2.AddNew
'' adoPrimaryRS2.Fields("ifin").Value = .Fields("ifin").Value
'' adoPrimaryRS2.Fields("partname").Value = .Fields("partname").Value
'' adoPrimaryRS2.Fields("emplyid").Value = "00" & .Fields("emplyid").Value
'' adoPrimaryRS2.Fields("emplyname").Value = .Fields("emplyname").Value
'' adoPrimaryRS2.Fields("indate").Value = .Fields("indate").Value
'' adoPrimaryRS2.Fields("outdate").Value = .Fields("outdate").Value
'' adoPrimaryRS2.Fields("gangwei").Value = .Fields("gangwei").Value
'' adoPrimaryRS2.Update
'' .MoveNext
''Loop
''End With
''Set MD = Nothing
'strSQL = "select dptname as 部门,emplyid as 工号,emplyname as 姓名,serial as 卡序列号 from depart,emply where depart.dptid=emply.dptid"
'
'Dim o As New ToExcel
''strSQL = "select * from emply where emplyid not in (select emplyid from emply2)"
'Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
'Debug.Print adoprimaryRS.RecordCount
'o.ToExcel adoprimaryRS, "不匹配", "不在新表中"
'
'strSQL = "select * from emply2 where emplyid not in (select emplyid from emply)"
'Set adoprimaryRS = mDB.adoprimaryRS(strSQL)
'Debug.Print adoprimaryRS.RecordCount
'o.ToExcel adoprimaryRS, "不匹配", "不在表中"
'Set o = Nothing
'
strSQL = "select * from emply" ''''2 where emplyid not in (select emplyid from emply)"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -