Tampilan awal form pembayaran listrik
Tampilan setelah di proses dan di simpan kelistview
Public Class Form1
Sub buattabel()
lv.Columns.Add("Kode Pelanggan", 80, HorizontalAlignment.Center)
lv.Columns.Add("Daerah", 80, HorizontalAlignment.Center)
lv.Columns.Add("Nama", 80, HorizontalAlignment.Center)
lv.Columns.Add("No Urut", 80, HorizontalAlignment.Center)
lv.Columns.Add("Pemakaian", 80, HorizontalAlignment.Center)
lv.Columns.Add("Total Biaya", 80, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub isitabel()
Dim x As New ListViewItem
x.Text = daerah.Text
x.SubItems.Add(pelanggan.Text)
x.SubItems.Add(daerah.Text)
x.SubItems.Add(nourut.Text)
x.SubItems.Add(nama.Text)
x.SubItems.Add(pemakaian.Text)
x.SubItems.Add(total.Text)
lv.Items.Add(x)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kode.Items.Add("001")
kode.Items.Add("002")
kode.Items.Add("003")
kode.Items.Add("004")
pelanggan.Items.Add("TOK")
pelanggan.Items.Add("RUM")
pelanggan.Items.Add("SWA")
pelanggan.Items.Add("PAB")
nourut.Items.Add("100")
nourut.Items.Add("200")
nourut.Items.Add("300")
nourut.Items.Add("400")
buattabel()
End Sub
Private Sub Daerah_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Daerah.TextChanged
End Sub
Private Sub btnsimpankelistview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsimpankelistview.Click
isitabel()
pelanggan.Text = ""
Daerah.Text = ""
nourut.Text = ""
nama.Text = ""
pemakaian.Text = ""
total.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
End
End Sub
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
total.Text = pemakaian.Text * 1.5
End Sub
Private Sub nourut_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nourut.SelectedIndexChanged
Select Case nourut.Text
Case "100" : nama.Text = "suheri"
Case "200" : nama.Text = "aliman"
Case "300" : nama.Text = "muliadi"
Case "400" : nama.Text = "waito"
End Select
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
Select Case kode.Text
Case "001" : Daerah.Text = "Binjai"
Case "002" : Daerah.Text = "Belawan"
Case "003" : Daerah.Text = "Stabat"
Case "004" : Daerah.Text = "Polonia"
End Select
End Sub
Private Sub pelanggan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pelanggan.SelectedIndexChanged
Select Case pelanggan.Text
Case "TOK" : pemakaian.Text = 150000 + 500
Case "RUM" : pemakaian.Text = 5000 + 200
Case "SWA" : pemakaian.Text = 400000 + 2000
Case "PAB" : pemakaian.Text = 1000000 + 10000
End Select
End Sub
End Class
Tidak ada komentar:
Posting Komentar