Pages

Senin, 20 Mei 2013

Tugas Form Penggajian

Desain Awal Program





Listing Program Penggajian



Public Class Form_Gaji

    Private Sub Form_Gaji_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Nik.items.add("001")
        Nik.items.add("002")
        Nik.Items.Add("003")
        cmbjabatan.Items.Add("Mandor")
        cmbjabatan.Items.Add("Kepala Bagian")
        cmbjabatan.Items.Add("Staf")
        Status.Items.Add("Menikah")
        Status.Items.Add("Tidak menikah")
    End Sub

    Private Sub btnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProses.Click
        Total_Gaji.Text = Val(Gaji.Text) + Val(Tunjangan_Keluarga.Text) - Val(Pajak.Text)
    End Sub

    Private Sub cmbjabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbjabatan.SelectedIndexChanged
        Select Case cmbjabatan.Text
            Case "Mandor" : Gaji.Text = 1750000
            Case ("Kepala Bagian") : Gaji.Text = 2500000
            Case ("Staf") : Gaji.Text = 1250000
        End Select
        Pajak.Text = 0.15 * Gaji.Text
    End Sub

    Private Sub Nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Nik.SelectedIndexChanged
        Select Case Nik.Text
            Case ("001") : nama.Text = "Oncom"
            Case ("002") : nama.Text = "Udin"
            Case ("003") : nama.Text = "Ojong"
        End Select

    End Sub
    Sub isitabel()
        Dim lst As New ListViewItem
        With lst
            .Text = (Nik.Text)
            .SubItems.Add(Nama.Text)
            .SubItems.Add(Jabatan.Text)
            .SubItems.Add(Gaji.Text)
            .SubItems.Add(Status.Text)
            .SubItems.Add(Tunjangan_Keluarga.Text)
            .SubItems.Add(Pajak.Text)
            .SubItems.Add(Total_Gaji.Text)
        End With
        lV.Items.Add(lst)
    End Sub


    Private Sub Status_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
        Select Case Status.Text
            Case ("Menikah") : Tunjangan_Keluarga.Text = 0.15 * Gaji.Text
            Case ("Tida menikah") : Tunjangan_Keluarga.Text = 0
        End Select

    End Sub

    Private Sub lV_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lV.SelectedIndexChanged
        isitabel()

    End Sub
End Class


Hasil Program VB Program Penggajian 

 

Tidak ada komentar:

Posting Komentar