?? frm_gzgl.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_gzgl
BorderStyle = 1 'Fixed Single
Caption = "員工工資調整"
ClientHeight = 2820
ClientLeft = 45
ClientTop = 435
ClientWidth = 5535
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2820
ScaleWidth = 5535
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 165
Top = 2445
Visible = 0 'False
Width = 2325
_ExtentX = 4101
_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.CommandButton cmd_cancel
Caption = "取消"
Height = 345
Left = 4425
TabIndex = 16
Top = 2400
Width = 975
End
Begin VB.CommandButton cmd_ok
Caption = "確定調整"
Height = 345
Left = 3465
TabIndex = 15
Top = 2400
Width = 975
End
Begin VB.Frame Frame1
Height = 2265
Left = 135
TabIndex = 0
Top = 90
Width = 5280
Begin VB.TextBox Text1
Height = 300
Index = 5
Left = 3585
TabIndex = 14
Top = 1650
Width = 1440
End
Begin VB.TextBox Text1
Height = 300
Index = 4
Left = 1065
TabIndex = 13
Top = 1650
Width = 1440
End
Begin VB.TextBox Text1
Height = 300
Index = 3
Left = 3585
TabIndex = 12
Top = 1185
Width = 1440
End
Begin VB.TextBox Text1
Height = 300
Index = 2
Left = 1065
TabIndex = 11
Top = 1185
Width = 1440
End
Begin VB.TextBox Text1
Height = 300
Index = 1
Left = 3585
TabIndex = 10
Top = 705
Width = 1440
End
Begin VB.TextBox Text1
Height = 300
Index = 0
Left = 1065
TabIndex = 4
Top = 705
Width = 1440
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1065
Style = 2 'Dropdown List
TabIndex = 2
Top = 195
Width = 1440
End
Begin VB.Label Label7
Caption = "出差補助"
Height = 240
Left = 2715
TabIndex = 9
Top = 1680
Width = 735
End
Begin VB.Label Label6
Caption = "項目獎金"
Height = 240
Left = 225
TabIndex = 8
Top = 1680
Width = 735
End
Begin VB.Label Label5
Caption = "津貼"
Height = 240
Left = 2715
TabIndex = 7
Top = 1200
Width = 735
End
Begin VB.Label Label4
Caption = "伙食補助"
Height = 240
Left = 210
TabIndex = 6
Top = 1200
Width = 735
End
Begin VB.Label Label3
Caption = "獎金"
Height = 240
Left = 2715
TabIndex = 5
Top = 735
Width = 735
End
Begin VB.Label Label2
Caption = "基本工資"
Height = 240
Left = 210
TabIndex = 3
Top = 735
Width = 735
End
Begin VB.Label Label1
Caption = "員工姓名"
Height = 300
Left = 195
TabIndex = 1
Top = 270
Width = 1020
End
End
End
Attribute VB_Name = "Frm_gzgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub cmd_ok_Click()
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 工資信息 where 員工編號='" + YgNums + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then '修改信息
c = MsgBox("確認調整該員工的工資信息嗎", 33, "提示信息")
If c = vbOK Then
Set DB_AdoRs = Cnn.Execute("UPDATE 工資信息 SET 基本工資='" + Text1(0) + "',獎金='" + Text1(1) + "',伙食補助='" _
+ Text1(2) + "',津貼='" + Text1(3) + "',項目獎金='" + Text1(4) + "',出差補助='" + Text1(5) + "' where 員工編號='" + YgNums + "'")
MsgBox "成功調整", 64, "提示信息"
End If
Else '保存信息
c = MsgBox("該員工的工資信息不存在,確認保存嗎", 33, "提示信息")
If c = vbOK Then
Set DB_AdoRs = Cnn.Execute("insert into 工資信息 values('" & YgNums & "','" & Text1(0) & "','" & Text1(1) & "','" & Text1(2) & "','" & Text1(3) & "','" _
& Text1(4) & "','" & Text1(5) & "')")
MsgBox "員工工資信息保存成功", 64, "提示信息"
End If
End If
End Sub
Private Sub Combo1_Click()
'獲得員工編號
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 員工信息 where 員工姓名='" + Combo1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
YgNums = Adodc1.Recordset.Fields("員工編號")
End If
'判斷該員工的工資信息是否已經存在
Adodc1.ConnectionString = MyStrs
Adodc1.RecordSource = "select * from 工資信息 where 員工編號='" + YgNums + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1(0).Text = Adodc1.Recordset.Fields("基本工資")
Text1(1).Text = Adodc1.Recordset.Fields("獎金")
Text1(2).Text = Adodc1.Recordset.Fields("伙食補助")
Text1(3).Text = Adodc1.Recordset.Fields("津貼")
Text1(4).Text = Adodc1.Recordset.Fields("項目獎金")
Text1(5).Text = Adodc1.Recordset.Fields("出差補助")
End If
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 + -