Selamat datang di FamaGulz[dot]Blogspot[dot]Com

Program VB Penjualan TV Sederhana

Sunday, June 2, 20130 komentar

Listing Program

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Kode.Items.Add("TS001")
        Kode.Items.Add("LG002")
        Kode.Items.Add("PL001")
        Kode.Items.Add("SN002")
    End Sub

    Private Sub Kode_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Kode.SelectedIndexChanged
        Dim x As String
        x = Microsoft.VisualBasic.Left(Kode.Text, 2)
        Select Case x
            Case "TS" : Nama.Text = "Toshiba"
            Case "LG" : Nama.Text = "LG"
            Case "PL" : Nama.Text = "Polytron"
            Case "SN" : Nama.Text = "Sony"
        End Select
        Dim y As String
        y = Microsoft.VisualBasic.Mid(Kode.Text, 1)
        Select Case y
            Case "TS001" : Harga.Text = "950000"
            Case "LG002" : Harga.Text = "876000"
            Case "PL001" : Harga.Text = "990000"
            Case "SN002" : Harga.Text = "957000"
        End Select
    End Sub

    Private Sub Btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnproses.Click
        Total.Text = Val(Harga.Text) * Val(Jumlah.Text)
        If Total.Text >= 2500000 Then
            Discount.Text = 0.1 * Total.Text
        ElseIf Total.Text <= 2500000 Then
            Discount.Text = 0
        End If

        T_Pembayaran.Text = Val(Total.Text) - Val(Discount.Text)
    End Sub

    Private Sub Btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnhapus.Click
        Kode.Text = ""
        Nama.Text = ""
        Harga.Text = ""
        Jumlah.Text = ""
        Total.Text = ""
        Discount.Text = ""
        T_Pembayaran.Text = ""
    End Sub

    Private Sub Btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnkeluar.Click
        End
    End Sub
End Class


Gambar Hasil Program
Share this article :

Post a Comment

Admin

 
Support : Cara Gampang | Creating Website | Mas Template
Copyright © 2013. Fama Gulz - All Rights Reserved
Created by Creating Website Modify by Fama Gulz
Proudly powered by Blogger