⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsalaryrule.vb

📁 使用说明 1.在使用源程序前
💻 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 + -