Form Penggajian Pegawai



LISTING PROGRAM :


Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        BuatTabel()
        bnik.Items.Add("001")
        bnik.Items.Add("002")
        bnik.Items.Add("003")

        bjabat.Items.Add("Mandor")
        bjabat.Items.Add("Kepala Bagian")
        bjabat.Items.Add("Staf")

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

    End Sub

    Sub BuatTabel()
        LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Nama", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Jabatan", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Gaji", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Status", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Tunjangan", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Total", 80, HorizontalAlignment.Center)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True

    End Sub

    Sub IsiTabel()
        Dim lst As New ListViewItem
        lst.Text = bnik.Text
        lst.SubItems.Add(bnama.Text)
        lst.SubItems.Add(bjabat.Text)
        lst.SubItems.Add(bgaji.Text)
        lst.SubItems.Add(bstat.Text)
        lst.SubItems.Add(btunj.Text)
        lst.SubItems.Add(bpajak.Text)
        lst.SubItems.Add(btotal.Text)
        LV.Items.Add(lst)

    End Sub

    Private Sub Jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bjabat.SelectedIndexChanged

        Select Case bjabat.Text
            Case "Mandor" : bgaji.Text = 1750000
            Case "Kepala Bagian" : bgaji.Text = 2500000
            Case "Staf" : bgaji.Text = 1250000
        End Select

        bpajak.Text = 0.15 * bgaji.Text

    End Sub

    Private Sub NIK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnik.SelectedIndexChanged

        Select Case bnik.Text
            Case "001" : bnama.Text = "Oncom"
            Case "002" : bnama.Text = "Udin"
            Case "003" : bnama.Text = "Ujang"

        End Select

    End Sub

    Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bstat.SelectedIndexChanged

        Select Case bstat.Text
            Case "Menikah" : btunj.Text = 0.15 * bgaji.Text
            Case "Tidak Menikah" : btunj.Text = 0

        End Select

    End Sub

    Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click

        End
    
    End Sub

    Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click

        btotal.Text = Val(bgaji.Text) + Val(btunj.Text) - Val(bpajak.Text)

    End Sub

    Private Sub Btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus.Click

        bnik.Text = ""
        bnama.Text = ""
        bjabat.Text = ""
        bgaji.Text = ""
        bstat.Text = ""
        btunj.Text = ""
        btotal.Text = ""
        bpajak.Text = ""

    End Sub

    Private Sub Btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnsimpan.Click

        IsiTabel()
        bnik.Text = ""
        bnama.Text = ""
        bjabat.Text = ""
        bgaji.Text = ""
        bstat.Text = ""
        btunj.Text = ""
        bpajak.Text = ""
        btotal.Text = ""

    End Sub


Back to top