【VB开源代码栏目提醒】:本文主要为网学会员提供frmBasicSetting.frm,希望对需要frmBasicSetting.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form frmBasicSetting
Caption = "设置基本工资"
ClientHeight = 4875
ClientLeft = 60
ClientTop = 345
ClientWidth = 5775
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4875
ScaleWidth = 5775
StartUpPosition = 2 '屏幕中心
Begin VB.OptionButton optionPosition
Caption = "员工职务"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 7
Top = 1680
Width = 1455
End
Begin VB.OptionButton optionID
Caption = "员工编号"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 840
TabIndex = 6
Top = 840
Width = 1455
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 615
Left = 3600
TabIndex = 5
Top = 3600
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 615
Left = 1320
TabIndex = 4
Top = 3600
Width = 1095
End
Begin VB.TextBox textMoney
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 3
Top = 2520
Width = 1575
End
Begin VB.ComboBox comPosition
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 1
Top = 1680
Width = 2415
End
Begin VB.ComboBox comStuffID
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 0
Top = 840
Width = 2415
End
Begin VB.Label Label2
Caption = "(元/小时)"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4200
TabIndex = 8
Top = 2520
Width = 1215
End
Begin VB.Label Label1
Caption = "工资金额"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 2
Top = 2640
Width = 1095
End
End
Attribute VB_Name = "frmBasicSetting"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private ID As String
Private Sub cmdCancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub init()
Me.comPosition.ListIndex = 0
Me.comStuffID.ListIndex = 0
Me.textMoney = ""
Me.optionID.Value = True
End Sub
Private Sub addRecord() '添加记录
Dim sql As String
Dim rs As New ADODB.Recordset
sql = "select * from SalarySetting"
Set rs = getRS(sql, "Salary")
rs.AddNew
rs.Fields(1) = Trim(ID)
rs.Fields(2) = Trim(Me.comPosition.Text)
rs.Fields(3) = Trim(Me.textMoney)
rs.Update
rs.Close
End Sub
Private Sub cmdOK_Click()
Dim sql As String
Dim rs As New ADODB.Recordset
If ichangeFlag = 1 Then
If Me.optionID.Value = True Then
If Me.comStuffID.Text = "" Then
MsgBox "请选择员工编号!", vbOKOnly + vbExclamation, "警告!"
ElseIf IsEmpty(Me.textMoney) = True Then
MsgBox "请输入基本工资!", vbOKOnly + vbExclamation, "警告!"
Me.textMoney.SetFocus
ElseIf IsNumeric(Me.textMoney) = False Then
MsgBox "请输入金额!", vbOKOnly + vbExclamation, "警告!"
Me.textMoney = ""
Me.textMoney.SetFocus
Else
sql = "select * from SalarySetting where StuffID='" & Me.comStuffID.Text & "'"
Set rs = getRS(sql, "Salary")
If rs.EOF = False Then
sql = "delete from SalarySetting where StuffID='" & Me.comStuffID.Text & "'"
Call TransactSQL(sql, "Salary")
End If
rs.Close
ID = Me.comStuffID.Text
Cal