Friday, June 7, 2013

Quis On Line Harga Photo Copy



Mesran.net

Koding Program

Public Class Form1

    Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProses.Click
        totalharga.Text = jumlahlembar.Text * hargaperlembar.Text

        If totalharga.Text > 500000 Then
            discount.Text = 0.15 * totalharga.Text
        Else
            discount.Text = 0
        End If

        pembayaran.Text = totalharga.Text - discount.Text
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        HAPUS()
        buattabel()
    End Sub

    Sub HAPUS()
        kode.Text = ""
        nama.Text = ""
        hargaperlembar.Text = ""
        jumlahlembar.Text = ""
        totalharga.Text = ""
        discount.Text = ""
        pembayaran.Text = ""
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        HAPUS()
    End Sub

    Sub buattabel()
        LV.View = View.Details
        LV.FullRowSelect = True
        LV.GridLines = True
        LV.Columns.Add("Kode", 100)
        LV.Columns.Add("Nama", 120)
        LV.Columns.Add("Harga/Lembar", 120)
        LV.Columns.Add("Jumlah Lembar", 120)
        LV.Columns.Add("Total Harga", 120)
        LV.Columns.Add("Discount", 120)
        LV.Columns.Add("Pembayaran", 120)
    End Sub

    Sub isitabel()
        Dim fs As New ListViewItem
        With fs
            .Text = kode.Text
            .SubItems.Add(nama.Text)
            .SubItems.Add(hargaperlembar.Text)
            .SubItems.Add(jumlahlembar.Text)
            .SubItems.Add(totalharga.Text)
            .SubItems.Add(discount.Text)
            .SubItems.Add(pembayaran.Text)
        End With
        LV.Items.Add(fs)
    End Sub


    Private Sub BtnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSimpan.Click
        isitabel()
        HAPUS()
    End Sub

    Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnKeluar.Click
        Close()
    End Sub

    Private Sub BtnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHapus.Click
        LV.Items.Remove(LV.SelectedItems(0))
    End Sub

    Private Sub BtnBatal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBatal.Click
        LV.Items.Clear()
    End Sub

    Private Sub jumlahlembar_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlahlembar.KeyPress
        If Asc(e.KeyChar) = 13 Then
            If jumlahlembar.Text >= 200 Then
                hargaperlembar.Text = 90
            Else
                hargaperlembar.Text = 100
            End If
        End If
    End Sub


End Class




No comments:

Post a Comment