Selasa, 03 Desember 2013

Program vb Penggajian









Public Class penggajian
    Private Sub penggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        nik.Items.Add("PM010")
        nik.Items.Add("PS111")
        nik.Items.Add("KU101")
        nik.Items.Add("GD100")

        jabatan.Items.Add("KEPALA DIVISI")
        jabatan.Items.Add("STAFF")
        jabatan.Items.Add("WAKIL KEPALA")

        status.Items.Add("Menikah")
        status.Items.Add("Tidak Menikah")

        julan.Items.Add("0")
        julan.Items.Add("1")
        julan.Items.Add("2")


    End Sub

    Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
        Select Case nik.Text
            Case "PM010"
                nama.Text = "Rina Pancari"
            Case "PS111"
                nama.Text = "Pesek Vera"
            Case "KU101"
                nama.Text = "Pesek Hazar"
            Case Else
                nama.Text = "Yayuk Basuki"
        End Select
        Dim p As String
        p = Microsoft.VisualBasic.Left(nik.Text, 2)
        If p = "PM" Then
            bagian.Text = "pemasaran"
        ElseIf p = "PS" Then
            bagian.Text = "Personalia"
        ElseIf p = "KU" Then
            bagian.Text = "Keuangan"
        ElseIf p = "GD" Then
            bagian.Text = "Gudang"

        End If

    End Sub

    Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
        Select Case jabatan.Text
            Case "KEPALA DIVISI"
                gapok.Text = "5000000"
            Case "STAFF"
                gapok.Text = "2000000"
            Case Else
                gapok.Text = "3500000"
        End Select
        pajak.Text = gapok.Text * 0.1

    End Sub

    Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
        Select Case status.Text
            Case "Menikah"
                tunkel.Text = gapok.Text * 0.15
            Case "Tidak Menikah"

                julan.Text = ""
                tunkel.Text = 0
        End Select

    End Sub
    Private Sub julan_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles julan.KeyPress
        If e.KeyChar = Chr(13) Then

            Select Case julan.Text
                Case "0"
                    tunnak.Text = 0
                Case "1"
                    tunnak.Text = gapok.Text * 0.05
                Case "2"
                    tunnak.Text = gapok.Text * 0.1
                Case Else
                    tunnak.Text = gapok.Text * 0.5
            End Select
        End If
        toga.Text = (gapok.Text) + Val(tunnak.Text) + Val(tunkel.Text) - pajak.Text
        toga.Enabled = False

    End Sub

    Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
        Dim tanya As String
        tanya = MsgBox("Apakah Anda ingin Keluar?", MsgBoxStyle.YesNo)
        If tanya = vbCancel Then
            Me.Close()
        ElseIf tanya = vbNo Then
            Me.Focus()
        ElseIf tanya = vbYes Then
            Me.Close()
        End If

    End Sub

    Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
        nama.Text = ""
        nik.Text = ""
        bagian.Text = ""
        jabatan.Text = ""
        tunnak.Text = ""
        tunkel.Text = ""
        pajak.Text = ""
        status.Text = ""
        gapok.Text = ""
        toga.Text = ""
        julan.Text = ""


    End Sub
End Class

hasil program :


Tidak ada komentar:

Posting Komentar