Pages

Recent Posts

Visual Basic 6.0 - Program Penjualan Barang

Kamis, 02 Januari 2014


.::| PROGRAM PENJUALAN BARANG |::.

-=:| Berikut adalah kode Syntax Program Penjualan Barang |:=-
/////////
Private Sub Command2_Click()

If List1.Text = "" Then
MsgBox "Anda belum memilih barang !!"
List1.ListIndex = 0
Exit Sub
End If

If Text1.Text = "" Then
MsgBox "Anda belum mengisi jumlah barang !!"
Text1.SetFocus
Exit Sub
End If

If Text2.Text = "" Then
MsgBox "Anda belum memasukan pembayaran !!"
Text2.SetFocus
Exit Sub
End If


hasil = Text2 - lblTotal
Text3.Text = Format(hasil, "currency")
Label10.Caption = "TerimaKasih : " & Text4.Text
End Sub

Private Sub Command3_Click()
Dim Form1 As Integer
Form1 = MsgBox("Apakah Anda Yakin Ingin Keluar !!", vbYesNo)
If Form1 = vbYes Then
End
End If
End Sub

Private Sub Command4_Click()
Dim Form1 As Integer
Form1 = MsgBox("Apakah anda yakin ingin mengulanginya lagi dari awal ?", vbYesNo)
If Form1 = vbYes Then
lblBarang = Remove
lblHarga = Remove
lblJumlah = Remove
lblDiskon = Remove
lblTotal = Remove
Text1 = Remove
Text2 = Remove
Text3 = Remove
Text4 = Remove
Label10 = Remove
End If
End Sub

Private Sub Command5_Click()
MsgBox "NAMA : DERI FITRIYADI"
MsgBox "KELAS : XI RPL B"
Exit Sub
End Sub

Private Sub Form_Load()
List1.AddItem "CPU"
List1.AddItem "Monitor"
List1.AddItem "Printer"
List1.AddItem "Mouse"
List1.AddItem "Keyboard"
End Sub

Private Sub Command1_Click()
Dim Harga As Currency, total As Currency
Dim Jumlah As Integer
Dim Diskon As Single
Dim Satuan As String

If Text4.Text = "" Then
MsgBox "Anda harus mengisi nama anda terlebih dahulu !!"
Text4.SetFocus
Exit Sub
End If

If List1.Text = "" Then
MsgBox "Anda belum memilih barang !!"
List1.ListIndex = 0
Exit Sub
End If

If Text1.Text = "" Then
MsgBox "Anda belum mengisi jumlah barang !!"
Text1.SetFocus
Exit Sub
End If

Select Case List1.Text
Case "CPU"
Harga = 1000000
Satuan = "Unit"
Case "Monitor"
Harga = 650000
Satuan = "Unit"
Case "Printer"
Harga = 500000
Satuan = "Unit"
Case "Mouse"
Harga = 30000
Satuan = "Unit"
Case "Keyboard"
Harga = 50000
Satuan = "Unit"
End Select

lblBarang.Caption = List1.Text
lblHarga.Caption = Format(Harga, "Currency") & "/" & Satuan
lblJumlah.Caption = Text1.Text & "" & Satuan

Jumlah = Text1.Text

Select Case Jumlah
Case Is < 5
Diskon = 0
Case 5 To 10
Diskon = 0.1
Case Else
Diskon = 0.2
End Select

total = Jumlah * (Harga * (1 - Diskon))

lblDiskon.Caption = Format(Diskon, "0%")
lblTotal.Caption = Format(total, "Currency")
End Sub

Tidak ada komentar:

Posting Komentar

 

Most Reading

Berlangganan artikel DeriFs
secara gratis, Silahkan masukkan Email

Ads 200x200

Ads 200x200

Sidebar One

Kritik & Saran
Call Us :
083812797525
Invite FB : [KLIK DISINI]
Like Us FP : [KLIK DISINI]