LISTING PROGRAM LOGIN
Public Class Form1
Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnok.Click
If username.Text = "anjaz" And password.Text = "123" Then
Formmenu.Show()
Me.Hide()
Else
MsgBox("Maaf! Password salah!")
username.Text = ""
password.Text = ""
End If
End Sub
Private Sub password_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles password.KeyPress
Dim tombol As Integer = Asc(e.KeyChar)
If tombol = 13 Then
btnok_Click(sender, e)
End If
End Sub
Private Sub password_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles password.TextChanged
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
End Class
Private Sub btnok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnok.Click
If username.Text = "anjaz" And password.Text = "123" Then
Formmenu.Show()
Me.Hide()
Else
MsgBox("Maaf! Password salah!")
username.Text = ""
password.Text = ""
End If
End Sub
Private Sub password_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles password.KeyPress
Dim tombol As Integer = Asc(e.KeyChar)
If tombol = 13 Then
btnok_Click(sender, e)
End If
End Sub
Private Sub password_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles password.TextChanged
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 FORMMENU
Public Class formmenu
Private Sub DataPenggajianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPenggajianToolStripMenuItem.Click
Penggajian.Show()
End Sub
End Class
Private Sub DataPenggajianToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPenggajianToolStripMenuItem.Click
Penggajian.Show()
End Sub
End Class
Hasil Program
LISTING PROGRAM PENGGAJIAN KARYAWAN
Public Class Penggajian
Sub clearisian()
No.Text = ""
Kode.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gaji.Text = ""
Status.Text = ""
Tistri.Text = ""
Janak.Text = ""
Tanak.Text = ""
Jam.Text = ""
Lembur.Text = ""
Pajak.Text = ""
Total.Text = ""
No.Focus()
End Sub
Sub buattabel()
Lv.Columns.Add("No", 30, HorizontalAlignment.Center)
Lv.Columns.Add("Kode Pegawai", 80, HorizontalAlignment.Left)
Lv.Columns.Add("Nama Pegawai", 180, 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 = No.Text
Lst.SubItems.Add(Kode.Text)
Lst.SubItems.Add(Nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(Gaji.Text)
Lst.SubItems.Add(Status.Text)
Lst.SubItems.Add(Tistri.Text)
Lst.SubItems.Add(Janak.Text)
Lst.SubItems.Add(Tanak.Text)
Lst.SubItems.Add(Jam.Text)
Lst.SubItems.Add(Lembur.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(Total.Text)
Lv.Items.Add(Lst)
End Sub
Private Sub Penggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
Kode.Items.Add("A001")
Kode.Items.Add("A002")
Kode.Items.Add("B001")
Kode.Items.Add("B002")
Jabatan.Items.Add("MANDOR")
Jabatan.Items.Add("KEPALA BAGIAN")
Jabatan.Items.Add("STAF")
Status.Items.Add("MENIKAH")
Status.Items.Add("TIDAK MENIKAH")
Jam.Items.Add("1")
Jam.Items.Add("2")
Jam.Items.Add("3")
End Sub
Private Sub Keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Keluar.Click
Me.Close()
End Sub
Private Sub Bersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bersih.Click
Call clearisian()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
isitabel()
End Sub
Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode.SelectedIndexChanged
If Kode.Text = "A001" Then
Nama.Text = "Nur Anjas"
ElseIf Kode.Text = "A002" Then
Nama.Text = "Nanda"
ElseIf Kode.Text = "B001" Then
Nama.Text = "Dika"
ElseIf Kode.Text = "B002" Then
Nama.Text = "Putri"
End If
End Sub
Private Sub Jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jabatan.SelectedIndexChanged
If Jabatan.Text = "MANDOR" Then
Gaji.Text = 1750000
ElseIf Jabatan.Text = "KEPALA BAGIAN" 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
Tistri.Text = (0.09 * Gaji.Text)
ElseIf Status.Text = "TIDAK MENIKAH" Then
Tistri.Text = 0
End If
End Sub
Private Sub proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles proses.Click
If Janak.Text = 1 Then
Tanak.Text = (0.03 * Gaji.Text)
ElseIf Janak.Text >= 2 Then
Tanak.Text = (0.07 * Gaji.Text)
End If
If Jabatan.Text = "STAF" And Jam.Text = 1 Then
Lembur.Text = 5000
ElseIf Jabatan.Text = "STAF" And Jam.Text = 2 Then
Lembur.Text = 10000
ElseIf Jabatan.Text = "STAF" And Jam.Text = 3 Then
Lembur.Text = 15000
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 1 Then
Lembur.Text = 7500
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 2 Then
Lembur.Text = 15000
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 3 Then
Lembur.Text = 22500
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 1 Then
Lembur.Text = 10000
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 2 Then
Lembur.Text = 20000
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 3 Then
Lembur.Text = 30000
End If
Pajak.Text = (0.015 * Gaji.Text)
Total.Text = Val(Gaji.Text) + Val(Tistri.Text) + Val(Tanak.Text) + Val(Lembur.Text) - Val(Pajak.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
Private Sub Hapuspilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapuspilih.Click
Lv.Items.Remove(Lv.SelectedItems(0))
End Sub
End Class
Sub clearisian()
No.Text = ""
Kode.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gaji.Text = ""
Status.Text = ""
Tistri.Text = ""
Janak.Text = ""
Tanak.Text = ""
Jam.Text = ""
Lembur.Text = ""
Pajak.Text = ""
Total.Text = ""
No.Focus()
End Sub
Sub buattabel()
Lv.Columns.Add("No", 30, HorizontalAlignment.Center)
Lv.Columns.Add("Kode Pegawai", 80, HorizontalAlignment.Left)
Lv.Columns.Add("Nama Pegawai", 180, 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 = No.Text
Lst.SubItems.Add(Kode.Text)
Lst.SubItems.Add(Nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(Gaji.Text)
Lst.SubItems.Add(Status.Text)
Lst.SubItems.Add(Tistri.Text)
Lst.SubItems.Add(Janak.Text)
Lst.SubItems.Add(Tanak.Text)
Lst.SubItems.Add(Jam.Text)
Lst.SubItems.Add(Lembur.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(Total.Text)
Lv.Items.Add(Lst)
End Sub
Private Sub Penggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
buattabel()
Kode.Items.Add("A001")
Kode.Items.Add("A002")
Kode.Items.Add("B001")
Kode.Items.Add("B002")
Jabatan.Items.Add("MANDOR")
Jabatan.Items.Add("KEPALA BAGIAN")
Jabatan.Items.Add("STAF")
Status.Items.Add("MENIKAH")
Status.Items.Add("TIDAK MENIKAH")
Jam.Items.Add("1")
Jam.Items.Add("2")
Jam.Items.Add("3")
End Sub
Private Sub Keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Keluar.Click
Me.Close()
End Sub
Private Sub Bersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bersih.Click
Call clearisian()
End Sub
Private Sub Simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Simpan.Click
isitabel()
End Sub
Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode.SelectedIndexChanged
If Kode.Text = "A001" Then
Nama.Text = "Nur Anjas"
ElseIf Kode.Text = "A002" Then
Nama.Text = "Nanda"
ElseIf Kode.Text = "B001" Then
Nama.Text = "Dika"
ElseIf Kode.Text = "B002" Then
Nama.Text = "Putri"
End If
End Sub
Private Sub Jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jabatan.SelectedIndexChanged
If Jabatan.Text = "MANDOR" Then
Gaji.Text = 1750000
ElseIf Jabatan.Text = "KEPALA BAGIAN" 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
Tistri.Text = (0.09 * Gaji.Text)
ElseIf Status.Text = "TIDAK MENIKAH" Then
Tistri.Text = 0
End If
End Sub
Private Sub proses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles proses.Click
If Janak.Text = 1 Then
Tanak.Text = (0.03 * Gaji.Text)
ElseIf Janak.Text >= 2 Then
Tanak.Text = (0.07 * Gaji.Text)
End If
If Jabatan.Text = "STAF" And Jam.Text = 1 Then
Lembur.Text = 5000
ElseIf Jabatan.Text = "STAF" And Jam.Text = 2 Then
Lembur.Text = 10000
ElseIf Jabatan.Text = "STAF" And Jam.Text = 3 Then
Lembur.Text = 15000
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 1 Then
Lembur.Text = 7500
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 2 Then
Lembur.Text = 15000
ElseIf Jabatan.Text = "MANDOR" And Jam.Text = 3 Then
Lembur.Text = 22500
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 1 Then
Lembur.Text = 10000
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 2 Then
Lembur.Text = 20000
ElseIf Jabatan.Text = "KEPALA BAGIAN" And Jam.Text = 3 Then
Lembur.Text = 30000
End If
Pajak.Text = (0.015 * Gaji.Text)
Total.Text = Val(Gaji.Text) + Val(Tistri.Text) + Val(Tanak.Text) + Val(Lembur.Text) - Val(Pajak.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
Private Sub Hapuspilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hapuspilih.Click
Lv.Items.Remove(Lv.SelectedItems(0))
End Sub
End Class
Hasil Program
Tidak ada komentar:
Posting Komentar