kasus : klik disini
Listing Program Menu Login
Public Class Login
Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
If NIK.Text = "Fitri" And Pasword.Text = "1234" Then
FromMenu.Show()
Me.Hide()
Else
MsgBox("Maaf!! Password Salah !")
NIK.Text = ""
Pasword.Text = ""
End If
End Sub
End Class
Private Sub BtnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOK.Click
If NIK.Text = "Fitri" And Pasword.Text = "1234" Then
FromMenu.Show()
Me.Hide()
Else
MsgBox("Maaf!! Password Salah !")
NIK.Text = ""
Pasword.Text = ""
End If
End Sub
End Class
Listing Program FromMenu
Public Class FromMenu
Private Sub DataPerusahaanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPerusahaanToolStripMenuItem.Click
Form1.MdiParent = Me
Form1.Show()
End Sub
End Class
Private Sub DataPerusahaanToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataPerusahaanToolStripMenuItem.Click
Form1.MdiParent = Me
Form1.Show()
End Sub
End Class
Listing Form1
Public Class Form1
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 = "Kepala Bagian" Then
Gajipokok.Text = 2500000
Pajak.Text = (0.015 * Val(Gajipokok.Text))
ElseIf Jabatan.Text = "Staf" Then
Gajipokok.Text = 1250000
Pajak.Text = (0.015 * Val(Gajipokok.Text))
Else
Gajipokok.Text = 0
End If
End Sub
Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
NIK.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gajipokok.Text = ""
StatusKerja.Text = ""
Jamlembur.Text = ""
Upahlembur.Text = ""
Pajak.Text = ""
status.Text = ""
Jumlahanak.Text = ""
Tunjanganistri.Text = ""
Tunjangananak.Text = ""
Totalgaji.Text = ""
NIK.Focus()
LV.Items.Clear()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Jabatan.Items.Add("Mandor")
Jabatan.Items.Add("Kepala Bagian")
Jabatan.Items.Add("Staf")
StatusKerja.Items.Add("Lembur")
StatusKerja.Items.Add("Tidak Lembur")
status.Items.Add("MENIKAH")
status.Items.Add("BELUM MENIKAH")
Jumlahanak.Enabled = False
Dim i As Integer
For i = 1 To 5
Jamlembur.Items.Add(i)
Next
BuatTabel()
IsiTabel()
End Sub
Sub IsiTabel()
For i = 1 To 3
NIK.Items.Add("00" & i)
Next
Dim Lst As New ListViewItem
Lst.Text = NIK.Text
Lst.SubItems.Add(Nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(Gajipokok.Text)
Lst.SubItems.Add(StatusKerja.Text)
Lst.SubItems.Add(Jamlembur.Text)
Lst.SubItems.Add(Upahlembur.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(status.Text)
Lst.SubItems.Add(Jumlahanak.Text)
Lst.SubItems.Add(Tunjanganistri.Text)
Lst.SubItems.Add(Tunjangananak.Text)
Lst.SubItems.Add(Totalgaji.Text)
LV.Items.Add(Lst)
End Sub
Sub BuatTabel()
LV.Columns.Add("NIK", 70, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jabatan", 70, HorizontalAlignment.Center)
LV.Columns.Add("Gajipokok", 100, HorizontalAlignment.Center)
LV.Columns.Add("Status Kerja", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jam Lembur", 100, HorizontalAlignment.Center)
LV.Columns.Add("Upah Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Status", 70, HorizontalAlignment.Center)
LV.Columns.Add("Jumlahanak", 70, HorizontalAlignment.Center)
LV.Columns.Add("Tunjanganistri", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangananak", 90, HorizontalAlignment.Center)
LV.Columns.Add("Total Gaji", 100, HorizontalAlignment.Center)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
If status.Text = "BELUM MENIKAH" Then
Tunjangananak.Text = 0
Tunjanganistri.Text = 0
Jumlahanak.Enabled = False
ElseIf status.Text = "MENIKAH" Then
Jumlahanak.Enabled = True
Tunjanganistri.Text = (0.09 * Val(Gajipokok.Text))
End If
End Sub
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
Totalgaji.Text = Val(Gajipokok.Text) + Val(Tunjangananak.Text) + Val(Tunjanganistri.Text) + Val(Upahlembur.Text) - Val(Pajak.Text)
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIK.SelectedIndexChanged
Select Case NIK.Text
Case "001"
Nama.Text = "Fitri"
Case "002"
Nama.Text = "Handayani"
Case "003"
Nama.Text = "Uci"
Case "004"
Nama.Text = "Dedi"
End Select
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
End
End Sub
Private Sub Jumlahanak_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jumlahanak.TextChanged
If Jumlahanak.Text = "" Then
Tunjangananak.Text = 0
ElseIf Jumlahanak.Text = 1 Then
Tunjangananak.Text = Val(Jumlahanak.Text) * (0.03 * Val(Gajipokok.Text))
ElseIf Jumlahanak.Text = 2 Then
Tunjangananak.Text = 2 * (0.07 * Val(Gajipokok.Text))
ElseIf Jumlahanak.Text >= 2 Then
Tunjangananak.Text = 2 * (0.07 * Val(Gajipokok.Text))
End If
End Sub
Private Sub StatusKerja_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusKerja.SelectedIndexChanged
If Jabatan.Text = "Mandor" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (5000)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (5000)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (5000)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (5000)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (5000)
Else
Upahlembur.Text = 0
End If
ElseIf Jabatan.Text = "Kepala Bagian" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (10000)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (10000)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (10000)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (10000)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (10000)
Else
Upahlembur.Text = 0
End If
ElseIf Jabatan.Text = "Staf" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (7500)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (7500)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (7500)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (7500)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (7500)
Else
Upahlembur.Text = 0
End If
End If
If StatusKerja.Text = "Tidak Lembur" Then
Jamlembur.Text = 0
Upahlembur.Text = 0
End If
End Sub
Private Sub Totalgaji_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Totalgaji.TextChanged
End Sub
Private Sub SimpanLV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpanLV.Click
Dim sublv As New ListViewItem
sublv.Text = NIK.Text
sublv.SubItems.Add(Nama.Text)
sublv.SubItems.Add(Jabatan.Text)
sublv.SubItems.Add("RP. " & Gajipokok.Text)
sublv.SubItems.Add(StatusKerja.Text)
sublv.SubItems.Add(Jamlembur.Text)
sublv.SubItems.Add("RP. " & Upahlembur.Text)
sublv.SubItems.Add("RP. " & Pajak.Text)
sublv.SubItems.Add(status.Text)
sublv.SubItems.Add(Jumlahanak.Text)
sublv.SubItems.Add("RP. " & Tunjanganistri.Text)
sublv.SubItems.Add("RP. " & Tunjangananak.Text)
sublv.SubItems.Add("RP. " & Totalgaji.Text)
LV.Items.Add(sublv)
End Sub
Private Sub Jamlembur_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jamlembur.SelectedIndexChanged
If Jabatan.Text = "Mandor" Then
Upahlembur.Text = 7500 * Jamlembur.Text
ElseIf Jabatan.Text = "Kepala Bagian" Then
Upahlembur.Text = 10000 * Jamlembur.Text
ElseIf Jabatan.Text = "Staf" Then
Upahlembur.Text = 5000 * Jamlembur.Text
End If
End Sub
Private Sub BtnHapussatu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapussatu.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
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 = "Kepala Bagian" Then
Gajipokok.Text = 2500000
Pajak.Text = (0.015 * Val(Gajipokok.Text))
ElseIf Jabatan.Text = "Staf" Then
Gajipokok.Text = 1250000
Pajak.Text = (0.015 * Val(Gajipokok.Text))
Else
Gajipokok.Text = 0
End If
End Sub
Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
NIK.Text = ""
Nama.Text = ""
Jabatan.Text = ""
Gajipokok.Text = ""
StatusKerja.Text = ""
Jamlembur.Text = ""
Upahlembur.Text = ""
Pajak.Text = ""
status.Text = ""
Jumlahanak.Text = ""
Tunjanganistri.Text = ""
Tunjangananak.Text = ""
Totalgaji.Text = ""
NIK.Focus()
LV.Items.Clear()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Jabatan.Items.Add("Mandor")
Jabatan.Items.Add("Kepala Bagian")
Jabatan.Items.Add("Staf")
StatusKerja.Items.Add("Lembur")
StatusKerja.Items.Add("Tidak Lembur")
status.Items.Add("MENIKAH")
status.Items.Add("BELUM MENIKAH")
Jumlahanak.Enabled = False
Dim i As Integer
For i = 1 To 5
Jamlembur.Items.Add(i)
Next
BuatTabel()
IsiTabel()
End Sub
Sub IsiTabel()
For i = 1 To 3
NIK.Items.Add("00" & i)
Next
Dim Lst As New ListViewItem
Lst.Text = NIK.Text
Lst.SubItems.Add(Nama.Text)
Lst.SubItems.Add(Jabatan.Text)
Lst.SubItems.Add(Gajipokok.Text)
Lst.SubItems.Add(StatusKerja.Text)
Lst.SubItems.Add(Jamlembur.Text)
Lst.SubItems.Add(Upahlembur.Text)
Lst.SubItems.Add(Pajak.Text)
Lst.SubItems.Add(status.Text)
Lst.SubItems.Add(Jumlahanak.Text)
Lst.SubItems.Add(Tunjanganistri.Text)
Lst.SubItems.Add(Tunjangananak.Text)
Lst.SubItems.Add(Totalgaji.Text)
LV.Items.Add(Lst)
End Sub
Sub BuatTabel()
LV.Columns.Add("NIK", 70, HorizontalAlignment.Center)
LV.Columns.Add("Nama", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jabatan", 70, HorizontalAlignment.Center)
LV.Columns.Add("Gajipokok", 100, HorizontalAlignment.Center)
LV.Columns.Add("Status Kerja", 80, HorizontalAlignment.Center)
LV.Columns.Add("Jam Lembur", 100, HorizontalAlignment.Center)
LV.Columns.Add("Upah Lembur", 80, HorizontalAlignment.Center)
LV.Columns.Add("Pajak", 80, HorizontalAlignment.Center)
LV.Columns.Add("Status", 70, HorizontalAlignment.Center)
LV.Columns.Add("Jumlahanak", 70, HorizontalAlignment.Center)
LV.Columns.Add("Tunjanganistri", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tunjangananak", 90, HorizontalAlignment.Center)
LV.Columns.Add("Total Gaji", 100, HorizontalAlignment.Center)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Private Sub status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles status.SelectedIndexChanged
If status.Text = "BELUM MENIKAH" Then
Tunjangananak.Text = 0
Tunjanganistri.Text = 0
Jumlahanak.Enabled = False
ElseIf status.Text = "MENIKAH" Then
Jumlahanak.Enabled = True
Tunjanganistri.Text = (0.09 * Val(Gajipokok.Text))
End If
End Sub
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
Totalgaji.Text = Val(Gajipokok.Text) + Val(Tunjangananak.Text) + Val(Tunjanganistri.Text) + Val(Upahlembur.Text) - Val(Pajak.Text)
End Sub
Private Sub NIK_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NIK.SelectedIndexChanged
Select Case NIK.Text
Case "001"
Nama.Text = "Fitri"
Case "002"
Nama.Text = "Handayani"
Case "003"
Nama.Text = "Uci"
Case "004"
Nama.Text = "Dedi"
End Select
End Sub
Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
End
End Sub
Private Sub Jumlahanak_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jumlahanak.TextChanged
If Jumlahanak.Text = "" Then
Tunjangananak.Text = 0
ElseIf Jumlahanak.Text = 1 Then
Tunjangananak.Text = Val(Jumlahanak.Text) * (0.03 * Val(Gajipokok.Text))
ElseIf Jumlahanak.Text = 2 Then
Tunjangananak.Text = 2 * (0.07 * Val(Gajipokok.Text))
ElseIf Jumlahanak.Text >= 2 Then
Tunjangananak.Text = 2 * (0.07 * Val(Gajipokok.Text))
End If
End Sub
Private Sub StatusKerja_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusKerja.SelectedIndexChanged
If Jabatan.Text = "Mandor" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (5000)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (5000)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (5000)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (5000)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (5000)
Else
Upahlembur.Text = 0
End If
ElseIf Jabatan.Text = "Kepala Bagian" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (10000)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (10000)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (10000)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (10000)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (10000)
Else
Upahlembur.Text = 0
End If
ElseIf Jabatan.Text = "Staf" Then
If Jamlembur.Text = "1" Then
Upahlembur.Text = 1 * (7500)
ElseIf Jamlembur.Text = "2" Then
Upahlembur.Text = 2 * (7500)
ElseIf Jamlembur.Text = "3" Then
Upahlembur.Text = 3 * (7500)
ElseIf Jamlembur.Text = "4" Then
Upahlembur.Text = 4 * (7500)
ElseIf Jamlembur.Text = "5" Then
Upahlembur.Text = 5 * (7500)
Else
Upahlembur.Text = 0
End If
End If
If StatusKerja.Text = "Tidak Lembur" Then
Jamlembur.Text = 0
Upahlembur.Text = 0
End If
End Sub
Private Sub Totalgaji_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Totalgaji.TextChanged
End Sub
Private Sub SimpanLV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpanLV.Click
Dim sublv As New ListViewItem
sublv.Text = NIK.Text
sublv.SubItems.Add(Nama.Text)
sublv.SubItems.Add(Jabatan.Text)
sublv.SubItems.Add("RP. " & Gajipokok.Text)
sublv.SubItems.Add(StatusKerja.Text)
sublv.SubItems.Add(Jamlembur.Text)
sublv.SubItems.Add("RP. " & Upahlembur.Text)
sublv.SubItems.Add("RP. " & Pajak.Text)
sublv.SubItems.Add(status.Text)
sublv.SubItems.Add(Jumlahanak.Text)
sublv.SubItems.Add("RP. " & Tunjanganistri.Text)
sublv.SubItems.Add("RP. " & Tunjangananak.Text)
sublv.SubItems.Add("RP. " & Totalgaji.Text)
LV.Items.Add(sublv)
End Sub
Private Sub Jamlembur_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jamlembur.SelectedIndexChanged
If Jabatan.Text = "Mandor" Then
Upahlembur.Text = 7500 * Jamlembur.Text
ElseIf Jabatan.Text = "Kepala Bagian" Then
Upahlembur.Text = 10000 * Jamlembur.Text
ElseIf Jabatan.Text = "Staf" Then
Upahlembur.Text = 5000 * Jamlembur.Text
End If
End Sub
Private Sub BtnHapussatu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapussatu.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
End Class
Hasil FormMenu &Menu Login
Hasil