Sunday, December 7, 2014
Yuk! Belajar Pemrograman Visual Basic dot Net Di Mesran.Net
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PELANGGAN.Items.Add("TOK-MED-100")
PELANGGAN.Items.Add("RUM-BEL-101")
PELANGGAN.Items.Add("SWA-TEM-102")
PELANGGAN.Items.Add("PAB-MAR-103")
PELANGGAN.Items.Add("KAM-BIN-102")
PELANGGAN.Items.Add("SKH-PAK-103")
Call BUATTABEL()
End Sub
Sub BUATTABEL()
LV.Columns.Add("PELANGGAN", 100, HorizontalAlignment.Center)
LV.Columns.Add("NAMA", 110, HorizontalAlignment.Center)
LV.Columns.Add("DAERAH", 100, HorizontalAlignment.Center)
LV.Columns.Add("TIPE", 100, HorizontalAlignment.Center)
LV.Columns.Add("BEBAN", 70, HorizontalAlignment.Center)
LV.Columns.Add("HARGA", 70, HorizontalAlignment.Center)
LV.Columns.Add("METER_BULAN_INI", 130, HorizontalAlignment.Center)
LV.Columns.Add("METER_BULAN_LALU", 130, HorizontalAlignment.Center)
LV.Columns.Add("PEMAKAIAN", 85, HorizontalAlignment.Center)
LV.Columns.Add("TAGIHAN", 80, HorizontalAlignment.Center)
LV.Columns.Add("PAJAK", 70, HorizontalAlignment.Center)
LV.Columns.Add("PEMBAYARAN", 100, HorizontalAlignment.Center)
LV.View = View.Details
LV.GridLines = True
LV.FullRowSelect = True
End Sub
Private Sub PELANGGAN_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PELANGGAN.SelectedIndexChanged
If PELANGGAN.Text = "TOK-MED-100" Then
NAMA.Text = "DIAN WARDANA"
ElseIf PELANGGAN.Text = "RUM-BEL-101" Then
NAMA.Text = "DEDI HERIANTO"
ElseIf PELANGGAN.Text = "SWA-TEM-102" Then
NAMA.Text = "SRI MAHADI"
ElseIf PELANGGAN.Text = "PAB-MAR-103" Then
NAMA.Text = "ALIMIN"
ElseIf PELANGGAN.Text = "KAM-BIN-102" Then
NAMA.Text = "YANDA SYAPUTRA"
ElseIf PELANGGAN.Text = "SKH-PAK-103" Then
NAMA.Text = "BUDI SISWANTO"
End If
Dim x As String
x = Mid(PELANGGAN.Text, 1, 3)
Select Case x
Case "TOK"
TIPE.Text = "TOKO"
BEBAN.Text = 150000
HARGA.Text = 500
Case "RUM"
TIPE.Text = "RUMAH"
BEBAN.Text = 50000
HARGA.Text = 200
Case "SWA"
TIPE.Text = "SWALAYAN"
BEBAN.Text = 400000
HARGA.Text = 1500
Case "PAB"
TIPE.Text = "PABRIK"
BEBAN.Text = 100000
HARGA.Text = 10000
Case "KAM"
TIPE.Text = "KAMPUS"
BEBAN.Text = 95000
HARGA.Text = 8000
Case "SKH"
TIPE.Text = "SEKOLAH"
BEBAN.Text = 75000
HARGA.Text = 7500
End Select
x = Mid(PELANGGAN.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
Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
PEMAKAIAN.Text = METER_BULAN_INI.Text - METER_BULAN_LALU.Text
TAGIHAN.Text = BEBAN.Text + HARGA.Text * PEMAKAIAN.Text
PAJAK.Text = 1.5 * TAGIHAN.Text
PEMBAYARAN.Text = Val(TAGIHAN.Text) + Val(PAJAK.Text)
Dim list As New ListViewItem
list.Text = PELANGGAN.Text
list.SubItems.Add(NAMA.Text)
list.SubItems.Add(DAERAH.Text)
list.SubItems.Add(TIPE.Text)
list.SubItems.Add(BEBAN.Text)
list.SubItems.Add(HARGA.Text)
list.SubItems.Add(METER_BULAN_INI.Text)
list.SubItems.Add(METER_BULAN_LALU.Text)
list.SubItems.Add(PEMAKAIAN.Text)
list.SubItems.Add(TAGIHAN.Text)
list.SubItems.Add(PAJAK.Text)
list.SubItems.Add(PEMBAYARAN.Text)
LV.Items.Add(list)
End Sub
Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
Me.Close()
End Sub
Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
PELANGGAN.Text = ""
NAMA.Text = ""
DAERAH.Text = ""
TIPE.Text = ""
BEBAN.Text = ""
HARGA.Text = ""
METER_BULAN_INI.Text = ""
METER_BULAN_LALU.Text = ""
PEMAKAIAN.Text = ""
TAGIHAN.Text = ""
PAJAK.Text = ""
PEMBAYARAN.Text = ""
End Sub
Private Sub btnbersih_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbersih.Click
LV.Items.Clear()
End Sub
Demikilahlah postingan saya .
Nama :DEDIHERIANTO
NPM :13110510
Selamat Belajar Pemrograman VB NET DI MESRAN.NET
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment