?? frmothersetting.frm
字號:
Width = 1215
End
Begin VB.CommandButton cmdok
Caption = "確 定"
BeginProperty Font
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 2
Top = 7080
Width = 1215
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 = 4320
TabIndex = 1
Top = 240
Width = 975
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 = 480
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "frmothersetting"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private recordtime As Date
Private Sub cmdcancel_Click()
Unload Me
Exit Sub
End Sub
Private Sub cmdok_Click()
Dim itype As Integer
Dim sql As String
Dim resumdate As Date
sql = "select * from salaryother"
If ichangeflag = 1 Then
Call add
MsgBox "已經添加記錄", vbOKOnly + vbExclamation, "提示"
Call frmresult.othertopic
Call frmresult.showother(sql)
frmresult.Show
Unload Me
Else
If Me.optionbonus.Value = True Then
itype = 1
ElseIf Me.optionallowance.Value = True Then
itype = 2
ElseIf Me.optionwelfare.Value = True Then
itype = 3
ElseIf Me.optionabatement.Value = True Then
itype = 4
ElseIf Me.optionothers.Value = True Then
itype = 5
resumdate = recordtime
sql = "delete from salaryother where stuffid='" & Me.comid.Text
sql = sql & "' and YearMonth=#" & recordtime & "# and "
sql = sql & "Type=" & itype
Call transactsql(sql, "Salary")
Call add
Call frmsumsalary.resumsalary(resumdate)
sql = "select * from salaryother"
Call frmresult.othertopic
Call frmresult.showother(sql)
frmresult.Show
Unload Me
End If
End If
End Sub
Private Sub Form_Load()
Dim sql As String
Dim rs As New ADODB.Recordset
Dim recordtype As Integer
Dim imoney As Integer
Dim strname As String
Dim strremark As String
If ichangeflag = 1 Then
sql = "select sid from stuffinfo"
Set rs = getrs(sql, "salary")
If rs.EOF = False Then
While Not rs.EOF
Me.comid.AddItem rs(0)
rs.MoveNext
Wend
rs.Close
Me.comid.ListIndex = 0
End If
Me.dttime.Value = Date
Else
Set rs = getrs(strpublicsql, "salary")
Me.comid.Text = rs(1)
recordtime = rs(2)
recordtype = rs(3)
strname = rs(4)
imoney = rs(5)
strremark = rs(6)
Me.dttime = Date
If recordtype = 1 Then
Me.optionbonus.Value = True
ElseIf recordtype = 2 Then
Me.optionallowance.Value = True
ElseIf recordtype = 3 Then
Me.optionwelfare.Value = True
ElseIf recordtype = 4 Then
Me.optionabatement.Value = True
ElseIf recordtype = 5 Then
Me.optionothers.Value = True
Me.textname = strname
End If
Me.textmoney = imoney
Me.textremark = strremark
rs.Close
Me.Caption = "修改其他項目設置"
End If
End Sub
Public Sub addrecord(itype As Integer, strname As String)
Dim sql As String
Dim rs As New ADODB.Recordset
sql = "select * from salaryother"
Set rs = getrs(sql, "salary")
rs.AddNew
rs.Fields(1) = Me.comid.Text
rs.Fields(2) = Me.dttime.Value
rs.Fields(3) = itype
rs.Fields(4) = strname
rs.Fields(5) = Trim(Me.textmoney)
rs.Fields(6) = Me.textremark
rs.Update
rs.Close
End Sub
Public Sub add()
Dim sql As String
Dim rs As New ADODB.Recordset
sql = "select * from salaryother"
Set rs = getrs(sql, "salary")
If Me.optionallowance.Value = True Then
If Me.textmoney = "" Then
MsgBox "請輸入津貼", vbOKOnly + vbExclamation, "提示"
Me.textmoney.SetFocus
ElseIf IsNumeric(Me.textmoney) = False Then
MsgBox "請輸入金額", vbOKOnly + vbExclamation, "提示"
Me.textmoney = ""
Me.textmoney.SetFocus
Else
Call addrecord(2, "津貼")
Call init
End If
End If
If Me.optionbonus.Value = True Then
If Me.textmoney = "" Then
MsgBox "請輸入獎金", vbOKOnly + vbExclamation, "提示"
Me.textmoney.SetFocus
ElseIf IsNumeric(Me.textmoney) = False Then
MsgBox "請輸入金額", vbOKOnly + vbExclamation, "提示"
Me.textmoney = ""
Me.textmoney.SetFocus
Else
Call addrecord(1, "獎金")
Call init
End If
End If
If Me.optionwelfare.Value = True Then
If Me.textmoney = "" Then
MsgBox "請輸入福利", vbOKOnly + vbExclamation, "提示"
Me.textmoney.SetFocus
ElseIf IsNumeric(Me.textmoney) = False Then
MsgBox "請輸入金額", vbOKOnly + vbExclamation, "提示"
Me.textmoney = ""
Me.textmoney.SetFocus
Else
Call addrecord(3, "福利")
Call init
End If
End If
If Me.optionabatement.Value = True Then
If Me.textmoney = "" Then
MsgBox "請輸入扣發", vbOKOnly + vbExclamation, "提示"
Me.textmoney.SetFocus
ElseIf IsNumeric(Me.textmoney) = False Then
MsgBox "請輸入金額", vbOKOnly + vbExclamation, "提示"
Me.textmoney = ""
Me.textmoney.SetFocus
Else
Call addrecord(4, "扣發")
Call init
End If
End If
If Me.optionothers.Value = True Then
If Me.textmoney = "" Then
MsgBox "請輸入其他項目名稱", vbOKOnly + vbExclamation, "提示"
Me.textmoney.SetFocus
ElseIf IsNumeric(Me.textmoney) = False Then
MsgBox "請輸入正確的金額", vbOKOnly + vbExclamation, "提示"
Me.textmoney = ""
Me.textmoney.SetFocus
Else
Call addrecord(5, Trim(Me.textname))
Call init
End If
End If
End Sub
Private Sub init()
If ichangeflag = 1 Then
Me.comid.ListIndex = 0
Me.dttime.Value = Date
Me.optionallowance.Value = False
Me.optionbonus.Value = False
Me.optionothers.Value = False
Me.optionwelfare.Value = False
Me.optionabatement.Value = False
Me.textmoney = ""
Me.textremark = ""
Else
Unload Me
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -