Public Class Form1
Sub
addnik()
With
nik
.Items.Add("001")
.Items.Add("002")
.Items.Add("003")
End With
End Sub
Sub
rancangtabel()
With LV
.Columns.Add("NIK", 100, HorizontalAlignment.Center)
.Columns.Add("Nama", 100, HorizontalAlignment.Center)
.Columns.Add("Jabatan", 100,
HorizontalAlignment.Center)
.Columns.Add("Gaji", 100, HorizontalAlignment.Center)
.Columns.Add("Status", 100,
HorizontalAlignment.Center)
.Columns.Add("Tunj.Keluarga", 100,
HorizontalAlignment.Center)
.Columns.Add("Pajak", 100,
HorizontalAlignment.Center)
.Columns.Add("Total Gaji", 100,
HorizontalAlignment.Center)
.GridLines = True
.View = View.Details
.FullRowSelect = True
End With
End Sub
Sub
isitabel()
Dim x As New ListViewItem
x.Text = nik.Text
x.SubItems.Add(nama.Text)
x.SubItems.Add(jabatan.Text)
x.SubItems.Add(gaji.Text)
x.SubItems.Add(status.Text)
x.SubItems.Add(tunj_keluarga.Text)
x.SubItems.Add(pajak.Text)
x.SubItems.Add(total_gaji.Text)
LV.Items.Add(x)
End Sub
Sub
addjabatan()
With
jabatan
.Items.Add("Mandor")
.Items.Add("Kepala
Bagian")
.Items.Add("Staf")
End With
End Sub
Sub
addstatus()
With
status
.Items.Add("menikah")
.Items.Add("Belum
menikah")
End With
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
addjabatan()
addnik()
addstatus()
rancangtabel()
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 = "susy"
Case
"002" : nama.Text = "munthe"
Case
"003" : nama.Text = " radawi"
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"
tunj_keluarga.Text = 0.15 *
gaji.Text
Case
"Belum Menikah"
tunj_keluarga.Text = 0
tunj_keluarga.Text = "0"
End Select
End Sub
Private Sub proses_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles proses.Click
total_gaji.Text = Val(gaji.Text) +
Val(tunj_keluarga.Text) - Val(pajak.Text)
End Sub
Private Sub baru_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles baru.Click
nik.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunj_keluarga.Text = ""
pajak.Text = ""
total_gaji.Text = ""
End Sub
Private Sub keluar_Click(ByVal
sender As Object,
ByVal e As
System.EventArgs) Handles keluar.Click
End
End Sub
Private Sub simpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles simpan.Click
isitabel()
End Sub
Private Sub LV_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
LV.SelectedIndexChanged
End Sub
End Class
Dan Hasilnya :
Tidak ada komentar:
Posting Komentar