?? frmsalaryrule.vb
字號:
Friend Class FrmSalaryRule
Inherits System.Windows.Forms.Form
Private Sub Cmd_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cmd_Cancel.Click
Me.Close()
End Sub
Private Sub FrmSalaryRule_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
With MyRule
'遲到扣款
Text1.Text = CStr(.GetAmount(1))
'差旅補助
Text2.Text = CStr(.GetAmount(2))
'養老代扣系數
Text3.Text = CStr(.GetAmount(3))
'基本醫療代扣系數
Text4.Text = CStr(.GetAmount(4))
'失業保險代扣系數
Text5.Text = CStr(.GetAmount(5))
'住房公積金代扣系數
Text6.Text = CStr(.GetAmount(6))
End With
End Sub
Private Sub Text1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text1.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub Text2_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text2.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub Text3_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text3.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub Text4_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text4.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub Text5_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text5.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub Text6_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Text6.KeyPress
Dim KeyAscii As Short = Asc(e.KeyChar)
EnterTAB((KeyAscii))
If In_Single(KeyAscii) = False Then
KeyAscii = 0
End If
e.KeyChar = Chr(KeyAscii)
If KeyAscii = 0 Then
e.Handled = True
End If
End Sub
Private Sub BtnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOk.Click
With MyRule
'遲到扣款
.RuleType = 1
.RuleAmount = Val(Text1.Text)
If .In_DB(1) = False Then
.Insert()
Else
.Update((.RuleType))
End If
'差旅補助
.RuleType = 2
.RuleAmount = Val(Text2.Text)
If .In_DB(2) = False Then
.Insert()
Else
.Update((.RuleType))
End If
'養老代扣系數
.RuleType = 3
.RuleAmount = Val(Text3.Text)
If .In_DB(3) = False Then
.Insert()
Else
.Update((.RuleType))
End If
'基本醫療代扣系數
.RuleType = 4
.RuleAmount = Val(Text4.Text)
If .In_DB(4) = False Then
.Insert()
Else
.Update((.RuleType))
End If
'失業保險代扣系數
.RuleType = 5
.RuleAmount = Val(Text5.Text)
If .In_DB(5) = False Then
.Insert()
Else
.Update((.RuleType))
End If
'住房公積金代扣系數
.RuleType = 6
.RuleAmount = Val(Text6.Text)
If .In_DB(6) = False Then
.Insert()
Else
.Update((.RuleType))
End If
End With
Me.Close()
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -