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")
jbtn.Items.Add("mandor")
jbtn.Items.Add("kepala
bagian")
jbtn.Items.Add("staf")
status.Items.Add("menikah")
status.Items.Add("tidak menikah")
BuatTabel()
End Sub
Sub
BuatTabel()
lv.Columns.Add("nik",
80, HorizontalAlignment.Center)
lv.Columns.Add("nama",
80, HorizontalAlignment.Center)
lv.Columns.Add("jabatan",
80, HorizontalAlignment.Center)
lv.Columns.Add("gaji",
80, HorizontalAlignment.Center)
lv.Columns.Add("status",
80, HorizontalAlignment.Center)
lv.Columns.Add("tunj.keluarga",
80, HorizontalAlignment.Center)
lv.Columns.Add("pajak",
80, HorizontalAlignment.Center)
lv.Columns.Add("total
gaji", 80, HorizontalAlignment.Center)
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(jbtn.Text)
lst.SubItems.Add(gaji.Text)
lst.SubItems.Add(status.Text)
lst.SubItems.Add(tk.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(tg.Text)
lv.Items.Add(lst)
End Sub
Private Sub
jbtn_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
jbtn.SelectedIndexChanged
Select Case jbtn.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
nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
nik.SelectedIndexChanged
Select Case nik.Text
Case
"001" : nama.Text = "oncom"
Case
"002" : nama.Text = "udin"
Case
"003" : nama.Text = "ujang"
End Select
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" : tk.Text = 0.15 *
gaji.Text
Case
"tidak menikah" : tk.Text = 0
End Select
End Sub
Private Sub
pro_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles pro.Click
tg.Text = Val(gaji.Text) + Val(tk.Text)
- Val(pajak.Text)
End Sub
Private Sub
bar_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles bar.Click
nik.Text = ""
nama.Text = ""
jbtn.Text = ""
gaji.Text = ""
status.Text = ""
tk.Text = ""
pajak.Text = ""
tg.Text = ""
End Sub
Private Sub
kel_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles kel.Click
Close()
End Sub
Private Sub
simpan_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
simpan.Click
IsiTabel()
nik.Text = ""
nama.Text = ""
jbtn.Text = ""
gaji.Text = ""
status.Text = ""
tk.Text = ""
pajak.Text = ""
tg.Text = ""
End Sub
End Class
Tidak ada komentar:
Posting Komentar