2. 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("Staf")
Status.Items.Add("Menikah")
Status.Items.Add("Belum Menikah")
buattabel()
End Sub
Sub
buattabel()
LV.Columns.Add("NIK",
80, HorizontalAlignment.Center)
LV.Columns.Add("Nama",
180, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan",
180, HorizontalAlignment.Left)
LV.Columns.Add("Gaji",
180, HorizontalAlignment.Left)
LV.Columns.Add("Status",
180, HorizontalAlignment.Left)
LV.Columns.Add("Tunjangan",
180, HorizontalAlignment.Left)
LV.Columns.Add("Pajak",
180, 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(Tunjangan.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(Total.Text)
LV.Items.Add(Lst)
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 Nik_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Nik.SelectedIndexChanged
Select Case Nik.Text
Case
"001" : Nama.Text = "Ucok"
Case
"002" : Nama.Text = "Ujang"
Case
"003" : Nama.Text = "Udin"
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" : Tunjangan.Text = 0.15
* Gaji.Text
Case
"Belum Menikah" : Tunjangan.Text =
0
End Select
End Sub
Private Sub BtnProses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnProses.Click
Total.Text = Val(Gaji.Text) +
Val(Tunjangan.Text) - Val(Pajak.Text)
End Sub
Private Sub BtnBaru_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnBaru.Click
Nik.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gaji.Text = ""
Status.Text = ""
Tunjangan.Text = ""
Pajak.Text = ""
Total.Text = ""
LV.Text = ""
End Sub
Private Sub BtnKeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BtnKeluar.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 = ""
Jabatan.Text = ""
Gaji.Text = ""
Status.Text = ""
Tunjangan.Text = ""
Pajak.Text = ""
Total.Text = ""
End Sub
End Class
No comments:
Post a Comment