kasus PDAM :
Public Class Form1
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click
If nama.Text = "Mangasi" And password.Text = "007" Then
PDAM.Show()
Me.Hide()
Else
MsgBox("Username/Password yg anda input salah")
nama.Text = ""
password.Text = ""
End If
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
End
End Sub
End Class
Public Class PDAM
Private Sub TagihanPDAMToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TagihanPDAMToolStripMenuItem.Click
Form3.Show()
End Sub
Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
End
End Sub
End Class
Public Class Form3
Private Sub jumlahpakai_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlahpakai.KeyPress
If Asc(e.KeyChar) = 13 Then
besar.Text = jumlahpakai.Text * harga.Text
total.Text = Val(Beban.Text) + Val(harga.Text) * besar.Text
pajak.Text = total.Text * 0.01
jumlah.Text = Val(total.Text) + Val(pajak.Text)
End If
End Sub
Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
kode.Text = ""
nomor.Text = ""
daerah.Text = ""
tipe.Text = ""
harga.Text = ""
Beban.Text = ""
jumlahpakai.Text = ""
besar.Text = ""
total.Text = ""
pajak.Text = ""
jumlah.Text = ""
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
End
End Sub
Private Sub kode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kode.KeyPress
If Asc(e.KeyChar) = 13 Then
Dim x As String
x = Microsoft.VisualBasic.Left(kode.Text, 3)
If x = "pab" Then
tipe.Text = "pabrik"
harga.Text = "500"
Beban.Text = "250000"
ElseIf x = "tok" Then
tipe.Text = "toko"
harga.Text = "300"
Beban.Text = "25000"
ElseIf x = "rum" Then
tipe.Text = "rumah"
harga.Text = "100"
Beban.Text = "15000"
ElseIf x = "swa" Then
tipe.Text = "swalayan"
harga.Text = "200"
Beban.Text = "10000"
End If
Tidak ada komentar:
Posting Komentar