Public Class Form1
Private Sub Form1_Load(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles MyBase.Load
buattabel()
kode.Items.Add("TOK-MED-771")
kode.Items.Add("PAB-BEL-772")
kode.Items.Add("SWA-BEL-773")
kode.Items.Add("PAB-MED-774")
kode.Items.Add("RUM-MED-775")
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handleskode.SelectedIndexChanged
Dim i As String
i = Microsoft.VisualBasic.Right(kode.Text, 3)
If i = "771" Then
nama.Text = "Muhammad Wahyu"
ElseIfi = "772" Then
nama.Text = "Enda Mahdi"
ElseIfi = "773" Then
nama.Text = "Keisya Aprilia"
ElseIfi = "774" Then
nama.Text = "Melani Putri"
End If
i = Microsoft.VisualBasic.Left(kode.Text, 3)
If i = "PAB" Then
hargam3.Text = 500
biayabeban.Text = 250000
tipe.Text = "Pabrik"
ElseIfi = "TOK" Then
hargam3.Text = 500
biayabeban.Text = 25000
tipe.Text = "Toko"
ElseIfi = "RUM" Then
hargam3.Text = 500
biayabeban.Text = 10000
tipe.Text = "Rumah"
ElseIfi = "SWA" Then
hargam3.Text = 200
biayabeban.Text = 15000
tipe.Text = "Swalayan"
End If
i = Microsoft.VisualBasic.Mid(kode.Text, 5, 3)
If i = "MED" Then
daerah.Text = "Medan"
ElseIfi = "BEL" Then
daerah.Text = "Belawan"
End If
End Sub
Private Sub pemakaianair_KeyPress(ByValsender As Object, ByVal e AsSystem.Windows.Forms.KeyPressEventArgs) Handlespemakaianair.KeyPress
IfAsc(e.KeyChar) = 13 Then
total.Text = hargam3.Text * pemakaianair.Text + Val(biayabeban.Text)
pajak.Text = 0.01 * total.Text
pembayaran.Text = Val(total.Text) + Val(pajak.Text)
End If
End Sub
Private Sub btnhapus_Click_1(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnhapus.Click
kode.Text = ""
nama.Text = ""
tipe.Text = ""
total.Text = ""
hargam3.Text = ""
pajak.Text = ""
pembayaran.Text = ""
pemakaianair.Text = ""
daerah.Text = ""
biayabeban.Text = ""
End Sub
Private Sub btnkeluar_Click_1(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnkeluar.Click
Dimtanya As String
tanya = MsgBox("Apakah Anda ingin Keluar?", MsgBoxStyle.YesNo)
Iftanya = vbCancel Then
Me.Close()
ElseIftanya = vbNo Then
Me.Focus()
ElseIftanya = vbYes Then
Me.Close()
End If
End Sub
Subbuattabel()
lv.Columns.Add("Kode Pelanggan", 60, HorizontalAlignment.Center)
lv.Columns.Add("Nama", 60, HorizontalAlignment.Center)
lv.Columns.Add("Tipe", 60, HorizontalAlignment.Center)
lv.Columns.Add("Daerah", 60, HorizontalAlignment.Center)
lv.Columns.Add("Biaya Beban", 60, HorizontalAlignment.Center)
lv.Columns.Add("Harga M3", 60, HorizontalAlignment.Center)
lv.Columns.Add("Pemakaian Air", 60, HorizontalAlignment.Center)
lv.Columns.Add("Pajak", 60, HorizontalAlignment.Center)
lv.Columns.Add("Total Tahihan", 60, HorizontalAlignment.Center)
lv.Columns.Add("Pembayaran", 60, HorizontalAlignment.Center)
lv.GridLines = True
lv.FullRowSelect = True
lv.View = View.Details
End Sub
Subisitabel()
Dim lst As NewListViewItem
lst.Text = kode.Text
lst.SubItems.Add(nama.Text)
lst.SubItems.Add(tipe.Text)
lst.SubItems.Add(daerah.Text)
lst.SubItems.Add(biayabeban.Text)
lst.SubItems.Add(hargam3.Text)
lst.SubItems.Add(pemakaianair.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(total.Text)
lst.SubItems.Add(pembayaran.Text)
lv.Items.Add(lst)
End Sub
Private Sub lv_SelectedIndexChanged(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handleslv.SelectedIndexChanged
End Sub
Private Sub btnproses_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) Handles btnproses.Click
isitabel()
kode.Text = ""
nama.Text = ""
tipe.Text = ""
daerah.Text = ""
biayabeban.Text = ""
hargam3.Text = ""
pemakaianair.Text = ""
pajak.Text = ""
total.Text = ""
pembayaran.Text = ""
End Sub
End Class
Penyelesaian
0 Response to "TAGIHAN AIR MINUM"
Post a Comment