Public Class Form1
Private Sub kode_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles kode.TextChanged
Dim x As String
x =
Microsoft.VisualBasic.Right(kode.Text, 3)
If x = "TOK" Then
BiayaBeban.Text = "150000"
harga.Text = "1000"
ElseIf
x = "RUM" Then
BiayaBeban.Text = "50000"
harga.Text = "800"
ElseIf
x = "SWA" Then
BiayaBeban.Text = "400000"
harga.Text = "1500"
ElseIf
x = "PAB" Then
BiayaBeban.Text = "1000000"
harga.Text = "10000"
End If
x =
Microsoft.VisualBasic.Mid(kode.Text, 4, 3)
If x = "MED" Then
Daerah.Text = "Medan"
ElseIf
x = "BEL" Then
Daerah.Text = "Belawan"
ElseIf
x = "TEM" Then
Daerah.Text = "Aksara"
ElseIf
x = "MAR" Then
Daerah.Text = "Merendal"
ElseIf
x = "BIN" Then
Daerah.Text = "Binjai"
ElseIf
x = "PAK" Then
Daerah.Text = "Lubuk Pakam"
End If
nUrut.Text =
Microsoft.VisualBasic.Right(kode.Text, 3)
End Sub
Private Sub Bproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Bproses.Click
BesarP.Text = (BulanIni.Text -
BulanLalu.Text)
Total.Text = BiayaBeban.Text +
harga.Text * BesarP.Text
pajak.Text = (1.5 / 100) * Total.Text
Pembayaran.Text = Total.Text +
pajak.Text
End Sub
Private Sub Bbersih_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Bbersih.Click
kode.Text = ""
nUrut.Text = ""
Daerah.Text = ""
harga.Text = ""
BiayaBeban.Text = ""
harga.Text = ""
BulanIni.Text = ""
BulanLalu.Text = ""
BesarP.Text = ""
Total.Text = ""
pajak.Text = ""
Pembayaran.Text = ""
End Sub
Private Sub Bkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Bkeluar.Click
End
End Sub
Private Sub Bsimpan_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Bsimpan.Click
isitabel()
kode.Text = ""
nUrut.Text = ""
Daerah.Text = ""
BiayaBeban.Text = ""
harga.Text = ""
BulanIni.Text = ""
BulanLalu.Text = ""
BesarP.Text = ""
Total.Text = ""
pajak.Text = ""
Pembayaran.Text = ""
End Sub
Sub isitabel()
Dim lst
As New
ListViewItem
lst.Text = kode.Text
lst.SubItems.Add(nUrut.Text)
lst.SubItems.Add(Daerah.Text)
lst.SubItems.Add(BiayaBeban.Text)
lst.SubItems.Add(harga.Text)
lst.SubItems.Add(BulanIni.Text)
lst.SubItems.Add(BulanLalu.Text)
lst.SubItems.Add(BesarP.Text)
lst.SubItems.Add(Total.Text)
lst.SubItems.Add(pajak.Text)
lst.SubItems.Add(Pembayaran.Text)
ListV.Items.Add(lst)
End Sub
Sub buattabel()
ListV.Columns.Add("kode", 80, HorizontalAlignment.Center)
ListV.Columns.Add("no.Urut", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("Daerah", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("Biaya Beban", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("Harga perKWH", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("meter bulan ini", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("meter bulan lalu", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("besar pemakaian", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("totaltagihan", 80,
HorizontalAlignment.Center)
ListV.Columns.Add("pajak", 80, HorizontalAlignment.Center)
ListV.Columns.Add("pembayaran", 80,
HorizontalAlignment.Center)
ListV.View = View.Details
ListV.GridLines = True
ListV.FullRowSelect = True
End Sub
Private Sub BHapusSemua_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles BHapusSemua.Click
ListV.Items.Clear()
End Sub
Private Sub Bhapus_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Bhapus.Click
If
ListV.SelectedItems.Count <> 0 Then
ListV.Items.Remove(ListV.SelectedItems(0))
Else
MsgBox("pilih
data yang akan dihapus")
End If
End Sub
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
buattabel()
End Sub
End Class
Public Class Form1
Private Sub Form1_Load(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
gol.items.add("IIIA")
gol.Items.Add("IIIB")
gol.Items.Add("IIIC")
End Sub
Private Sub gol_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
gol.SelectedIndexChanged
Select Case gol.Text
Case
"IIIA" : gaji.Text = 1500000
Case
"IIIB" : gaji.Text = 2500000
Case
"IIIC" : gaji.Text = 3500000
End Select
pajak.Text = 0.15 * gaji.Text
End Sub
Private Sub Nproses_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Nproses.Click
gajiBersih.Text = Val(gaji.Text) -
Val(pinjaman.Text) - Val(gajiBersih.Text)
End Sub
Private Sub Nkeluar_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles Nkeluar.Click
Close()
End Sub
End Class
Tidak ada komentar:
Posting Komentar