Postingan berikut ini Saya Hanya akan Memberikan Koding Pemograman Menghitung Tagihan PDAM, semoga bermanfaat bagi temen-temen semua...
Silahkan di sikat codingnya gan:
Silahkan di sikat codingnya gan:
Form Load
Dim x As Byte
Sub buattable()
LV.Columns.Add("No", 50, HorizontalAlignment.Left)
LV.Columns.Add("Kode", 90, HorizontalAlignment.Left)
LV.Columns.Add("Tipe", 110, HorizontalAlignment.Left)
LV.Columns.Add("Harga", 110, HorizontalAlignment.Left)
LV.Columns.Add("Jmlah Pemakaian", 110, HorizontalAlignment.Left)
LV.Columns.Add("Daerah", 110, HorizontalAlignment.Left)
LV.Columns.Add("Biaya Beban", 180, HorizontalAlignment.Left)
LV.Columns.Add("Pajak", 100, HorizontalAlignment.Left)
LV.Columns.Add("Pembayaran", 100, HorizontalAlignment.Left)
LV.Columns.Add("Total Tagihan", 100, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End SubLV.Columns.Add("Kode", 90, HorizontalAlignment.Left)
LV.Columns.Add("Tipe", 110, HorizontalAlignment.Left)
LV.Columns.Add("Harga", 110, HorizontalAlignment.Left)
LV.Columns.Add("Jmlah Pemakaian", 110, HorizontalAlignment.Left)
LV.Columns.Add("Daerah", 110, HorizontalAlignment.Left)
LV.Columns.Add("Biaya Beban", 180, HorizontalAlignment.Left)
LV.Columns.Add("Pajak", 100, HorizontalAlignment.Left)
LV.Columns.Add("Pembayaran", 100, HorizontalAlignment.Left)
LV.Columns.Add("Total Tagihan", 100, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
Sub isitable()
Dim lst As New ListViewItem
lst.Text = x
lst.SubItems.Add(kd_pelanggan.Text)
lst.SubItems.Add(tipe.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(JmlhPemakaian.Text)
lst.SubItems.Add(daerah.Text)
lst.SubItems.Add(BiayaBeban.Text)
lst.SubItems.Add(Pajak.Text)
lst.SubItems.Add(Pembayaran.Text)
lst.SubItems.Add(TotalTagihan.Text)
LV.Items.Add(lst)
x = 1 + x
Private Sub TagihanPDAM
buattable()
x = 1
kd_pelanggan.Items.Add("PAB-MED-100")
kd_pelanggan.Items.Add("RUM-MED-101")
kd_pelanggan.Items.Add("TOK-BEL-102")
kd_pelanggan.Items.Add("SWA-MED-103")
Private Sub kodePelanggan
Dim x As String
x = Microsoft.VisualBasic.Right(kd_pelanggan.Text, 3)
Select Case x
Case "1501" : nama.Text = "Barong"
Case "1502" : nama.Text = "Jono"
Case "1503" : nama.Text = "Selo"
Case "1504" : nama.Text = "Seno"
End Select
x = Microsoft.VisualBasic.Left(kd_pelanggan.Text, 3)
Select Case x
Case "TOK"
harga.Text = 250
biaya_beban.Text = 15000
tipe.Text = "TOKO"
Case "RUM"
harga.Text = 150
biaya_beban.Text = 10000
tipe.Text = "RUMAN"
Case "PAB"
harga.Text = 25000
biaya_beban.Text = 25000
tipe.Text = "PABRIK"
Case "SWA"
harga.Text = 20000
biaya_beban.Text = 60000
tipe.Text = "SWALAYAN"
End Select
x = Microsoft.VisualBasic.Mid(kd_pelanggan.Text, 5, 3)
Select Case x
Case "MED" : daerah.Text = "Medan"
Case "DELTU" : daerah.Text = "DELITUA"
Case Else : daerah.Text = "-"
End Select
Private Sub JmlhPemakaian _KeyPress
If jml_pemakaian.Text = "" Then
jml_pemakaian.Focus()
ElseIf Asc(e.KeyChar) = 13 Then
total_tagihan.Text = Val(biaya_beban.Text) + (harga.Text * jml_pemakaian.Text)
pajak.Text = 0.01 * total_tagihan.Text
pembayaran.Text = Val(total_tagihan.Text) + Val(pajak.Text)
End If
Private Sub BtnHapus
kd_pelanggan.Text = ""
nama.Text = ""
tipe.Text = ""
harga.Text = ""
jml_pemakaian.Text = ""
total_tagihan.Text = ""
pembayaran.Text = ""
daerah.Text = ""
biaya_beban.Text = ""
pajak.Text = ""
kd_pelanggan.Text = ""
nama.Text = ""
tipe.Text = ""
harga.Text = ""
jml_pemakaian.Text = ""
total_tagihan.Text = ""
pembayaran.Text = ""
daerah.Text = ""
biaya_beban.Text = ""
pajak.Text = ""
Private Sub BtnKeluar
Dim k As String
k = MsgBox("Apakah Anda yakin Ingin Keluar", MsgBoxStyle.YesNo)
If k = vbYes Then
Me.Close()
End If
Sekian dan Terimakasih semoga hari-hari kalian semua Bahagia, Amin... :v
By:
Nama : Josua Alfiandi S
Npm : 14110923
Kelas : Ti-S1412
0 komentar:
Speak up your mind
Tell us what you're thinking... !