Pages

Minggu, 08 Desember 2013

tugas quiz Online

Tagihan Rekening PDAM

 


Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        BuatTabel()
        kp.Items.Add("PAB-MED-100")
        kp.Items.Add("TOK-BEL-101")
        kp.Items.Add("SWA-MED-102")
        kp.Items.Add("SAL-BEL-103")
        kp.Items.Add("GRO-DEL-104")
    End Sub

    Private Sub jp_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jp.KeyPress
        If Asc(e.KeyChar) = 13 Then
            ttagihan.Text = Val(bbeban.Text) + (harga.Text * jp.Text)
            pajak.Text = 0.01 * ttagihan.Text
            pembayaran.Text = Val(ttagihan.Text) + Val(pajak.Text)
        End If
    End Sub

    Private Sub kp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kp.SelectedIndexChanged
        Dim x As String
        x = Microsoft.VisualBasic.Right(kp.Text, 3)
        Select Case x
            Case "100" : nama.Text = "Febry Anggara"
            Case "101" : nama.Text = "Billie"
            Case "102" : nama.Text = "Tri"
            Case "103" : nama.Text = "Mike"
            Case "104" : nama.Text = "jimmy"
        End Select
        x = Microsoft.VisualBasic.Left(kp.Text, 3)
        Select Case x
            Case "TOK"
                harga.Text = 250
                bbeban.Text = 15000
                tipe.Text = "TOKO"
            Case "RUM"
                harga.Text = 150
                bbeban.Text = 10000
                tipe.Text = "RUMAH"
            Case "PAB"
                harga.Text = 25000
                bbeban.Text = 250000
                tipe.Text = "PABRIK"
            Case "SWA"
                harga.Text = 20000
                bbeban.Text = 60000
                tipe.Text = "SWALAYAN"
            Case "SAL"
                harga.Text = 900
                bbeban.Text = 20000
                tipe.Text = "SALON"
            Case "GRO"
                harga.Text = 100
                bbeban.Text = 1100
                tipe.Text = "GROSIR"
        End Select
        x = Microsoft.VisualBasic.Mid(kp.Text, 5, 3)
        Select Case x
            Case "MED"
                : daerah.Text = "MEDAN"
            Case "BEL"
                : daerah.Text = "BELAWAN"
            Case Else
                : daerah.Text = "DELI SERDANG"
        End Select
    End Sub

    Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
        kp.Text = ""
        nama.Text = ""
        tipe.Text = ""
        harga.Text = ""
        jp.Text = ""
        ttagihan.Text = ""
        pembayaran.Text = ""
        daerah.Text = ""
        bbeban.Text = ""
        pajak.Text = ""

    End Sub

    Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click
        Dim tanya As String
        tanya = MsgBox("Anda Yakin Ingin Keluar ?", MsgBoxStyle.Question + MsgBoxStyle.YesNo)
        If tanya = vbYes Then
            Me.Close()
        Else
            Exit Sub
        End If
    End Sub

    Private Sub LV_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LV.SelectedIndexChanged

    End Sub
    Sub BuatTabel()
        LV.Columns.Add("Kode Pelanggan", 20, HorizontalAlignment.Center)
        LV.Columns.Add("Nama", 180, HorizontalAlignment.Center)
        LV.Columns.Add("Tipe", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Daerah", 80, HorizontalAlignment.Center)
        LV.Columns.Add("Harga M3", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Biaya Beban", 160, HorizontalAlignment.Center)
        LV.Columns.Add("Jumlah Pemakaian", 120, HorizontalAlignment.Center)
        LV.Columns.Add("Pajak", 150, HorizontalAlignment.Center)
        LV.Columns.Add("Total Tagihan", 100, HorizontalAlignment.Center)
        LV.Columns.Add("Pembayaran", 120, HorizontalAlignment.Center)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub
    Sub IsiTabel()
        Dim Lst As New ListViewItem
        Lst.Text = kp.Text
        Lst.SubItems.Add(nama.Text)
        Lst.SubItems.Add(tipe.Text)
        Lst.SubItems.Add(daerah.Text)
        Lst.SubItems.Add(harga.Text)
        Lst.SubItems.Add(bbeban.Text)
        Lst.SubItems.Add(jp.Text)
        Lst.SubItems.Add(pajak.Text)
        Lst.SubItems.Add(ttagihan.Text)
        Lst.SubItems.Add(pembayaran.Text)
        LV.Items.Add(Lst)
    End Sub

    Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click
        IsiTabel()
        nama.Text = ""
        kp.Text = ""
        tipe.Text = ""
        daerah.Text = ""
        harga.Text = ""
        bbeban.Text = ""
        jp.Text = ""
        pajak.Text = ""
        ttagihan.Text = ""
        pembayaran.Text = ""
    End Sub
End Class





0 komentar:

Posting Komentar