ada neh sebuah program tentang tagihan listri dari progarm VB.NET 2008
SEMOGA BERMANFAAT>.........
Public Class Form1
Sub ISITABEL()
Dim Z As New ListViewItem
Z.Text = kode_pelanggan.Text
Z.SubItems.Add(nama.Text)
Z.SubItems.Add(tipe.Text)
Z.SubItems.Add(harga.Text)
Z.SubItems.Add(daerah.Text)
Z.SubItems.Add(biaya_beban.Text)
Z.SubItems.Add(besar_pemakai.Text)
Z.SubItems.Add(total_tagihan.Text)
Z.SubItems.Add(pembayaran.Text)
LV.Items.Add(Z)
End Sub
Sub rancang()
LV.View = View.Details
LV.FullRowSelect = True
LV.GridLines = True
LV.Columns.Add("kode pelanggan", 100)
LV.Columns.Add("nama", 140)
LV.Columns.Add("tipe", 160)
LV.Columns.Add("harga", 110)
LV.Columns.Add("daerah", 100)
LV.Columns.Add("biaya beban", 100)
LV.Columns.Add("besar pemakai", 100)
LV.Columns.Add("total tagihan", 100)
LV.Columns.Add("pembayaran", 100)
End Sub
Sub bersih()
kode_pelanggan.Text = ""
nama.Text = ""
tipe.Text = ""
harga.Text = ""
daerah.Text = ""
biaya_beban.Text = ""
besar_pemakai.Text = ""
total_tagihan.Text = ""
pembayaran.Text = ""
pajak.Text = ""
End Sub
Sub kodepelanggan()
kode_pelanggan.Items.Add("PAB-MED-100")
kode_pelanggan.Items.Add("TOK-BEL-101")
kode_pelanggan.Items.Add("SWA-MAR-102")
kode_pelanggan.Items.Add("RUM-BIN-103")
kode_pelanggan.Items.Add("PAB-PAK-104")
kode_pelanggan.Items.Add("SWA-TEM-105")
End Sub
Sub KODEKONSUMEN()
kode_pelanggan.Items.Add("MT-MJ-010")
kode_pelanggan.Items.Add("WK-MB-011")
kode_pelanggan.Items.Add("JK-MJ-012")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rancang()
kodepelanggan()
End Sub
Private Sub besar_pemakai_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles besar_pemakai.KeyPress
If Asc(e.KeyChar) = 13 Then
total_tagihan.Text = Val(biaya_beban.Text) + (harga.Text * besar_pemakai.Text)
pajak.Text = 0.15 * total_tagihan.Text
pembayaran.Text = Val(biaya_beban.Text) + Val(pajak.Text)
End If
End Sub
Private Sub besar_pemakai_MouseWheel(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles besar_pemakai.MouseWheel
End Sub
Private Sub besar_pemakai_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles besar_pemakai.TextChanged
End Sub
Private Sub kode_pelanggan_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kode_pelanggan.SelectedIndexChanged
Dim x, y, z As String
x = Strings.Right(kode_pelanggan.Text, 3)
Select Case x
Case "100" : nama.Text = "riki sudirman"
Case "101" : nama.Text = "sri ayuni"
Case "102" : nama.Text = "m.shodeq"
Case "103" : nama.Text = "m.rafli"
Case "104" : nama.Text = "maenah"
Case "105" : nama.Text = "yurnah lissarah"
End Select
y = Strings.Left(kode_pelanggan.Text, 3)
Select Case y
Case "TOK"
harga.Text = 500
besar_pemakai.Text = 1500000
tipe.Text = "TOKO"
Case "RUM"
harga.Text = 200
besar_pemakai.Text = 50000
tipe.Text = "RUMAH"
Case "PAB"
harga.Text = 10000
besar_pemakai.Text = 1000000
tipe.Text = "PABRIK"
Case "SWA"
harga.Text = 1500
besar_pemakai.Text = 400000
tipe.Text = "SWALAYAN"
End Select
z = Strings.Mid(kode_pelanggan.Text, 5, 3)
Select Case z
Case "MED"
daerah.Text = "MEDAN"
Case "BEL"
daerah.Text = "BELAWAN"
Case "MAR"
daerah.Text = "MARENDAL"
Case "BIN"
daerah.Text = "BINJAI"
Case "PAK"
daerah.Text = "LUBUK PAKAM"
Case "TEM"
daerah.Text = "AKSARA"
Case Else
daerah.Text = "_"
End Select
End Sub
Private Sub btn_simpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_simpan.Click
ISITABEL()
bersih()
End Sub
Private Sub btn_hapussemua_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_hapussemua.Click
LV.Items.Clear()
bersih()
End Sub
Private Sub btn_hapusdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_hapusdata.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
Me.Close()
End Sub
Private Sub btn_batal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_batal.Click
kode_pelanggan.Text = ""
nama.Text = ""
tipe.Text = ""
harga.Text = ""
besar_pemakai.Text = ""
total_tagihan.Text = ""
pajak.Text = ""
pembayaran.Text = ""
daerah.Text = ""
biaya_beban.Text = ""
End Sub
Private Sub total_tagihan_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles total_tagihan.KeyPress
If Asc(e.KeyChar) = 13 Then
total_tagihan.Text = Val(biaya_beban.Text) + (harga.Text * besar_pemakai)
pajak.Text = 0.15 * total_tagihan.Text
pembayaran.Text = Val(total_tagihan.Text) + Val(pajak.Text)
End If
End Sub
Private Sub total_tagihan_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles total_tagihan.TextChanged
End Sub
End Class
0 komentar:
Posting Komentar