listing program
Public Class Form1Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
If nama.Text = "NIA" And password.Text = "123" Then
formmenu.Show()
Me.Hide()
Else
MsgBox("Maaf! Password salah!")
nama.Text = ""
password.Text = ""
End If
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
End Class
hasil program
listing program
Public Class formmenuPrivate Sub DataPenggajianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPenggajianToolStripMenuItem.Click
penggajian.show()
End Sub
Private Sub KeluarProgramToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarProgramToolStripMenuItem.Click
End
End Sub
End Class
hasil gambar
listing program
Public Class penggajian
Sub buattabel()
lv.Columns.Add("Nip", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nama Pegawai", 100, HorizontalAlignment.Left)
lv.Columns.Add("Jabatan", 80, HorizontalAlignment.Left)
lv.Columns.Add("Gaji", 80, HorizontalAlignment.Left)
lv.Columns.Add("Status", 80, HorizontalAlignment.Left)
lv.Columns.Add("Tunj Istri", 80, HorizontalAlignment.Left)
lv.Columns.Add("Jumlah Anak", 80, HorizontalAlignment.Left)
lv.Columns.Add("Tunj Anak", 80, HorizontalAlignment.Left)
lv.Columns.Add("Jam", 50, HorizontalAlignment.Left)
lv.Columns.Add("Lembur", 80, HorizontalAlignment.Left)
lv.Columns.Add("Pajak", 80, HorizontalAlignment.Left)
lv.Columns.Add("Total Gaji", 80, HorizontalAlignment.Left)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub isitabel()
Dim Lst As New ListViewItem
Lst.Text = nip.Text
Lst.SubItems.Add(nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(Gaji.Text)
Lst.SubItems.Add(Status.Text)
Lst.SubItems.Add(jlh_anak.Text)
Lst.SubItems.Add(tunj_istri.Text)
Lst.SubItems.Add(tunj_anak.Text)
Lst.SubItems.Add(Jam.Text)
Lst.SubItems.Add(lembur.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(total_gaji.Text)
lv.Items.Add(Lst)
End Sub
Sub clearisian()
nip.Text = ""
nama.Text = ""
jabatan.Text = ""
gaji.Text = ""
status.Text = ""
tunj_istri.Text = ""
jlh_anak.Text = ""
tunj_anak.Text = ""
jam.Text = ""
lembur.Text = ""
pajak.Text = ""
total_gaji.Text = ""
nip.Focus()
End Sub
Private Sub penggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
nip.Items.Add("001")
nip.Items.Add("002")
nip.Items.Add("003")
jabatan.Items.Add("MANAGER")
jabatan.Items.Add("MANDOR")
jabatan.Items.Add("STAF")
status.Items.Add("MENIKAH")
status.Items.Add("TIDAK MENIKAH")
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpan.Click
isitabel()
End Sub
Private Sub btnbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbersih.Click
Call clearisian()
End Sub
Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nip.SelectedIndexChanged
If nip.Text = "001" Then
nama.Text = "NIA"
ElseIf nip.Text = "002" Then
nama.Text = "AYU"
ElseIf nip.Text = "003" Then
nama.Text = "NORA"
End If
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
If jabatan.Text = "MANAGER" Then
gaji.Text = 1750000
ElseIf jabatan.Text = "MANDOR" Then
gaji.Text = 2500000
ElseIf jabatan.Text = "STAF" Then
gaji.Text = 1250000
End If
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
If status.Text = "MENIKAH" Then
tunj_istri.Text = (0.09 * gaji.Text)
ElseIf status.Text = "TIDAK MENIKAH" Then
tunj_istri.Text = 0
End If
End Sub
Private Sub btnoke_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnoke.Click
If jlh_anak.Text = 1 Then
tunj_anak.Text = (0.03 * gaji.Text)
ElseIf jlh_anak.Text >= 2 Then
tunj_anak.Text = (0.07 * gaji.Text)
End If
If jabatan.Text = "STAF" Then
lembur.Text = jam.Text * 5000
ElseIf jabatan.Text = "MANAGER" Then
lembur.Text = jam.Text * 7500
ElseIf jabatan.Text = "MANDOR" Then
lembur.Text = jam.Text * 10000
End If
pajak.Text = (0.015 * gaji.Text)
total_gaji.Text = Val(gaji.Text) + Val(tunj_istri.Text) + Val(tunj_anak.Text) + Val(label12.Text) - Val(pajak.Text)
End Sub
Private Sub btnhapusdtaygdipilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapusdtaygdipilih.Click
lv.Items.Remove(lv.SelectedItems(0))
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
lv.Items.Clear()
End Sub
End Class
hasil program
kembali ke soal quiz