📄 frmpunish.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmPunish
Caption = "职工惩罚管理"
ClientHeight = 5280
ClientLeft = 60
ClientTop = 345
ClientWidth = 7935
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5280
ScaleWidth = 7935
Begin MSDataGridLib.DataGrid grdDataGrid
Height = 4815
Left = 0
TabIndex = 0
Top = 480
Width = 7935
_ExtentX = 13996
_ExtentY = 8493
_Version = 393216
HeadLines = 1
RowHeight = 15
AllowAddNew = -1 'True
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 1
Top = 0
Width = 7935
_ExtentX = 13996
_ExtentY = 741
ButtonWidth = 609
ButtonHeight = 582
Appearance = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 2
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "btnSave"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "btnDelete"
ImageIndex = 2
EndProperty
EndProperty
Begin MSComctlLib.ImageList ImageList1
Left = 5880
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 2
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPunish.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmPunish.frx":0112
Key = ""
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "frmPunish"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim db As New DataBases
Dim rs As Recordset
Set rs = db.RunSelectSQLUpdatable("SELECT 序号, 职员编号, 惩罚类型, 惩罚金额, 是否计入工资, 惩罚原因, 部门意见, 惩罚日期 FROM 职员惩罚表")
Set grdDataGrid.DataSource = rs
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
If StrComp(Button.Key, "btnSave") = 0 Then
'判断grdDataGrid的数据是否有变化
'即DataGrid控件上是否有数据更改或新增数据
Dim rs As Recordset
Set rs = grdDataGrid.DataSource
If grdDataGrid.DataChanged Then
'通过rs更新数据库数据
rs.UpdateBatch adAffectAll
MsgBox "数据修改成功"
Else
MsgBox "无修改的数据"
End If
ElseIf StrComp(Button.Key, "btnDelete") = 0 Then
If MsgBox("确定要删除么?", vbYesNo) = vbYes Then
Dim db As New DataBases
Dim strNum As String
Set rs = grdDataGrid.DataSource
strNum = rs("序号")
'删除个人所得税表的相关内容
db.RunSelectSQL ("DELETE FROM 职员奖励表 WHERE 序号='" + strNum + "'")
rs.Requery
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -