Jumat, 17 Maret 2017

Program Penjualan Pulsa


KODE PADA KOLOM NOMINAL PEMBELIAN 

Private Sub cbonominal_Click()
If Option1.Value = True Then
Select Case cbonominal.Text
Case 5000
txtjual.Text = 6500
Case 10000
txtjual.Text = 11500
Case 20000
txtjual.Text = 21500
Case 50000
txtjual.Text = 51500
End Select
End If
If Option2.Value = True Then
Select Case cbonominal.Text
Case 5000
txtjual.Text = 7000
Case 10000
txtjual.Text = 12000
Case 20000
txtjual.Text = 22000
Case 50000
txtjual.Text = 52000
End Select
txtbayar.SetFocus
End If
End Sub

KODE PADA KOLOM NAMA OPERATOR 

Private Sub cbooperator_Click()
If cbooperator.Text = "Simpati" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "As" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Mentari" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "IM3" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Three" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Axis" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Esia" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Flexi" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
ElseIf cbooperator.Text = "Freen" Then
cbonominal.AddItem "5000"
cbonominal.AddItem "10000"
cbonominal.AddItem "20000"
cbonominal.AddItem "50000"
End If

End Sub

KODE PADA TOMBOL CLEAR 

Private Sub cmdclear_Click()
cbooperator.Clear
cbonominal.Clear
Option1.Value = False
Option2.Value = False
txtjual.Text = ""
txtbayar.Text = ""
txtkembali.Text = ""
End Sub

KODE PADA TOMBOL CLOSE 


Private Sub cmdclose_Click()
pesan = MsgBox("Apakah Anda yakin ingin keluar dari Aplikasi ini?", vbYesNo + vbQuestion, "Keluar")
If pesan = vbYes Then
End
End If
End Sub

KODE PADA OPTION GSM

Private Sub Option1_Click()
If Option1.Value = True Then
cbooperator.AddItem "Simpati"
cbooperator.AddItem "As"
cbooperator.AddItem "Mentari"
cbooperator.AddItem "IM3"
cbooperator.AddItem "Three"
cbooperator.AddItem "Axis"
End If
End Sub

KODE PADA OPTION CDMA

Private Sub Option2_Click()
If Option2.Value = True Then
cbooperator.AddItem "Esia"
cbooperator.AddItem "Flexi"
cbooperator.AddItem "Freen"
End If
End Sub

KODE UNTUK HASIL MENGGUNAKAN ENTER 

Private Sub txtbayar_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtkembali.Text = txtbayar.Text - txtjual.Text
Label5.Caption = " TERIMA KASIH :) "
Label5.FontSize = 12
End If

End Sub

Tidak ada komentar:

Posting Komentar