Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Kopel.Items.Add("TOK-MED-100")
Kopel.Items.Add("TOK-BEL-101")
Kopel.Items.Add("TOK-TEM-102")
Kopel.Items.Add("TOK-MAR-103")
Kopel.Items.Add("TOK-BIN-104")
Kopel.Items.Add("TOK-PAK-105")
Kopel.Items.Add("RUM-MED-111")
Kopel.Items.Add("RUM-BEL-112")
Kopel.Items.Add("RUM-TEM-113")
Kopel.Items.Add("RUM-MAR-114")
Kopel.Items.Add("RUM-BIN-115")
Kopel.Items.Add("RUM-PAK-116")
Kopel.Items.Add("SWA-MED-120")
Kopel.Items.Add("SWA-BEL-121")
Kopel.Items.Add("SWA-TEM-122")
Kopel.Items.Add("SWA-MAR-123")
Kopel.Items.Add("SWA-BIN-124")
Kopel.Items.Add("SWA-PAK-125")
Kopel.Items.Add("PAB-MED-131")
Kopel.Items.Add("PAB-BEL-132")
Kopel.Items.Add("PAB-TEM-133")
Kopel.Items.Add("PAB-MAR-134")
Kopel.Items.Add("PAB-BIN-135")
Kopel.Items.Add("PAB-PAK-136")
buattabel()
End Sub
Sub
buattabel()
LV.Columns.Add("Kode
Pelanggan", 80, HorizontalAlignment.Center)
LV.Columns.Add("Tipe
Pelanggan", 80, HorizontalAlignment.Left)
LV.Columns.Add("Daerah",
80, HorizontalAlignment.Left)
LV.Columns.Add("No
Urut", 80, HorizontalAlignment.Left)
LV.Columns.Add("Biaya
Beban", 80, HorizontalAlignment.Left)
LV.Columns.Add("Harga
per Kwh", 80, HorizontalAlignment.Left)
LV.Columns.Add("Jumlah
Pemakai", 80, HorizontalAlignment.Left)
LV.Columns.Add("Total
Tagihan", 80, HorizontalAlignment.Left)
LV.Columns.Add("Pajak",
80, HorizontalAlignment.Left)
LV.Columns.Add("Total
Pembayaran", 80, HorizontalAlignment.Left)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Sub
isitabel()
Dim lst
As New
ListViewItem
lst.Text = kopel.Text
lst.SubItems.Add(Tipel.Text)
lst.SubItems.Add(Dapel.Text)
lst.SubItems.Add(nomor.Text)
lst.SubItems.Add(B_Beban.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(J_Pemakai.Text)
lst.SubItems.Add(T_Tagihan.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(T_Pembayaran.Text)
LV.Items.Add(lst)
End Sub
Private Sub Kopel_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
Kopel.SelectedIndexChanged
Dim y As String
y =
Microsoft.VisualBasic.Left(Kopel.Text, 3)
Select Case y
Case
"TOK" : Tipel.Text = "TOKO"
Case
"RUM" : Tipel.Text = "RUMAH"
Case
"SWA" : Tipel.Text = "SWALAYAN"
Case
"PAB" : Tipel.Text = "PABRIK"
End Select
Dim X As String
X =
Microsoft.VisualBasic.Mid(Kopel.Text, 3)
Select Case X
Case
"MED" : Dapel.Text = "MEDAN"
Case
"BEL" : Dapel.Text = "BELAWAN"
Case
"TEM" : Dapel.Text = "AKSARA"
Case
"MAR" : Dapel.Text = "MARENDAL"
Case
"BIN" : Dapel.Text = "BINJAI"
Case
"PAK" : Dapel.Text = "LUBUK PAKAM"
End Select
Dim Z As String
Z =
Microsoft.VisualBasic.Right(Kopel.Text, 3)
Select Case Z
Case
"100" : nomor.Text = "100"
Case
"101" : nomor.Text = "101"
Case
"102" : nomor.Text = "102"
Case
"103" : nomor.Text = "103"
Case
"104" : nomor.Text = "104"
Case
"105" : nomor.Text = "105"
Case
"111" : nomor.Text = "111"
Case
"112" : nomor.Text = "112"
Case
"113" : nomor.Text = "113"
Case
"114" : nomor.Text = "114"
Case
"115" : nomor.Text = "115"
Case
"116" : nomor.Text = "116"
Case
"120" : nomor.Text = "120"
Case
"121" : nomor.Text = "121"
Case
"122" : nomor.Text = "122"
Case "123" : nomor.Text = "123"
Case
"124" : nomor.Text = "124"
Case
"125" : nomor.Text = "125"
Case
"131" : nomor.Text = "131"
Case
"132" : nomor.Text = "132"
Case
"133" : nomor.Text = "133"
Case
"134" : nomor.Text = "134"
Case
"135" : nomor.Text = "135"
Case
"136" : nomor.Text = "136"
End Select
If
Tipel.Text = "TOKO" Then
B_Beban.Text = 150000
harga.Text = 500
ElseIf
Tipel.Text = "RUMAH" Then
B_Beban.Text = 50000
harga.Text = 200
ElseIf
Tipel.Text = "SWALAYAN" Then
B_Beban.Text = 400000
harga.Text = 1500
Else
B_Beban.Text = 1000000
harga.Text = 10000
End If
End Sub
Private Sub T_Tagihan_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles T_Tagihan.TextChanged
Pajak.Text = 0.015 * T_Tagihan.Text
End Sub
Private Sub J_Pemakai_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles J_Pemakai.TextChanged
T_Tagihan.Text = (Val(B_Beban.Text) +
Val(harga.Text)) * J_Pemakai.Text
End Sub
Private Sub Btn_Simpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btn_Simpan.Click
isitabel()
End Sub
Private Sub Btn_Hapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btn_Hapus.Click
LV.Items.Clear()
End Sub
Private Sub Btn_Bersih_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btn_Bersih.Click
Kopel.Text = ""
Tipel.Text = ""
Dapel.Text = ""
nomor.Text = ""
B_Beban.Text = ""
harga.Text = ""
J_Pemakai.Text = ""
T_Tagihan.Text = ""
Pajak.Text = ""
T_Pembayaran.Text = ""
End Sub
Private Sub Btn_hapusdatapilih_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
Btn_hapusdatapilih.Click
LV.Items.Remove(LV.SelectedItems(0))
End Sub
Private Sub Btn_Keluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btn_Keluar.Click
End
End Sub
Private Sub Btn_Proses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Btn_Proses.Click
T_Pembayaran.Text = Val(T_Tagihan.Text)
+ Val(Pajak.Text)
End Sub
End Class
tabel itu di toolbox pilih apa yaaaa?
BalasHapus