desain form berikut ini :
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("Staf")
Jabatan.Items.Add("Wakil Kepala")
Status.Items.Add("Menikah")
Status.Items.Add("Tidak Menikah")
Dim i As Integer
For i = 1 To 2
JumlahAnak.Items.Add(i)
Next i
End Sub
Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
NIK.Text = ""
Nama.text = ""
Bagian.text = ""
Jabatan.Text = ""
GajiPokok.Text = ""
Pajak.Text = ""
Status.Text = ""
JumlahAnak.Text = ""
TunjanganKeluarga.Text = ""
TunjanganAnak.Text = ""
TotalGaji.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 "PM010"
Nama.Text = "naldi"
Case "PS111"
Nama.Text = "kholil"
Case "KU101"
Nama.Text = "indra"
Case "GD100"
Nama.Text = "buyung"
Case "PM011"
Nama.Text = "rinaldi jambak"
End Select
Dim x As String
x = Microsoft.VisualBasic.Left(NIK.Text, 2)
If x = "PM" Then
Bagian.Text = "Pemasaran"
ElseIf x = "PS" Then
Bagian.Text = "Personalia"
ElseIf x = "KU" Then
Bagian.Text = "Keuangan"
ElseIf x = "GD" Then
Bagian.Text = "Gudang"
End If
End Sub
Private Sub Status_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Status.SelectedIndexChanged
Select Case Status.Text
Case "Menikah"
TunjanganKeluarga.Text = 0.15 * GajiPokok.Text
Case "Tidak Menikah"
TunjanganKeluarga.Text = 0
End Select
End Sub
Private Sub Bagian_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bagian.TextChanged
End Sub
Private Sub Jabatan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Jabatan.SelectedIndexChanged
Select Jabatan.Text
Case "Kepala Divisi"
GajiPokok.Text = 5000000
Case "Staf"
GajiPokok.Text = 2000000
Case "Wakil Kepala"
GajiPokok.Text = 3500000
End Select
Pajak.Text = 0.1 * GajiPokok.Text
End Sub
Private Sub JumlahAnak_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JumlahAnak.SelectedIndexChanged
If JumlahAnak.Text = 1 Then
TunjanganAnak.Text = 0.5 * GajiPokok.Text
ElseIf JumlahAnak.Text = 2 Then
TunjanganAnak.Text = 0.1 * GajiPokok.Text
End If
TotalGaji.Text = Val(GajiPokok.Text) + Val(TunjanganKeluarga.Text) + Val(TunjanganAnak.Text) - Val(Pajak.Text)
End Sub
Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click
End
End Sub
End Class
Tidak ada komentar:
Posting Komentar