📄 frmclass.frm
字号:
VERSION 5.00
Object = "{E11E7285-4386-40E5-A4D4-F55704D4D491}#1.0#0"; "sSuperGrid.ocx"
Object = "{060B05EA-F4F5-4255-9BFC-9295B6A89D11}#3.0#0"; "Sinour050715.ocx"
Begin VB.Form frmClass
Caption = "班次资料"
ClientHeight = 4650
ClientLeft = 60
ClientTop = 345
ClientWidth = 3975
LinkTopic = "Form2"
LockControls = -1 'True
MDIChild = -1 'True
ScaleHeight = 4650
ScaleWidth = 3975
Begin SSUPERGRIDLib.SSuperGrid Grid
Height = 4245
Left = 15
TabIndex = 0
Top = 0
Width = 3900
_Version = 65536
_ExtentX = 6879
_ExtentY = 7488
_StockProps = 132
End
Begin Sinour_Controls.sButton cmdEdit
Height = 375
Left = 15
TabIndex = 1
Top = 4275
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BTYPE = 7
TX = "编辑(&E) "
ENAB = -1 'True
BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
COLTYPE = 1
FOCUSR = 0 'False
BCOL = 13160660
BCOLO = 13160660
FCOL = 0
FCOLO = 0
MCOL = 12632256
MPTR = 1
MICON = "frmClass.frx":0000
PICN = "frmClass.frx":001C
UMCOL = -1 'True
SOFT = 0 'False
PICPOS = 1
NGREY = 0 'False
FX = 0
HAND = 0 'False
CHECK = 0 'False
VALUE = 0 'False
End
End
Attribute VB_Name = "frmClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim recGrid As New ADODB.Recordset
Dim recExec As New ADODB.Recordset
Public Sub AddBill()
frmClassEdit.ZOrder
frmClassEdit.AddBill
End Sub
Public Sub EditBill()
If Grid.RecordCount = 0 Then
Message "没有可用信息!"
Exit Sub
End If
If Grid.CurRow = -1 Then
Message "请先选中数据!"
Exit Sub
End If
frmClassEdit.ZOrder
frmClassEdit.EditBill recGrid.Fields("ClassID")
End Sub
Public Sub RefreshBill()
' Dim i As Integer
' If Grid.CurRow <> -1 Then i = Grid.CurRow
recGrid.Requery
Grid.ReFetch
' If i >= Grid.RecordCount Then Exit Sub
'
' Grid.CurRow = i
End Sub
Public Sub DelBill()
On Error GoTo DelErr
If Grid.RecordCount = 0 Then
Message "没有可用信息!"
Exit Sub
End If
If Grid.CurRow = -1 Then
Message "请先选中数据!"
Exit Sub
End If
If QueryDly("确定删除?") = False Then Exit Sub
con.Execute "delete from Class where ClassID=" & recGrid.Fields("ClassID")
recGrid.Requery
Grid.ReFetch
Exit Sub
DelErr:
ErrMsg
End Sub
'Private Sub comSave_Click()
'On Error GoTo SaveErr
'
' If recExec.State = 1 Then recExec.Close
' Set recExec = Nothing
' recExec.CursorLocation = adUseClient
' recExec.Open "delete from Class", con, adOpenStatic, adLockBatchOptimistic
'
' If recExec.State = 1 Then recExec.Close
' Set recExec = Nothing
' recExec.CursorLocation = adUseClient
' recExec.Open "select * from Class where ClassID=0", con, adOpenStatic, adLockBatchOptimistic
'
' recGrid.MoveFirst
' Do While Not recGrid.EOF
' recExec.AddNew
' recExec.Fields("ClassNo") = recGrid.Fields("ClassNo")
' recExec.Fields("CardCount") = recGrid.Fields("CardCount")
' recExec.Fields("Time1") = recGrid.Fields("Time1")
' recExec.Fields("Time2") = recGrid.Fields("Time2")
' recExec.Fields("Time3") = recGrid.Fields("Time3")
' recExec.Fields("Time4") = recGrid.Fields("Time4")
' recExec.Fields("DayTime") = recGrid.Fields("DayTime")
' recExec.Fields("RecessTime") = recGrid.Fields("RecessTime")
' recExec.Fields("WeekTime") = recGrid.Fields("WeekTime")
' recExec.Fields("SetTime1") = recGrid.Fields("SetTime1")
' recExec.Fields("SetTime2") = recGrid.Fields("SetTime2")
' recExec.Update
' recGrid.MoveNext
' Loop
'
' Dim i As Integer
' con.BeginTrans
' i = 1
' recExec.UpdateBatch
' con.CommitTrans
' i = 2
'
' Exit Sub
'
'SaveErr:
' If i = 1 Then con.RollbackTrans
' MsgBox Err.Description, vbInformation, "提示"
'End Sub
Private Sub cmdEdit_Click()
Set iFrom = Me
Me.PopupMenu MNU.mnuClass, , cmdEdit.Left, cmdEdit.Top + cmdEdit.Height
End Sub
Private Sub Form_Load()
Me.Icon = MDI.Icon
If recGrid.State = 1 Then recGrid.Close
Set recGrid = Nothing
recGrid.CursorLocation = adUseClient
recGrid.Open "select * from Class", con, adOpenStatic, adLockBatchOptimistic
Grid.AddHeader "序号", "Serial", 60, -1, -1, False, sSerial
Grid.AddHeader "名称", "ClassName", 200, -1, "ClassName", False, sDefault
' Grid.AddHeader "班次", "ClassNo", 40, -1, "ClassNo", False, sDefault
' Grid.AddHeader "刷卡次数", "CardCount", 60, -1, "CardCount", False, sDefault
' Grid.AddHeader "时间1", "Time1", 120, -1, "Time1", False, sDefault
' Grid.AddHeader "时间2", "Time2", 120, -1, "Time2", False, sDefault
' Grid.AddHeader "时间3", "Time3", 120, -1, "Time3", False, sDefault
' Grid.AddHeader "时间4", "Time4", 120, -1, "Time4", False, sDefault
' Grid.AddHeader "日工作时间", "DayTime", 120, -1, "DayTime", False, sDefault
' Grid.AddHeader "周工作时间", "WeekTime", 120, -1, "WeekTime", False, sDefault
' Grid.AddHeader "中途休息时间", "RecessTime", 120, -1, "RecessTime", False, sDefault
' Grid.AddHeader "迟到早退分界点", "SetTime1", 120, -1, "SetTime1", False, sDefault
' Grid.AddHeader "计算旷工分界点", "SetTime2", 120, -1, "SetTime2", False, sDefault
Set Grid.DataSource = recGrid
'
' Grid.Col("ClassNo").EditType = TextBox
' Grid.Col("CardCount").EditType = TextBox
' Grid.Col("Time1").EditType = TextBox
' Grid.Col("Time2").EditType = TextBox
' Grid.Col("Time3").EditType = TextBox
' Grid.Col("Time4").EditType = TextBox
' Grid.Col("DayTime").EditType = TextBox
' Grid.Col("WeekTime").EditType = TextBox
' Grid.Col("RecessTime").EditType = TextBox
' Grid.Col("SetTime1").EditType = TextBox
' Grid.Col("SetTime2").EditType = TextBox
' Grid.EditHwnd(TextBox) = txt.hWnd
' txt.RelateHwnd = Grid.hWnd
Grid.ColAutoResize = True
Grid.AllowAddNew = False
Grid.AllowEdit = False
Me.Width = 4050
Me.Height = 5000
' Grid.MainCol = "ClassNo"
' SServerDog1.LocalPort = 5111
' SServerDog1.DogSn = "000074"
' SServerDog1.Listen
'
' SClientDog1.RemoteHost = "127.0.0.1"
' SClientDog1.RemotePort = 5111
' SClientDog1.DogSn = "000074"
' SClientDog1.Run
End Sub
Private Sub Form_Resize()
On Error Resume Next
'Grid.Move 60, Toolbar.Top + Toolbar.Height, Me.ScaleWidth - 120, Me.ScaleHeight
' Grid.Left = 60
' If Me.ScaleWidth >= 120 Then
' Grid.Width = Me.ScaleWidth - 120
' End If
'
' Grid.Top = Toolbar.Top + Toolbar.Height
' If (Me.ScaleHeight > Grid.Top) Then
' Grid.Height = Me.ScaleHeight - Grid.Top
' End If
Grid.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight - 375 - 120
cmdEdit.Move 60, Grid.Top + Grid.Height + 60
End Sub
Private Sub Grid_DblClick()
EditBill
End Sub
Private Sub Grid_RButtonUp(ByVal Area As SSUPERGRIDLib.sArea, ByVal X As Long, ByVal Y As Long)
If Area = sBlankArea Or sRowArea Then
Set iFrom = Me
Me.PopupMenu MNU.mnuClass
End If
End Sub
'Private Sub Grid_AfterColEdit(ByVal ColIndex As Long)
'
' If Grid.IsInNewRow Then
' recGrid.AddNew
' recGrid.Fields("ClassNo") = txt.Text
' recGrid.Update
' Grid.RefreshNew
' End If
'
'End Sub
Private Sub Grid_RowColChange(ByVal LastRow As Long, ByVal LastCol As Long)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -