Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Pelanggan.Items.Add("Med")
Pelanggan.Items.Add("Bel")
Pelanggan.Items.Add("Tem")
Pelanggan.Items.Add("Mar")
Pelanggan.Items.Add("Bin")
Pelanggan.Items.Add("Pak")
Tipe.Items.Add("Toko")
Tipe.Items.Add("Rumah")
Tipe.Items.Add("Swalayan")
Tipe.Items.Add("Pabrik")
For i =
1 To 100
jp.Items.Add(i)
Next i
Call
buattabel()
End Sub
Private Sub Pelanggan_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
Pelanggan.SelectedIndexChanged
Select Case Pelanggan.Text
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 = "L.Pakam"
End Select
End Sub
Private Sub Tipe_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Tipe.SelectedIndexChanged
Select Case Tipe.Text
Case
"Toko" : Biaya.Text = "150000"
Case
"Rumah" : Biaya.Text = "50000"
Case
"Swalayan" : Biaya.Text = "400000"
Case
"Pabrik" : Biaya.Text = "1000000"
End Select
Select Case Tipe.Text
Case
"Toko" : KWH.Text = "500"
Case
"Rumah" : KWH.Text = "200"
Case
"Swalayan" : KWH.Text = "1500"
Case
"Pabrik" : KWH.Text = "10000"
End Select
pajak.Text = 0.015 * Biaya.Text
End Sub
Private Sub
Label3_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Label3.Click
End Sub
Private Sub Biaya_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Biaya.TextChanged
End Sub
Private Sub btnproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnproses.Click
If
Tipe.Text = "Toko" Then
Total.Text = 500
ElseIf
Tipe.Text = "rumah" Then
Total.Text = 200
ElseIf
Tipe.Text = "swalayan" Then
Total.Text = 1500
ElseIf
Tipe.Text = "pabrik" Then
Total.Text = 10000
Else
Total.Text = 0
End If
Total.Text = Val(Total.Text * jp.Text)
+ Val(Biaya.Text) + Val(KWH.Text) - Val(pajak.Text)
End Sub
Private Sub ListView1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles
lv.SelectedIndexChanged
End Sub
Sub
buattabel()
lv.Columns.Add("pelanggan",
100, HorizontalAlignment.Center)
lv.Columns.Add("daerah",
100, HorizontalAlignment.Left)
lv.Columns.Add("tipe",
100, HorizontalAlignment.Left)
lv.Columns.Add("biaya",
100, HorizontalAlignment.Left)
lv.Columns.Add("KWH",
100, HorizontalAlignment.Left)
lv.Columns.Add("JP",
100, HorizontalAlignment.Center)
lv.Columns.Add("TOTAL",
80, HorizontalAlignment.Center)
lv.Columns.Add("pajak",
80, HorizontalAlignment.Center)
lv.View = View.Details
lv.GridLines = True
lv.FullRowSelect = True
End Sub
Sub
isitabel()
Dim lst
As New
ListViewItem
lst.Text = Pelanggan.Text
lst.SubItems.Add(daerah.Text)
lst.SubItems.Add(Tipe.Text)
lst.SubItems.Add(Biaya.Text)
lst.SubItems.Add(KWH.Text)
lst.SubItems.Add(jp.Text)
lst.SubItems.Add(Total.Text)
lst.SubItems.Add(pajak.Text)
lv.Items.Add(lst)
End Sub
Private Sub
btnsimpan_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
btnsimpan.Click
isitabel()
Pelanggan.Text = ""
Total.Text = ""
Tipe.Text = ""
Biaya.Text = ""
KWH.Text = ""
jp.Text = ""
Total.Text = ""
pajak.Text = ""
End Sub
Private Sub btnkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles btnkeluar.Click
End
End Sub
End Class
lalu simpan kelistview
0 komentar:
Posting Komentar