Public
Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nik.Items.Add("PM010")
nik.Items.Add("PS111")
nik.Items.Add("KU101")
nik.Items.Add("GD100")
nik.Items.Add("PM011")
jabatan.Items.Add("Kepala Divisi")
jabatan.Items.Add("Staff")
jabatan.Items.Add("Wakil")
Status.Items.Add("Menikah")
Status.Items.Add("Tidak Menikah")
jumlah_anak.Items.Add("1 Anak")
jumlah_anak.Items.Add("2 Anak")
Call pembagian()
Call penamaan()
Call gapok()
End Sub
Sub pembagian()
Dim x As String
x = Microsoft.VisualBasic.Left(nik.Text, 2)
Select Case x
Case "PM"
bagian.Text = "Pemasaran"
Case "PS"
bagian.Text = "Personalia"
Case "KU"
bagian.Text = "Keuangan"
Case "GD"
bagian.Text = "Gudang"
End Select
End Sub
Sub penamaan()
Select Case nik.Text
Case "PM010"
nama.Text = "Doni Sutejo"
Case "PS111"
nama.Text = "Bambang Kodek"
Case "KU101"
nama.Text = "Sutan Mulia"
Case "GD100"
nama.Text = "Muhammad Lego"
Case "PM011"
nama.Text = "Abed Nego"
End Select
End Sub
Sub gapok()
Select Case jabatan.Text
Case "Kepala Divisi"
gaji_pokok.Text = "5000000"
Case "Staff"
gaji_pokok.Text = "2000000"
Case "Wakil"
gaji_pokok.Text = "3500000"
End Select
End Sub
Sub TunjanganAnak()
Select Case jumlah_anak.Text
Case "1 Anak"
tunjangan_anak.Text = 0.05 * gaji_pokok.Text
Case "2 Anak"
tunjangan_anak.Text = 0.1 * gaji_pokok.Text
End Select
Call totalGaji()
End Sub
Sub TunjanganKeluarga()
Select Case Status.Text
Case "Menikah"
tunjangan_keluarga.Text = 0.15 * gaji_pokok.Text
Case "Tidak Menikah"
tunjangan_keluarga.Text = "0"
End Select
End Sub
Sub totalGaji()
total_gaji.Text = "Rp " & Val(gaji_pokok.Text) + Val(tunjangan_keluarga.Text) + Val(tunjangan_anak.Text) - Val(Pajak.Text)
End Sub
Sub hapus()
nik.Text = ""
nama.Text = ""
bagian.Text = ""
jabatan.Text = ""
gaji_pokok.Text = ""
Pajak.Text = ""
Status.Text = ""
jumlah_anak.Text = ""
tunjangan_keluarga.Text = ""
tunjangan_anak.Text = ""
total_gaji.Text = ""
End Sub
Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
Call pembagian()
Call penamaan()
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
Call gapok()
Pajak.Text = gaji_pokok.Text * 0.1
End Sub
Private Sub btnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKeluar.Click
End
End Sub
Private Sub jumlah_anak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumlah_anak.SelectedIndexChanged
Call TunjanganAnak()
End Sub
Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
Call TunjanganKeluarga()
Call totalGaji()
End Sub
Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click
Call hapus()
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
nik.Items.Add("PM010")
nik.Items.Add("PS111")
nik.Items.Add("KU101")
nik.Items.Add("GD100")
nik.Items.Add("PM011")
jabatan.Items.Add("Kepala Divisi")
jabatan.Items.Add("Staff")
jabatan.Items.Add("Wakil")
Status.Items.Add("Menikah")
Status.Items.Add("Tidak Menikah")
jumlah_anak.Items.Add("1 Anak")
jumlah_anak.Items.Add("2 Anak")
Call pembagian()
Call penamaan()
Call gapok()
End Sub
Sub pembagian()
Dim x As String
x = Microsoft.VisualBasic.Left(nik.Text, 2)
Select Case x
Case "PM"
bagian.Text = "Pemasaran"
Case "PS"
bagian.Text = "Personalia"
Case "KU"
bagian.Text = "Keuangan"
Case "GD"
bagian.Text = "Gudang"
End Select
End Sub
Sub penamaan()
Select Case nik.Text
Case "PM010"
nama.Text = "Doni Sutejo"
Case "PS111"
nama.Text = "Bambang Kodek"
Case "KU101"
nama.Text = "Sutan Mulia"
Case "GD100"
nama.Text = "Muhammad Lego"
Case "PM011"
nama.Text = "Abed Nego"
End Select
End Sub
Sub gapok()
Select Case jabatan.Text
Case "Kepala Divisi"
gaji_pokok.Text = "5000000"
Case "Staff"
gaji_pokok.Text = "2000000"
Case "Wakil"
gaji_pokok.Text = "3500000"
End Select
End Sub
Sub TunjanganAnak()
Select Case jumlah_anak.Text
Case "1 Anak"
tunjangan_anak.Text = 0.05 * gaji_pokok.Text
Case "2 Anak"
tunjangan_anak.Text = 0.1 * gaji_pokok.Text
End Select
Call totalGaji()
End Sub
Sub TunjanganKeluarga()
Select Case Status.Text
Case "Menikah"
tunjangan_keluarga.Text = 0.15 * gaji_pokok.Text
Case "Tidak Menikah"
tunjangan_keluarga.Text = "0"
End Select
End Sub
Sub totalGaji()
total_gaji.Text = "Rp " & Val(gaji_pokok.Text) + Val(tunjangan_keluarga.Text) + Val(tunjangan_anak.Text) - Val(Pajak.Text)
End Sub
Sub hapus()
nik.Text = ""
nama.Text = ""
bagian.Text = ""
jabatan.Text = ""
gaji_pokok.Text = ""
Pajak.Text = ""
Status.Text = ""
jumlah_anak.Text = ""
tunjangan_keluarga.Text = ""
tunjangan_anak.Text = ""
total_gaji.Text = ""
End Sub
Private Sub nik_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nik.SelectedIndexChanged
Call pembagian()
Call penamaan()
End Sub
Private Sub jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jabatan.SelectedIndexChanged
Call gapok()
Pajak.Text = gaji_pokok.Text * 0.1
End Sub
Private Sub btnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKeluar.Click
End
End Sub
Private Sub jumlah_anak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles jumlah_anak.SelectedIndexChanged
Call TunjanganAnak()
End Sub
Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
Call TunjanganKeluarga()
Call totalGaji()
End Sub
Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click
Call hapus()
End Sub
End Class
Tidak ada komentar:
Posting Komentar