Program Pembayaran Tagihan Rekening Listrik
Sunday, December 8, 2013
1
comments
Public Class Form_Pembayaran_Rekening_Listrik
Private Sub Form_Pembayaran_Rekening_Listrik_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
kode.Items.Add("TOK-MED-001")
kode.Items.Add("RUM-BEL-002")
kode.Items.Add("SWA-TEM-003")
kode.Items.Add("PAB-MAR-004")
kode.Items.Add("TOK-BIN-005")
kode.Items.Add("TOK-PAK-006")
Rancangan_Table()
Biaya_Beban.ReadOnly = True
HargaperKwh.ReadOnly = True
Total_Tagihan.ReadOnly = True
besar_Pemakaian.ReadOnly = True
Pajak.ReadOnly = True
pEMBAYARAN.ReadOnly = True
End Sub
Private Sub kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode.SelectedIndexChanged
Dim x As String
x = Microsoft.VisualBasic.Right(kode.Text, 3)
Select Case x
Case "001"
nama.Text = "ERIXON A S"
no.Text = x
Case "002"
nama.Text = "RINALDI PRATAMA"
no.Text = x
Case "003"
nama.Text = "ABDUL RAHMAD"
no.Text = x
Case "004"
nama.Text = "SUHENDRIK"
no.Text = x
Case "005"
nama.Text = "ROHIMAN"
no.Text = x
Case "006"
nama.Text = "ARIFIN S P"
no.Text = x
End Select
x = Microsoft.VisualBasic.Left(kode.Text, 3)
Select Case x
Case "PAB"
HargaperKwh.Text = 10000
Biaya_Beban.Text = 1000000
tipe.Text = "PABRIK"
Case "RUM"
HargaperKwh.Text = 200
Biaya_Beban.Text = 50000
tipe.Text = "RUMAH"
Case "SWA"
HargaperKwh.Text = 1500
Biaya_Beban.Text = 400000
tipe.Text = "SWALAYAN"
Case "TOK"
HargaperKwh.Text = 500
Biaya_Beban.Text = 150000
tipe.Text = "TOKO"
End Select
x = Microsoft.VisualBasic.Mid(kode.Text, 5, 3)
Select Case x
Case "MED" : daerah.Text = "MEDAN"
Case "BEL" : daerah.Text = "BELAWAN"
Case "TEM" : daerah.Text = "AKSARA"
Case "MAR" : daerah.Text = "MARENDAL"
Case "BIN" : daerah.Text = "BINJAI"
Case "PAK" : daerah.Text = "LUBUK PAKAM"
End Select
End Sub
Sub Rancangan_Table()
With lv
.Columns.Add("Kode Pelanggan", 100, HorizontalAlignment.Center)
.Columns.Add("Nama Pelanggan", 100, HorizontalAlignment.Left)
.Columns.Add("No Urut", 100, HorizontalAlignment.Left)
.Columns.Add("Tipe", 100, HorizontalAlignment.Left)
.Columns.Add("Daerah", 100, HorizontalAlignment.Left)
.Columns.Add("Meter Bulan Lalu", 100, HorizontalAlignment.Left)
.Columns.Add("Meter Bulan Ini", 100, HorizontalAlignment.Left)
.Columns.Add("Besar Pemakaian", 100, HorizontalAlignment.Left)
.Columns.Add("Biaya Beban", 100, HorizontalAlignment.Left)
.Columns.Add("Harga Per KWH", 100, HorizontalAlignment.Left)
.Columns.Add("Total Tagihan", 100, HorizontalAlignment.Left)
.Columns.Add("Pajak", 100, HorizontalAlignment.Left)
.Columns.Add("Pembayaran", 100, HorizontalAlignment.Left)
.GridLines = True
.FullRowSelect = True
.View = View.Details
End With
End Sub
Sub isi_table()
Dim lst As New ListViewItem
With lst
.Text = kode.Text
.SubItems.Add(nama.Text)
.SubItems.Add(no.Text)
.SubItems.Add(tipe.Text)
.SubItems.Add(daerah.Text)
.SubItems.Add(mbl.Text)
.SubItems.Add(mbi.Text)
.SubItems.Add(besar_Pemakaian.Text)
.SubItems.Add(Biaya_Beban.Text)
.SubItems.Add(HargaperKwh.Text)
.SubItems.Add(Total_Tagihan.Text)
.SubItems.Add(Pajak.Text)
.SubItems.Add(pEMBAYARAN.Text)
lv.Items.Add(lst)
End With
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
isi_table()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
bersih(Me)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
lv.Items.Remove(lv.SelectedItems(0))
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
End
End Sub
Sub bersih()
kode.Text = ""
nama.Text = ""
no.Text = ""
tipe.Text = ""
daerah.Text = ""
mbi.Text = ""
mbl.Text = ""
Biaya_Beban.Text = ""
besar_Pemakaian.Text = ""
Biaya_Beban.Text = ""
HargaperKwh.Text = ""
Total_Tagihan.Text = ""
Pajak.Text = ""
pEMBAYARAN.Text = ""
End Sub
Private Sub mbi_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles mbi.KeyPress
If Asc(e.KeyChar) = 13 Then
besar_Pemakaian.Text = Val(mbi.Text) - Val(mbl.Text)
Total_Tagihan.Text = Val(Biaya_Beban.Text) + Val(HargaperKwh.Text) * besar_Pemakaian.Text
Pajak.Text = 1.5 * Total_Tagihan.Text
pEMBAYARAN.Text = Val(Total_Tagihan.Text) + Val(Pajak.Text)
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
lv.Items.Clear()
End Sub
End Class