heloo.....sahabat blogger, kali ini saya ingin memposting hasil dari pembahasan materi mata kuliah kami yang pastinya tentang Program Vb.Net, ini dia programnya..ayo..ayo..silahkan di lihat dan dicoba pastinya....
membuat program untuk biaya total tagihan PDAM
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kodepelanggan.Items.Add("PAB - MED - 100")
kodepelanggan.Items.Add("TOK - BEL - 101")
kodepelanggan.Items.Add("SWA - MED - 102")
End Sub
Private Sub jumlahpemakaian_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlahpemakaian.KeyPress
If Asc(e.KeyChar) = 13 Then
totaltagihan.Text = Val(biayabeban.Text) + (hargaM3.Text * jumlahpemakaian.Text)
pajak.Text = 0.01 * totaltagihan.Text
pembayaran.Text = Val(totaltagihan.Text) + Val(pajak.Text)
End If
End Sub
Private Sub kodepelanggan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kodepelanggan.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Right(kodepelanggan.Text, 3)
Select Case x
Case "100" : nama.Text = "Ayu"
Case "101" : nama.Text = "Riki"
Case "102" : nama.Text = "Shodiq"
End Select
x = Microsoft.VisualBasic.Left(kodepelanggan.Text, 3)
Select Case x
Case "TOK"
hargaM3.Text = 250
biayabeban.Text = 15000
tife.Text = "TOKO"
Case "RUM"
hargaM3.Text = 150
biayabeban.Text = 10000
tife.Text = "RUMAH"
Case "PAB"
hargaM3.Text = 25000
biayabeban.Text = 250000
tife.Text = "PABRIK"
Case "SWA"
hargaM3.Text = 20000
biayabeban.Text = 60000
tife.Text = "SWALAYAN"
End Select
x = Microsoft.VisualBasic.Mid(kodepelanggan.Text, 7, 3)
Select Case x
Case "MED" : daerah.Text = "Medan"
Case "BEL" : daerah.Text = "Belawan"
Case Else : daerah.Text = "_"
End Select
End Sub
Private Sub btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_hapus.Click
kodepelanggan.Text = ""
nama.Text = ""
tife.Text = ""
hargaM3.Text = ""
jumlahpemakaian.Text = ""
totaltagihan.Text = ""
pembayaran.Text = ""
daerah.Text = ""
biayabeban.Text = ""
pajak.Text = ""
End Sub
Private Sub btn_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_keluar.Click
End
End Sub
End Class
nah..ini dia hasil akhirnya....itu program sederhana loh..boleh kok temen - temen mencobanya...thanks..
membuat program untuk biaya total tagihan PDAM
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kodepelanggan.Items.Add("PAB - MED - 100")
kodepelanggan.Items.Add("TOK - BEL - 101")
kodepelanggan.Items.Add("SWA - MED - 102")
End Sub
Private Sub jumlahpemakaian_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlahpemakaian.KeyPress
If Asc(e.KeyChar) = 13 Then
totaltagihan.Text = Val(biayabeban.Text) + (hargaM3.Text * jumlahpemakaian.Text)
pajak.Text = 0.01 * totaltagihan.Text
pembayaran.Text = Val(totaltagihan.Text) + Val(pajak.Text)
End If
End Sub
Private Sub kodepelanggan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kodepelanggan.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Right(kodepelanggan.Text, 3)
Select Case x
Case "100" : nama.Text = "Ayu"
Case "101" : nama.Text = "Riki"
Case "102" : nama.Text = "Shodiq"
End Select
x = Microsoft.VisualBasic.Left(kodepelanggan.Text, 3)
Select Case x
Case "TOK"
hargaM3.Text = 250
biayabeban.Text = 15000
tife.Text = "TOKO"
Case "RUM"
hargaM3.Text = 150
biayabeban.Text = 10000
tife.Text = "RUMAH"
Case "PAB"
hargaM3.Text = 25000
biayabeban.Text = 250000
tife.Text = "PABRIK"
Case "SWA"
hargaM3.Text = 20000
biayabeban.Text = 60000
tife.Text = "SWALAYAN"
End Select
x = Microsoft.VisualBasic.Mid(kodepelanggan.Text, 7, 3)
Select Case x
Case "MED" : daerah.Text = "Medan"
Case "BEL" : daerah.Text = "Belawan"
Case Else : daerah.Text = "_"
End Select
End Sub
Private Sub btn_hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_hapus.Click
kodepelanggan.Text = ""
nama.Text = ""
tife.Text = ""
hargaM3.Text = ""
jumlahpemakaian.Text = ""
totaltagihan.Text = ""
pembayaran.Text = ""
daerah.Text = ""
biayabeban.Text = ""
pajak.Text = ""
End Sub
Private Sub btn_keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_keluar.Click
End
End Sub
End Class
nah..ini dia hasil akhirnya....itu program sederhana loh..boleh kok temen - temen mencobanya...thanks..
Tidak ada komentar:
Posting Komentar