Public Class Form1
Private Sub process_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles process.Click
If user.Text = "ferdel" And pasword.Text = "npm526" Then
FormKaryawan.Show()
Me.Hide()
Else
MsgBox("Password Anda Salah")
user.Text = ""
pasword.Text = ""
End If
End Sub
End Class
Listing program form karyawan
Public Class FormKaryawan
Private Sub nip_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIP.SelectedIndexChanged
If NIP.Text = "098811" Then
Nama.Text = "Pintar"
ElseIf NIP.Text = "098812" Then
Nama.Text = "Dody"
Else
Nama.Text = "Feresi Daeli"
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
GAJIPOKOK.Text = "1750000"
PAJAK.Text = (0.015 * Val(GAJIPOKOK.Text))
ElseIf JABATAN.Text = "KaBag" Then
GAJIPOKOK.Text = "2500000"
PAJAK.Text = (0.015 * Val(GAJIPOKOK.Text))
ElseIf JABATAN.Text = "Staff" Then
GAJIPOKOK.Text = "1250000"
PAJAK.Text = (0.015 * Val(GAJIPOKOK.Text))
Else
JABATAN.Text = "0"
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
TUNISTRI.Text = (0.09 * Val(GAJIPOKOK.Text))
Else
TUNISTRI.Text = "0"
JUMANAK.Text = "0"
TUNANAK.Text = "0"
End If
End Sub
Private Sub jmlhanak_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JUMANAK.TextChanged
If JUMANAK.Text = "1" Then
TUNANAK.Text = (0.03 * Val(GAJIPOKOK.Text))
ElseIf JUMANAK.Text = "2" Then
TUNANAK.Text = (0.07 * Val(GAJIPOKOK.Text))
Else
TUNANAK.Text = (0.07 * Val(GAJIPOKOK.Text))
End If
End Sub
Private Sub jam_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JUMJAM.SelectedIndexChanged
If JUMJAM.Text = "1" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "7500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "5000"
Else
GAJILEMBUR.Text = "10000"
End If
ElseIf JUMJAM.Text = "2" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "15000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "10000"
Else
GAJILEMBUR.Text = "20000"
End If
ElseIf JUMJAM.Text = "3" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "22500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "15000"
Else
GAJILEMBUR.Text = "30000"
End If
ElseIf JUMJAM.Text = "4" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "30000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "20000"
Else
GAJILEMBUR.Text = "40000"
End If
ElseIf JUMJAM.Text = "5" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "37500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "25000"
Else
GAJILEMBUR.Text = "50000"
End If
ElseIf JUMJAM.Text = "6" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "45000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "30000"
Else
GAJILEMBUR.Text = "60000"
End If
ElseIf JUMJAM.Text = "7" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "52500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "35000"
Else
GAJILEMBUR.Text = "70000"
End If
ElseIf JUMJAM.Text = "8" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "60000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "40000"
Else
GAJILEMBUR.Text = "70000"
End If
ElseIf JUMJAM.Text = "9" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "67500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "35000"
Else
GAJILEMBUR.Text = "70000"
End If
ElseIf JUMJAM.Text = "10" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "75000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "40000"
Else
GAJILEMBUR.Text = "80000"
End If
ElseIf JUMJAM.Text = "11" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "82500"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "45000"
Else
GAJILEMBUR.Text = "90000"
End If
ElseIf JUMJAM.Text = "12" Then
If JABATAN.Text = "Mandor" Then
GAJILEMBUR.Text = "90000"
ElseIf JABATAN.Text = "Staf" Then
GAJILEMBUR.Text = "50000"
Else
GAJILEMBUR.Text = "100000"
End If
End If
End Sub
Private Sub hitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hitung.Click
TOTAL.Text = Val(GAJIPOKOK.Text) + Val(TUNISTRI.Text) + Val(TUNANAK.Text) + Val(GAJILEMBUR.Text) - Val(PAJAK.Text)
End Sub
Private Sub FormKaryawan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Buattabel()
End Sub
Sub Buattabel()
LV.Columns.Add("NIP", 70, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 100, HorizontalAlignment.Center)
LV.Columns.Add("Jabatan", 70, HorizontalAlignment.Center)
LV.Columns.Add("G.Pokok", 70, HorizontalAlignment.Center)
LV.Columns.Add("Status", 120, HorizontalAlignment.Center)
LV.Columns.Add("T. Istri", 70, HorizontalAlignment.Left)
LV.Columns.Add("J. Anak", 70, HorizontalAlignment.Center)
LV.Columns.Add("T. Anak", 70, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 70, HorizontalAlignment.Center)
LV.Columns.Add("Gaji Lambur", 100, HorizontalAlignment.Left)
LV.Columns.Add("J.Jam", 70, HorizontalAlignment.Center)
LV.Columns.Add("Total", 70, HorizontalAlignment.Center)
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(GAJIPOKOK.Text)
lst.SubItems.Add(STATUS.Text)
lst.SubItems.Add(TUNISTRI.Text)
lst.SubItems.Add(JUMANAK.Text)
lst.SubItems.Add(TUNANAK.Text)
lst.SubItems.Add(PAJAK.Text)
lst.SubItems.Add(GAJILEMBUR.Text)
lst.SubItems.Add(JUMJAM.Text)
lst.SubItems.Add(TOTAL.Text)
LV.Items.Add(lst)
End Sub
Private Sub BTNProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNSimpan.Click
Dim x As String
x = MsgBox("Yakinkah Anda Menyimpan keListView ..?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "Simpan Data")
If x = vbYes Then
isitabel()
NIP.Text = ""
Nama.Text = ""
JABATAN.Text = ""
GAJIPOKOK.Text = ""
STATUS.Text = ""
TUNISTRI.Text = ""
JUMANAK.Text = ""
TUNANAK.Text = ""
PAJAK.Text = ""
GAJILEMBUR.Text = ""
JUMJAM.Text = ""
TOTAL.Text = ""
NIP.Focus()
End If
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Dim x As String
x = MsgBox("Anda yakin akan keluar..?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "Keluar")
If x = vbYes Then
End
End If
End Sub
Private Sub BtnHpsYangdilih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHpsYangdilih.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub btnhpsemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhpsemua.Click
LV.Items.Clear()
End Sub
hasil program penggajian karyawan
Mau liat klik disini
0 komentar