?? frm_gzhs.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Frm_gzhs
BorderStyle = 1 'Fixed Single
Caption = "員工工資核算管理"
ClientHeight = 4830
ClientLeft = 45
ClientTop = 435
ClientWidth = 7530
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4830
ScaleWidth = 7530
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text4
Enabled = 0 'False
Height = 270
Left = 3990
TabIndex = 23
Top = 4470
Width = 1260
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 210
Top = 5265
Width = 2595
_ExtentX = 4577
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 270
Left = 2520
TabIndex = 20
Top = 4470
Width = 660
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 270
Left = 930
TabIndex = 19
Top = 4470
Width = 645
End
Begin VB.CommandButton cmd_qx
Caption = "取消"
Height = 345
Left = 6450
TabIndex = 16
Top = 4395
Width = 990
End
Begin VB.CommandButton cmd_hs
Caption = "核算"
Height = 345
Left = 5475
TabIndex = 15
Top = 4395
Width = 990
End
Begin VB.Frame Frame1
Height = 1605
Left = 60
TabIndex = 0
Top = 30
Width = 7395
Begin VB.ComboBox Combo1
Height = 300
Left = 1050
Style = 2 'Dropdown List
TabIndex = 7
Top = 195
Width = 1440
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 0
Left = 1050
TabIndex = 6
Top = 720
Width = 1440
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 1
Left = 3300
TabIndex = 5
Top = 720
Width = 1440
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 2
Left = 5775
TabIndex = 4
Top = 720
Width = 1440
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 3
Left = 1050
TabIndex = 3
Top = 1185
Width = 1440
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 4
Left = 3405
TabIndex = 2
Top = 1185
Width = 1335
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 5
Left = 5775
TabIndex = 1
Top = 1185
Width = 1440
End
Begin VB.Label Label1
Caption = "員工姓名"
Height = 300
Left = 195
TabIndex = 14
Top = 270
Width = 1020
End
Begin VB.Label Label2
Caption = "基本工資"
Height = 240
Left = 210
TabIndex = 13
Top = 795
Width = 735
End
Begin VB.Label Label3
Caption = "獎金"
Height = 240
Left = 2655
TabIndex = 12
Top = 795
Width = 735
End
Begin VB.Label Label4
Caption = "伙食補助"
Height = 240
Left = 4890
TabIndex = 11
Top = 795
Width = 735
End
Begin VB.Label Label5
Caption = "津貼"
Height = 240
Left = 210
TabIndex = 10
Top = 1260
Width = 735
End
Begin VB.Label Label6
Caption = "項目獎金"
Height = 240
Left = 2610
TabIndex = 9
Top = 1260
Width = 735
End
Begin VB.Label Label7
Caption = "出差補助"
Height = 240
Left = 4890
TabIndex = 8
Top = 1260
Width = 735
End
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frm_gzhs.frx":0000
Height = 2700
Left = 75
TabIndex = 22
Top = 1665
Width = 7365
_ExtentX = 12991
_ExtentY = 4763
_Version = 393216
AllowUpdate = 0 'False
AllowArrows = 0 'False
HeadLines = 1
RowHeight = 15
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 VB.Label Label10
Caption = "月份"
Height = 210
Left = 3360
TabIndex = 21
Top = 4530
Width = 900
End
Begin VB.Label Label9
Caption = "遲到次數"
Height = 210
Left = 1680
TabIndex = 18
Top = 4530
Width = 900
End
Begin VB.Label Label8
Caption = "請假天數"
Height = 210
Left = 75
TabIndex = 17
Top = 4530
Width = 900
End
End
Attribute VB_Name = "Frm_gzhs"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim YKPays '定義一個應扣工資的變量
Private Sub cmd_hs_Click()
Dim AllPays
'計算實法工資
AllPays = Val(Text1(0).Text) + Val(Text1(1).Text) + Val(Text1(2).Text) + Val(Text1(3).Text) + _
Val(Text1(4).Text) + Val(Text1(5).Text) - YKPays
'修改實發工資信息
Set DB_AdoRs = Cnn.Execute("UPDATE 出勤信息 SET 實發工資='" + Str(AllPays) + "' where 員工編號='" + YgNums + "' and 月份='" + Mid(Str(Date), 1, 7) + "'")
MsgBox "操作成功", 64, "提示信息"
End Sub
Private Sub cmd_qx_Click()
Unload Me
End Sub
Private Sub Combo1_Click()
'獲得員工編號
DB_AdoRs.Open "select * from 員工信息 where 員工姓名='" + Combo1.Text + "'", Cnn, adOpenKeyset
If DB_AdoRs.RecordCount > 0 Then
YgNums = DB_AdoRs.Fields("員工編號")
End If
DB_AdoRs.Close
'判斷該員工的工資信息是否已經存在
DB_AdoRs.Open "select * from 工資信息 where 員工編號='" + YgNums + "'", Cnn, adOpenKeyset
If DB_AdoRs.RecordCount > 0 Then
Text1(0).Text = DB_AdoRs.Fields("基本工資")
Text1(1).Text = DB_AdoRs.Fields("獎金")
Text1(2).Text = DB_AdoRs.Fields("伙食補助")
Text1(3).Text = DB_AdoRs.Fields("津貼")
Text1(4).Text = DB_AdoRs.Fields("項目獎金")
Text1(5).Text = DB_AdoRs.Fields("出差補助")
End If
DB_AdoRs.Close
'加載考勤信息
DB_AdoRs.Open "select * from 出勤信息 where 員工編號='" + YgNums + "' and 月份='" + Mid(Str(Date), 1, 7) + "'", Cnn, adOpenKeyset
If DB_AdoRs.RecordCount > 0 Then
Text2.Text = DB_AdoRs.Fields("請假天數")
Text3.Text = DB_AdoRs.Fields("遲到次數")
Text4.Text = DB_AdoRs.Fields("月份")
End If
DB_AdoRs.Close
DB_AdoRs.Open "select * from 扣款標準", Cnn, adOpenKeyset
If DB_AdoRs.RecordCount > 0 Then
YKPays = Val(Text3.Text) * Val(DB_AdoRs.Fields("遲到扣除")) + Val(Text2.Text) * Val(DB_AdoRs.Fields("請假扣除"))
End If
DB_AdoRs.Close
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 員工信息 order by 員工編號"
Adodc1.Refresh
For i = 1 To Adodc1.Recordset.RecordCount
Combo1.AddItem Adodc1.Recordset.Fields("員工姓名")
Adodc1.Recordset.MoveNext
Next i
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -