Listing Program
Public Class Form1
Private Sub Form1_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")
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 ayam(ByVal y 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 = "sapta fina"
Case "002" : Nama.Text = "silvi arumdita"
Case "003" : Nama.Text = "jefri hutagaol"
End Select
End Sub
Private Sub SIMPAN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SIMPAN.Click
ISITABEL()
ayam(Me)
End Sub
Private Sub HAPUSSEMUA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUSSEMUA.Click
LV.Items.Clear()
End Sub
Private Sub HAPUSITEM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HAPUSITEM.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub BATAL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BATAL.Click
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 KELUAR_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KELUAR.Click
Me.Close()
End Sub
End Class
0 komentar:
Posting Komentar