Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CmbNIK.Items.Add("001") CmbNIK.Items.Add("002") CmbNIK.Items.Add("003") CmbJabatan.Items.Add("Mandor") CmbJabatan.Items.Add("Kepala Bagian") CmbJabatan.Items.Add("Staff") For i = 1 To 4 CmbJumlahAnak.Items.Add(i) Next i For i = 1 To 10 CmbJamLembur.Items.Add(i) Next i End Sub
Private Sub Jabatan_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 "Staff" : Gaji.Text = 1250000 End Select Pajak.Text = 0.015 * Gaji.Text End Sub
Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbStatus.SelectedIndexChanged Select Case CmbStatus.Text Case "Menikah" : TunjIstri.Text = 0.09 * Gaji.Text Case "Tidak Menikah" : TunjIstri.Text = 0 End Select End Sub
Private Sub JumlahAnak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbJumlahAnak.SelectedIndexChanged If CmbJumlahAnak.Text >= 2 And CmbStatus.Text = "Menikah" Then TunjAnak.Text = 0.07 * Gaji.Text ElseIf CmbJumlahAnak.Text = 1 And CmbStatus.Text = "Menikah" Then TunjAnak.Text = 0.03 * Gaji.Text Else TunjAnak.Text = 0 End If End Sub
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click If CmbJabatan.Text = "Mandor" Then HonorLembur.Text = 7500 ElseIf CmbJabatan.Text = "Kepala Bagian" Then HonorLembur.Text = 10000 ElseIf CmbJabatan.Text = "Staff" Then HonorLembur.Text = 5000 Else HonorLembur.Text = 0 End If Total.Text = Val(HonorLembur.Text * CmbJamLembur.Text) + Val(Gaji.Text) + Val(TunjIstri.Text) + Val(TunjAnak.Text) End Sub
Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click End End Sub
Private Sub BtnBaru_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBaru.Click CmbNIK.Text = "" Nama.Text = "" CmbJabatan.Text = "" Gaji.Text = "" CmbStatus.Text = "" TunjIstri.Text = "" HonorLembur.Text = "" Pajak.Text = "" TunjAnak.Text = "" CmbJamLembur.Text = "" HonorLembur.Text = "" Total.Text = "" End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged ListView1.Columns.Add("Nik", 50, HorizontalAlignment.Left) ListView1.Columns.Add("Nama", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Jabatan", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Gaji", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Status", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Tunjangan Istri", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Jumlah Anak", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Tunjangan Anak", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Jam Lembur", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Honor lembur", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Pajak", 80, HorizontalAlignment.Left) ListView1.Columns.Add("Total", 80, HorizontalAlignment.Left) ListView1.View = View.Details ListView1.GridLines = True ListView1.FullRowSelect = True End Sub Sub isitabel() Dim lst As New ListViewItem lst.Text = CmbNIK.Text lst.SubItems.Add(Nama.Text) lst.SubItems.Add(CmbJabatan.Text) lst.SubItems.Add(Gaji.Text) lst.SubItems.Add(CmbStatus.Text) lst.SubItems.Add(CmbJumlahAnak.Text) lst.SubItems.Add(TunjAnak.Text) lst.SubItems.Add(TunjAnak.Text) lst.SubItems.Add(CmbJamLembur.Text) lst.SubItems.Add(HonorLembur.Text) lst.SubItems.Add(Pajak.Text) lst.SubItems.Add(Total.Text) ListView1.Items.Add(lst) End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click isitabel() End Sub
0 komentar:
Posting Komentar