KASUS : KLIK DISINI
FORM LOGIN
LISTING PROGRAM
FORM PENGGAJIAN KARYAWAN
LISTING PROGRAM
FORM LOGIN
LISTING PROGRAM
Public Class Form1
Private Sub BTNOK_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNOK.Click
If
USERNAME.Text = "PESTA" And PASSWORD.Text = "12345"
Then
FormMenu.Show()
Me.Hide()
Else
MsgBox("MAAF!
PASSWORD SALAH!")
USERNAME.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
FORM MENU
LISTING PROGRAM
Public Class FormMenu
Private Sub KELUARToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
KELUARToolStripMenuItem.Click
End
End Sub
Private Sub DATAPENGGAJIANToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
DATAPENGGAJIANToolStripMenuItem.Click
karyawan.show()
End Sub
End Class
FORM PENGGAJIAN KARYAWAN
LISTING PROGRAM
Public Class karyawan
Sub
TdkAktif()
ISTRI.Visible = False
TUNJA.Visible = False
ANAK.Visible = False
End Sub
Sub Aktif()
ISTRI.Visible = True
TUNJA.Visible = True
ANAK.Visible = True
End Sub
Private Sub karyawan_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TdkAktif()
BUATTABEL()
ISITABEL()
JABATAN.Items.Add("KABAG")
JABATAN.Items.Add("MANDOR")
JABATAN.Items.Add("STAF")
STATUS.Items.Add("Menikah")
STATUS.Items.Add("Belum Menikah")
End Sub
Sub
BUATTABEL()
LV.Columns.Add("NIP",
80, HorizontalAlignment.Center)
LV.Columns.Add("NAMA
KARYAWAN", 180, HorizontalAlignment.Left)
LV.Columns.Add("GOL",
80, HorizontalAlignment.Left)
LV.Columns.Add("GAJI",
80, HorizontalAlignment.Left)
LV.Columns.Add("STATUS",
80, HorizontalAlignment.Left)
LV.Columns.Add("ISTRI",
80, HorizontalAlignment.Left)
LV.Columns.Add("TUNJA",
80, HorizontalAlignment.Left)
LV.Columns.Add("JUMLAH
ANAK", 80, HorizontalAlignment.Left)
LV.Columns.Add("PAJAK",
80, HorizontalAlignment.Left)
LV.Columns.Add("JAM
KERJA", 80, HorizontalAlignment.Left)
LV.Columns.Add("TOTAL
LEMBUR", 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()
For i =
1 To 3
NIP.Items.Add("000" & i)
Next
End Sub
Private Sub NIP_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
NIP.SelectedIndexChanged
If
NIP.Text = "0001" Then
NAMA.Text = "DEDE"
ElseIf
NIP.Text = "0002" Then
NAMA.Text = "SUSI"
ElseIf
NIP.Text = "0003" Then
NAMA.Text = "DIDI"
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 = "KABAG" Then
GAJI.Text = 2500000
ElseIf
JABATAN.Text = "STAF" Then
GAJI.Text = 1250000
End If
PAJAK.Text = GAJI.Text * 0.015
End Sub
Private Sub STATUS_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
STATUS.SelectedIndexChanged
If
STATUS.Text = "Menikah" Then
ISTRI.Text = GAJI.Text * 0.9
Aktif()
ElseIf
STATUS.Text = "Belum Menikah" Then
TdkAktif()
Else
ISTRI.Text = 0
End If
End Sub
Private Sub BTNOK_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNOK.Click
Dim
sublv As New
ListViewItem
sublv.Text = NIP.Text
sublv.SubItems.Add(NAMA.Text)
sublv.SubItems.Add(JABATAN.Text)
sublv.SubItems.Add("RP. " & GAJI.Text)
sublv.SubItems.Add(STATUS.Text)
sublv.SubItems.Add("RP. " & ISTRI.Text)
sublv.SubItems.Add(" RP. " & TUNJA.Text)
sublv.SubItems.Add(ANAK.Text)
sublv.SubItems.Add("RP. " & PAJAK.Text)
sublv.SubItems.Add(JAM.Text)
sublv.SubItems.Add("RP. " & TLEMBUR.Text)
sublv.SubItems.Add("RP. " & TOTAL.Text)
LV.Items.Add(sublv)
End Sub
Private Sub BTNKELUAR_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNKELUAR.Click
End
End Sub
Private Sub BTNHAPUS_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BTNHAPUS.Click
NIP.Text = ""
NAMA.Text = ""
JABATAN.Text = ""
GAJI.Text = ""
STATUS.Text = ""
ISTRI.Text = ""
TUNJA.Text = ""
ANAK.Text = ""
PAJAK.Text = ""
TOTAL.Text = ""
NIP.Focus()
End Sub
Private Sub TUNJA_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles ISTRI.TextChanged
ISTRI.Text = GAJI.Text * 0.9
End Sub
Private Sub Button1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs)
End Sub
Private Sub ANAK_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles ANAK.TextChanged
If
ANAK.Text = "1" Then
TUNJA.Text = GAJI.Text * 0.3
ElseIf
ANAK.Text = "2" Then
TUNJA.Text = GAJI.Text * 0.7
ElseIf
ANAK.Text >= 2 Then
TUNJA.Text = GAJI.Text * 0.7
End If
End Sub
Private Sub JAM_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles JAM.TextChanged
If
JABATAN.Text = "STAF" Then
TLEMBUR.Text = JAM.Text * 5000
ElseIf
JABATAN.Text = "KABAG" Then
TLEMBUR.Text = JAM.Text * 10000
ElseIf JABATAN.Text = "MANDOR"
Then
TLEMBUR.Text = JAM.Text * 7500
Else
TLEMBUR.Text = 0
End If
TOTAL.Text = Val(GAJI.Text) +
Val(ISTRI.Text) + Val(TUNJA.Text) + Val(TLEMBUR.Text) - Val(PAJAK.Text)
End Sub
End Class