Public Class Form4
Sub
BuatTabel()
LV.Columns.Add("NIK",
80, HorizontalAlignment.Center)
LV.Columns.Add("Nama",
80, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan",
85, HorizontalAlignment.Left)
LV.Columns.Add("Gaji",
80, HorizontalAlignment.Left)
LV.Columns.Add("Status",
80, HorizontalAlignment.Left)
LV.Columns.Add("TunjKeluarga",
80, HorizontalAlignment.Left)
LV.Columns.Add("Pajak",
80, HorizontalAlignment.Left)
LV.Columns.Add("Total",
80, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
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(TunjKeluarga.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(Total.Text)
LV.Items.Add(Lst)
End Sub
Private Sub Form4_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("Staf")
Status.Items.Add("Menikah")
Status.Items.Add("Tidak Menikah")
BuatTabel()
End Sub
Private Sub Proses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Proses.Click
Total.Text = Val(Gaji.Text) +
Val(TunjKeluarga.Text) - Val(Pajak.Text)
IsiTabel()
NIK.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gaji.Text = ""
Status.Text = ""
TunjKeluarga.Text = ""
Pajak.Text = ""
Total.Text = ""
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles NIK.SelectedIndexChanged
Select
NIK.Text
Case
"001" : Nama.Text = "Oncan"
Case
"002" : Nama.Text = "Udin"
Case
"003" : Nama.Text = "Ujong"
End Select
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
"Staf" : Gaji.Text = 1250000
End Select
Pajak.Text = 0.15 * Gaji.Text
End Sub
Private Sub Status_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
Status.SelectedIndexChanged
Select
Status.Text
Case
"Menikah" : TunjKeluarga.Text =
0.15 * Gaji.Text
Case
"Tidak Menikah" :
TunjKeluarga.Text = 0
End Select
End Sub
Private Sub Keluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Keluar.Click
Close()
End Sub
End Class
0 comments:
Post a Comment