📄 frmrpttimepos_d.frm
字号:
VERSION 5.00
Object = "{E11E7285-4386-40E5-A4D4-F55704D4D491}#1.0#0"; "sSuperGrid.ocx"
Begin VB.Form frmRptTimePos_D
BorderStyle = 3 'Fixed Dialog
Caption = "Form1"
ClientHeight = 5295
ClientLeft = 45
ClientTop = 450
ClientWidth = 8715
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5295
ScaleWidth = 8715
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin SSUPERGRIDLib.SSuperGrid Grid
Height = 4110
Left = 90
TabIndex = 0
Top = 1080
Width = 8520
_Version = 65536
_ExtentX = 15028
_ExtentY = 7250
_StockProps = 132
End
Begin VB.Label lblCode
AutoSize = -1 'True
Caption = "会员卡号:"
Height = 195
Left = 2520
TabIndex = 6
Top = 420
Width = 900
End
Begin VB.Label lblName
AutoSize = -1 'True
Caption = "会员名称:"
Height = 195
Left = 405
TabIndex = 5
Top = 420
Width = 900
End
Begin VB.Label lblDate
AutoSize = -1 'True
Caption = "当前日期:"
Height = 195
Left = 405
TabIndex = 4
Top = 135
Width = 900
End
Begin VB.Label lblWeekday
AutoSize = -1 'True
Caption = "星期:"
Height = 195
Left = 2520
TabIndex = 3
Top = 135
Width = 540
End
Begin VB.Label lblClassID
AutoSize = -1 'True
Caption = "班次组合:"
Height = 195
Left = 2520
TabIndex = 2
Top = 720
Width = 900
End
Begin VB.Label lblCardCount
AutoSize = -1 'True
Caption = "刷卡次数 :"
Height = 195
Left = 405
TabIndex = 1
Top = 720
Width = 945
End
End
Attribute VB_Name = "frmRptTimePos_D"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rstGrid As New ADODB.Recordset
Dim rstExec As New ADODB.Recordset
Private Sub Form_Load()
Me.Icon = MDI.Icon
Me.Caption = "明细查看"
rstGrid.Fields.Append "TimePos", adVarChar, 50
rstGrid.Fields.Append "OnTime", adVarChar, 20
rstGrid.Fields.Append "OffTime", adVarChar, 20
rstGrid.Fields.Append "InClass", adVarChar, 20
rstGrid.Fields.Append "State", adVarChar, 20
rstGrid.Open "", , adOpenStatic, adLockBatchOptimistic
Grid.AddHeader "序号", "Serial ", 40, -1, "Serial ", False, sSerial
Grid.AddHeader "时间段", "TimePos", 80, -1, "TimePos", False, sDefault
Grid.AddHeader "上班时间", "OnTime", 80, -1, "OnTime", False, sDefault
Grid.AddHeader "下班时间", "OffTime", 80, -1, "OffTime", False, sDefault
Grid.AddHeader "所属班次", "InClass", 80, -1, "InClass", False, sDefault
Grid.AddHeader "备注", "State", 80, -1, "State", False, sDefault
Grid.Reposition
Grid.AllowAddNew = False
Grid.ColAutoResize = False
End Sub
Public Sub ShowBill(sDate As String, sWeekday As String, sCode As String, sName As String)
On Error Resume Next
Dim CardCount As Long
Dim sInDate As String
Dim sClassID As String
Dim lEmployeeID As Integer
GetEmployeeID sCode, lEmployeeID
sInDate = Mid(sDate, 1, 4) & Mid(sDate, 6, 2) & Mid(sDate, 9, 2)
GetSetClassID sCode, sInDate
CardCount = GetClassCount
Dim ClassIDCount As Long
Dim ClassIDIndex As Long
ClassIDCount = UBound(ClassIDInfo)
For ClassIDIndex = 1 To ClassIDCount
sClassID = sClassID & CStr(ClassIDInfo(ClassIDIndex).ClassID) & ","
Next
Dim lVacID As Long
Dim tmpClassCount As Long
Dim tmpClassIndex As Long
lVacID = GetEmployeeVac(sCode)
If CardCount <> 0 Then
tmpClassCount = UBound(tmpClassInfo)
For tmpClassIndex = 1 To tmpClassCount
rstGrid.AddNew
rstGrid.Fields("TimePos") = "时间段" & tmpClassIndex
rstGrid.Fields("OnTime") = GetTime(tmpClassInfo(tmpClassIndex).bTime)
rstGrid.Fields("OffTime") = GetTime(tmpClassInfo(tmpClassIndex).eTime)
rstGrid.Fields("InClass") = GetClassName(tmpClassInfo(tmpClassIndex).ClassID)
If tmpClassInfo(tmpClassIndex).AddClass = True Then
If GetYesNoLeave(lEmployeeID, tmpClassIndex * 2, sDate) = True Then
rstGrid.Fields("State") = "请假"
Else
rstGrid.Fields("State") = "加班"
End If
Else
If GetYesNoVac(lEmployeeID, tmpClassIndex * 2, lVacID, sDate) = True Then
rstGrid.Fields("State") = "休假"
Else
If GetYesNoLeave(lEmployeeID, tmpClassIndex * 2, sDate) = True Then
rstGrid.Fields("State") = "请假"
Else
rstGrid.Fields("State") = ""
End If
End If
End If
rstGrid.Update
Next
End If
Set Grid.DataSource = rstGrid
lblDate.Caption = "当前日期:" & sDate
lblWeekday.Caption = "星期" & sWeekday
lblCode.Caption = "员工卡号:" & sCode
lblName.Caption = "员工名称:" & sName
lblCardCount.Caption = "刷卡次数:" & CStr(CardCount)
sClassID = Left(sClassID, Len(sClassID) - 1)
If rstExec.State = 1 Then rstExec.Close
Set rstExec = Nothing
rstExec.CursorLocation = adUseClient
rstExec.Open "select ClassName from Class where ClassID in (" & sClassID & ")", con, adOpenStatic, adLockBatchOptimistic
sClassID = ""
If rstExec.RecordCount > 0 Then
rstExec.MoveFirst
While Not rstExec.EOF
sClassID = sClassID & rstExec.Fields("ClassName") & " "
rstExec.MoveNext
Wend
End If
lblClassID.Caption = "班次组合:" & sClassID
End Sub
Private Function GetTime(ByVal sTime As String) As String
Dim a As Integer
Dim b As Integer
a = Int(Val(sTime) / 60)
b = Int(Val(sTime) Mod 60)
GetTime = Right("00" & a, 2) & ":" & Right("00" & b, 2)
End Function
Private Sub Form_Unload(Cancel As Integer)
If rstGrid.State = 1 Then rstGrid.Close
Set rstGrid = Nothing
If rstExec.State = 1 Then rstExec.Close
Set rstExec = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -