Pages

Rabu, 07 Januari 2009

Pengujian White & Black Box pada form Gaji

Dim hasil As Double
Dim hasila As Double
Dim Rp As Double




Private Sub Command1_Click()
Dim a, b, c, d As Long

a = Text4.Text
b = Text5.Text
c = Text7.Text
d = Text6.Text


If Combo1.Text = "Direktur" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 5000000
Text8.Text = hasil
Label9.Caption = hasil

MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Manajer" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 3500000
Text8.Text = hasil
Label9.Caption = hasil


MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Staff" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 1000000
Text8.Text = hasil
Label9.Caption = hasil

MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Supervisor" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 1500000
Text8.Text = hasil
Label9.Caption = hasil

MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Kepala Gudang" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 500000
Text8.Text = hasil
Label9.Caption = hasil

MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Cleaning Service" Then
hasil = Val(a) + Val(b) + Val(c) - Val(d) + 50000
Text8.Text = hasil
Label9.Caption = hasil


MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
ElseIf Combo1.Text = "Karyawan" Then
hasil = Val(a) + Val(b) + Val(c) + -Val(d) + 1500000
Text8.Text = hasil
Label9.Caption = hasil

MsgBox "Gaji telah dipotong pajak", vbInformation, "Informasi"
End If
End Sub
Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Combo1.AddItem "Direktur"
Combo1.AddItem "Manajer"
Combo1.AddItem "Staff"
Combo1.AddItem "Supervisor"
Combo1.AddItem "Kepala Gudang"
Combo1.AddItem "Cleaning Service"
Combo1.AddItem "Karyawan"
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
hasila = hasil + 300000
Text7.Text = hasila
Label9.Caption = hasila
Else
hasila = hasil

End If
End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
hasila = hasil
Text7.Text = hasila
Label9.Caption = hasila
Else
hasila = hasil

End If
End Sub

Tidak ada komentar: