Posted by welcome to dochi blog in
on
-
Source Programnya :
Source Programnya :
Public Class Form1
Private Sub btnnama_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnama.Click
If nama.Text = "ismail" And password.Text = "ismail" Then
FormMenu.Show()
Me.Hide()
Else
MsgBox("data username/password salah")
nama.Text = ""
password.Text = ""
End If
End Sub
End Class
Hasil Program
Source Pgogramnya :
Public Class FormMenu
Private Sub DaftarPenggajianKaryawanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DaftarPenggajianKaryawanToolStripMenuItem.Click
Penggajian_Karyawan.Show()
End Sub
End Class
Tampilan Setelah Log in
Public Class Penggajian_Karyawan
Private Sub Penggajian_Karyawan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
a()
Jabatan.Items.Add("Mandor")
Jabatan.Items.Add("Kepala Bagian")
Jabatan.Items.Add("Staf")
status.Items.Add("menikah")
status.Items.Add("belum menikah")
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
If status.Text = "tidak menikah" Then
tunjangananak.Text = 0
tunjangankeluarga.Text = 0
ElseIf status.Text = "menikah" Then
tunjangankeluarga.Text = 0.09 * gajipoko.Text
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
gajipoko.Text = 1750000
ElseIf Jabatan.Text = "Kepala Bagian" Then
gajipoko.Text = 2500000
ElseIf Jabatan.Text = "Staf" Then
gajipoko.Text = 1250000
End If
End Sub
Sub a()
Lv.Columns.Add("NIK", 80, HorizontalAlignment.Left)
Lv.Columns.Add("nama", 80, HorizontalAlignment.Left)
Lv.Columns.Add("golongan", 80, HorizontalAlignment.Left)
Lv.Columns.Add("gaji pokok", 80, HorizontalAlignment.Left)
Lv.Columns.Add("lembur", 80, HorizontalAlignment.Left)
Lv.Columns.Add("jumlah lembur", 80, HorizontalAlignment.Left)
Lv.Columns.Add("pajak", 80, HorizontalAlignment.Left)
Lv.Columns.Add("status", 80, HorizontalAlignment.Left)
Lv.Columns.Add("jumlah anak", 80, HorizontalAlignment.Left)
Lv.Columns.Add("tunjangan istri", 80, HorizontalAlignment.Left)
Lv.Columns.Add("tunjangan anak", 80, HorizontalAlignment.Left)
Lv.Columns.Add("total gaji", 80, HorizontalAlignment.Left)
Lv.View = View.Details
Lv.GridLines = True
Lv.FullRowSelect = True
End Sub
Sub isi()
Dim Lst As New ListViewItem
Lst.Text = NIK.Text
Lst.SubItems.Add(nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(gajipoko.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(Jumbur.Text)
Lst.SubItems.Add(Lembur.Text)
Lst.SubItems.Add(status.Text)
Lst.SubItems.Add(jumlahanak.Text)
Lst.SubItems.Add(tunjangankeluarga.Text)
Lst.SubItems.Add(tunjangananak.Text)
Lst.SubItems.Add(totalgaji.Text)
Lv.Items.Add(Lst)
End Sub
Private Sub Pajak_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Pajak.TextChanged
Pajak.Text = 0.15 * gajipoko.Text
End Sub
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
isi()
If jumlahanak.Text = 1 Then
tunjangananak.Text = 0.03 * gajipoko.Text
ElseIf jumlahanak.Text >= 2 Then
tunjangananak.Text = 0.07 * gajipoko.Text
Else
tunjangananak.Text = 0
End If
totalgaji.Text = Val(gajipoko.Text) + Val(totalgaji.Text) + Val(tunjangananak.Text) + Val(Lembur.Text) - Val(Pajak.Text)
End Sub
Private Sub Jumbur_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jumbur.TextChanged
If Jabatan.Text = "Mandor" Then
If Jumbur.Text = 1 Then
Lembur.Text = 7500
ElseIf Jumbur.Text >= 2 Then
Lembur.Text = Jumbur.Text * 7500
Else
Lembur.Text = 0
End If
End If
If Jabatan.Text = "Kepala Bagian" Then
If Jumbur.Text = 1 Then
Lembur.Text = 10000
ElseIf Jumbur.Text >= 2 Then
Lembur.Text = Jumbur.Text * 10000
Else
Lembur.Text = 0
End If
End If
If Jabatan.Text = "staf" Then
If Lembur.Text = 1 Then
Lembur.Text = 5000
ElseIf Lembur.Text >= 2 Then
Lembur.Text = Jumbur.Text * 5000
Else : gajipoko.Text = 0
End If
End If
End Sub
End ClassHasil Program