Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "FROM GAJI"
NIK.Items.Add("001")
NIK.Items.Add("002")
NIK.Items.Add("003")
JABATAN.Items.Add("MANDOR")
JABATAN.Items.Add("KEPALA BAGIAN")
JABATAN.Items.Add("STAFF")
STATUS.Items.Add("MENIKAH")
STATUS.Items.Add("TIDAK MENIKAH")
For I = 1 To 4
JUMLAH_ANAK.Items.Add(I)
Next I
For I = 1 To 10
JAM_LEMBUR.Items.Add(I)
Next I
BUATTABEL()
End Sub
Sub BUATTABEL()
LV.Columns.Add("NIK", 80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA", 180, HorizontalAlignment.Left)
LV.Columns.Add("JABATAN", 80, HorizontalAlignment.Center)
LV.Columns.Add("GAJI", 180, HorizontalAlignment.Left)
LV.Columns.Add("STATUS", 80, HorizontalAlignment.Center)
LV.Columns.Add("TUNJ ISTRI", 180, HorizontalAlignment.Left)
LV.Columns.Add("JUMLAH ANAK", 80, HorizontalAlignment.Center)
LV.Columns.Add("TUNJ ANAK", 180, HorizontalAlignment.Left)
LV.Columns.Add("JAM LEMBUR", 80, HorizontalAlignment.Center)
LV.Columns.Add("HONOR LEMBUR", 180, HorizontalAlignment.Left)
LV.Columns.Add("PAJAK", 80, HorizontalAlignment.Left)
LV.Columns.Add("TOTAL", 180, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Sub ISITABEL()
Dim LST As New ListViewItem
LST.Text = NIK.Text
LST.SubItems.Add(Nama.Text)
LST.SubItems.Add(JABATAN.Text)
LST.SubItems.Add(Gaji.Text)
LST.SubItems.Add(STATUS.Text)
LST.SubItems.Add(Tistri.Text)
LST.SubItems.Add(JUMLAH_ANAK.Text)
LST.SubItems.Add(TUNJ_ANAK.Text)
LST.SubItems.Add(JAM_LEMBUR.Text)
LST.SubItems.Add(Ulembur.Text)
LST.SubItems.Add(PAJAK.Text)
LST.SubItems.Add(TOTAL.Text)
LV.Items.Add(LST)
End Sub
Sub bunga(ByVal t As Form)
NIK.Text = ""
Nama.Text = ""
JABATAN.Text = ""
Gaji.Text = ""
STATUS.Text = ""
Tistri.Text = ""
JUMLAH_ANAK.Text = ""
TUNJ_ANAK.Text = ""
JAM_LEMBUR.Text = ""
Ulembur.Text = ""
PAJAK.Text = ""
TOTAL.Text = ""
End Sub
Private Sub JABATAN_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JABATAN.SelectedIndexChanged
Select Case JABATAN.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 STATUS.SelectedIndexChanged
Select Case STATUS.Text
Case "MENIKAH" : Tistri.Text = 0.09 * Gaji.Text
Case "TIDAK MENIKAH" : Tistri.Text = 0
End Select
End Sub
Private Sub JUMLAH_ANAK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JUMLAH_ANAK.SelectedIndexChanged
If JUMLAH_ANAK.Text >= 2 And STATUS.Text = "MENIKAH" Then
TUNJ_ANAK.Text = 0.07 * Gaji.Text
ElseIf JUMLAH_ANAK.Text = 1 And STATUS.Text = "MENIKAH" Then
TUNJ_ANAK.Text = 0.03 * Gaji.Text
Else
TUNJ_ANAK.Text = 0
End If
End Sub
Private Sub PROSES_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PROSES.Click
If JABATAN.Text = "MANDOR" Then
Ulembur.Text = 7500
ElseIf JABATAN.Text = "KEPALA BAGIAN" Then
Ulembur.Text = 10000
ElseIf JABATAN.Text = "STAFF" Then
Ulembur.Text = 5000
Else
Ulembur.Text = 0
End If
TOTAL.Text = Val(Ulembur.Text * JAM_LEMBUR.Text) + Val(Gaji.Text) + Val(Tistri.Text) + Val(TUNJ_ANAK.Text) - Val(PAJAK.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 = "SAMLYOT HUTASOIT"
Case "002" : Nama.Text = "ANDI"
Case "003" : Nama.Text = "DIAN"
End Select
End Sub
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
MsgBox("APAKAH ANDA YAKIN INGIN MENYIMPAN?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
ISITABEL()
bunga(Me)
End Sub
Private Sub HAPUS_ITEMS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUS_ITEMS.Click
MsgBox("APAKAH ANDA YAKIN INGIN MENGHAPUS?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub HAPUS_SEMUA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUS_SEMUA.Click
MsgBox("APAKAH ANDA YAKIN INGIN MENGHAPUS?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
LV.Items.Clear()
End Sub
Private Sub KELUAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KELUAR.Click
MsgBox("APAKAH ANDA YAKIN INGIN KELUAR?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
Me.Close()
End Sub
End Class
Gambar Hasil Program
Tidak ada komentar:
Posting Komentar