penjualan TV menggunakan VB.net

Assalamu'alaikum,wr.wb
penjualan Tv dengan menggunakan VB.net
ne saya kembali lagi dengan mempostingkan program penjualan tv dengan menggunakan vb.net 2008....:). biasanya orang menyimpan data penjualan mereka dengan sistem berkas atau buku...ne saya berbagi tentang bagaimana penyimpanan berkas konsumen yang membeli Tv kepada kita...

tuk libih pahamnya anda coba saja listing program dibawah ini:

 ne dibawah merupakan listing programnya penjualan TV menggunakan VB.net

Public Class penjualan_TV

    Sub buattabel()
        LV.Columns.Add("Nama Pembeli", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Jenis Tv", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Inci", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Harga", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Jumlah", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Harga Jual", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Diskon", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Pajak", 80, HorizontalAlignment.Left)
        LV.Columns.Add("Jumlah Bayar", 80, HorizontalAlignment.Left)
        LV.View = View.Details
        LV.GridLines = True
        LV.FullRowSelect = True
    End Sub
    Sub isitabel()
        Dim lst As New ListViewItem

        lst.Text = namapembeli.Text
        lst.SubItems.Add(jenistv.Text)
        lst.SubItems.Add(inci.Text)
        lst.SubItems.Add(harga.Text)
        lst.SubItems.Add(jumlah.Text)
        lst.SubItems.Add(hargajual.Text)
        lst.SubItems.Add(diskon.Text)
        lst.SubItems.Add(pajak.Text)
        lst.SubItems.Add(jmlhbayar.Text)
        LV.Items.Add(lst)
    End Sub


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

        kdpembeli.Items.Add("KD001")
        kdpembeli.Items.Add("KD002")
        kdpembeli.Items.Add("KD003")
        kdpembeli.Items.Add("KD004")

        jenistv.Items.Add("Sony")
        jenistv.Items.Add("Panasonic")
        jenistv.Items.Add("Samsung")
        jenistv.Items.Add("LG")

        inci.Items.Add("14""")
        inci.Items.Add("17""")
        inci.Items.Add("21""")
        inci.Items.Add("29""")
    End Sub

    Private Sub kdpembeli_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kdpembeli.SelectedIndexChanged
        If kdpembeli.Text = "KD001" Then
            namapembeli.Text = "M SHODIQ"
        ElseIf kdpembeli.Text = "KD002" Then
            namapembeli.Text = "SULIS"
        ElseIf kdpembeli.Text = "KD003" Then
            namapembeli.Text = "DAYAT"
        Else
            namapembeli.Text = "DAUS"
        End If
    End Sub

    Private Sub inci_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles inci.SelectedIndexChanged
        Select Case jenistv.Text
            Case "Sony"
                If inci.Text = "14""" Then
                    harga.Text = 1000000
                ElseIf inci.Text = "17""" Then
                    harga.Text = 1200000
                ElseIf inci.Text = "21""" Then
                    harga.Text = 1700000
                Else
                    harga.Text = 2000000
                End If
            Case "Panasonic"
                If inci.Text = "14""" Then
                    harga.Text = 1100000
                ElseIf inci.Text = "17""" Then
                    harga.Text = 1300000
                ElseIf inci.Text = "21""" Then
                    harga.Text = 1800000
                Else
                    harga.Text = 2100000
                End If
            Case "Samsung"
                If inci.Text = "14""" Then
                    harga.Text = 1200000
                ElseIf inci.Text = "17""" Then
                    harga.Text = 1250000
                ElseIf inci.Text = "21""" Then
                    harga.Text = 1900000
                Else
                    harga.Text = 2200000
                End If
            Case "LG"
                If inci.Text = "14""" Then
                    harga.Text = 1250000
                ElseIf inci.Text = "17""" Then
                    harga.Text = 1150000
                ElseIf inci.Text = "21""" Then
                    harga.Text = 1850000
                Else
                    harga.Text = 2250000
                End If
        End Select
    End Sub

    Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click

        hargajual.Text = jumlah.Text * harga.Text

        diskon.Text = 0.1 * hargajual.Text

        pajak.Text = 0.5 * hargajual.Text

        jmlhbayar.Text = hargajual.Text - diskon.Text + pajak.Text

    End Sub

    Private Sub bntsimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntsimpan.Click
        isitabel()
    End Sub

  
    Private Sub jumlah_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles jumlah.KeyPress
        If Asc(e.KeyChar) = 13 Then
            hargajual.Text = jumlah.Text * harga.Text

            diskon.Text = 0.1 * hargajual.Text

            pajak.Text = 0.5 * hargajual.Text

            jmlhbayar.Text = hargajual.Text - diskon.Text + pajak.Text
        End If
    End Sub

    Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click
        On Error Resume Next
        LV.Items.Remove(LV.Items(0))
    End Sub

    Private Sub LV_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles LV.KeyPress
        If e.KeyChar = Chr(27) Then
            LV.Items.Remove(LV.SelectedItems(0))
        End If
    End Sub
End Class

0 Response to "penjualan TV menggunakan VB.net"

Post a Comment