Silahkan Ketikkan Program Di bawah Ini :
Public Class Form1
Sub
buattabel()
LV.GridLines = True
LV.View = View.Details
LV.FullRowSelect = True
LV.Columns.Add("NIK",
50, HorizontalAlignment.Center)
LV.Columns.Add("Nama",
150, HorizontalAlignment.Left)
LV.Columns.Add("Jabatan",
85, HorizontalAlignment.Center)
LV.Columns.Add("Gaji",
85, HorizontalAlignment.Center)
LV.Columns.Add("Status",
85, HorizontalAlignment.Center)
LV.Columns.Add("Tunj.Keluarga",
85, HorizontalAlignment.Left)
LV.Columns.Add("Pajak",
85, HorizontalAlignment.Center)
LV.Columns.Add("Total
Gaji", 85, HorizontalAlignment.Center)
End Sub
Private Sub cmdSimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSimpan.Click
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(tunj_Kel.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(total.Text)
LV.Items.Add(lst)
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Call
buattabel()
Call
items()
End Sub
Sub items()
NIK.Items.Add("0987654321")
NIK.Items.Add("0876543212")
NIK.Items.Add("1423576983")
NIK.Items.Add("2365871894")
NIK.Items.Add("3521876905")
NIK.Items.Add("4356789106")
NIK.Items.Add("5169021387")
NIK.Items.Add("6987543218")
NIK.Items.Add("7125436789")
NIK.Items.Add("1043265710")
jabatan.Items.Add("Kepala Perusahaan")
jabatan.Items.Add("Manager")
jabatan.Items.Add("Sekretaris")
jabatan.Items.Add("Staf")
jabatan.Items.Add("Teknisi")
jabatan.Items.Add("Marketing")
jabatan.Items.Add("Supir")
jabatan.Items.Add("Satpam")
jabatan.Items.Add("OfficeBoy")
jabatan.Items.Add("Juru Parkir")
status.Items.Add("Menikah")
status.Items.Add("Tidak Menikah")
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
NIK.SelectedIndexChanged
Select Case NIK.Text
Case
"0987654321" : nama.Text = "MR.Najmin"
Case
"0876543212" : nama.Text = "MR.Roger"
Case
"1423576983" : nama.Text = "MS.Angraini"
Case
"2365871894" : nama.Text = "Wulandari"
Case
"3521876905" : nama.Text = "Andi"
Case
"4356789106" : nama.Text = "Sry Rahayu"
Case
"5169021387" : nama.Text = "Raditya"
Case
"6987543218" : nama.Text = "Tornado Lorenzo"
Case
"7125436789" : nama.Text = "Bunga"
Case
"1043265710" : nama.Text = "Sahidin"
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_Kel.Text = 0.15 *
gaji.Text
Case
"Tidak Menikah" : tunj_Kel.Text =
0
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
"Kepala Perusahaan" : gaji.Text =
4500000
Case
"Manager" : gaji.Text = 3500000
Case
"Staf" : gaji.Text = 2250000
Case
"Teknisi" : gaji.Text = 2000000
Case
"Marketing" : gaji.Text = 850000
Case "Supir" : gaji.Text = 1250000
Case
"Satpam" : gaji.Text = 1000000
Case
"OfficeBoy" : gaji.Text = 750000
Case
"Juru Parkir" : gaji.Text = 500000
End Select
pajak.Text = 0.1 * gaji.Text
End Sub
Private Sub cmdProses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles cmdProses.Click
total.Text = Val(gaji.Text) +
Val(tunj_Kel.Text) - Val(pajak.Text)
End Sub
Private Sub cmdKeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles cmdKeluar.Click
End
End Sub
Private Sub cmdBaru_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles cmdBaru.Click
Call
bersih()
End Sub
Sub
bersih()
NIK.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunj_Kel.Text = ""
pajak.Text = ""
total.Text = ""
End Sub
Private Sub HapusSemua_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles HapusSemua.Click
LV.Items.Clear()
End Sub
End Class
Kira-Kira Hasilnya Akan Seperti Ini :
No comments:
Post a Comment