Salam sejahtera bagi kita semua dan masih di beri kesehatan oleh
allah SWT,
Disini saya akan menshare untuk agan-agan semua tentang membuat program pembayaran air di visual basic 2008 lengkap dengan coding...
lansung aja...
Disini saya akan menshare untuk agan-agan semua tentang membuat program pembayaran air di visual basic 2008 lengkap dengan coding...
lansung aja...
Nah untuk coding bisa lihat di bawah ini:
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
kode.Items.Add("PAB-PAK-100")
kode.Items.Add("PAB-BEL-100")
kode.Items.Add("RUM-BEL-100")
kode.Items.Add("SWA-MED-100")
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
kode.SelectedIndexChanged
Dim x As String
x = Mid(kode.Text, 1, 3)
Select Case x
Case
"TOK"
tipe.Text = "toko"
biaya.Text = 25000
harga.Text = 300
Case
"RUM"
tipe.Text = "rumah"
biaya.Text = 15000
harga.Text = 100
Case
"SWA"
tipe.Text = "swalayan"
biaya.Text = 100000
harga.Text = 200
Case
"PAB"
tipe.Text = "pabrik"
biaya.Text = 750000
harga.Text = 500
End Select
x = Mid(kode.Text, 5, 3)
Select Case x
Case
"MED" : daerah.Text = "medan"
Case
"BEL" : daerah.Text = "Belawan"
Case
"PAK" : daerah.Text = "Patumbak"
End Select
If
kode.Text = "PAB-PAK-100" Then
nama.Text = "abdul"
pemakaian.Text = "1300"
ElseIf
kode.Text = "PAB-BEL-100" Then
nama.Text = "ary"
pemakaian.Text = "1350"
ElseIf
kode.Text = "RUM-BEL-100" Then
nama.Text = "herdin"
pemakaian.Text = "1500"
Else
nama.Text = "ibnu"
pemakaian.Text = "1450"
End If
End Sub
Private Sub Btnproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnproses.Click
total.Text = Val(harga.Text) *
Val(pemakaian.Text) + Val(biaya.Text)
pajak.Text = 0.01 * Val(total.Text)
pembayaran.Text = Val(total.Text) +
Val(pajak.Text)
End Sub
Private Sub Btnhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnhapus.Click
kode.Text = "-"
nama.Text = "-"
tipe.Text = "-"
biaya.Text = "-"
harga.Text = "-"
pemakaian.Text = "-"
total.Text = "-"
pajak.Text = "-"
pembayaran.Text = "-"
daerah.Text = "-"
End Sub
Private Sub Btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btnkeluar.Click
Me.Close()
End Sub
End Class