Kamis, 29 November 2012

Tutorial Program Aplikasi Kasir


TUTORIAL PEMBUATAN KASIR
1.      Jalankan visual basic 2010
2.      windoos.jpgPilih windows form aplikation








3.      Lalu kreasikan form sesuai keinginan
form1.jpg

garpu.jpg






4.      Masukkan gambar , toolbox-picturebox





dgv.jpg5. untuk table, kita perlu datagridview,
bisa kita ambil melalui toolbox-datagridview














6. Klik 2 kali form dan tuliskan listing berikut
Public Class Form1
    Dim Harga As Integer
    Dim Jumlah_Barang As Integer = 0
    Dim Diskon As Double
    Dim Total_harga As Double
    Dim Bayar As Integer
    Dim Kembali As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If ComboBox1.Text = ("GELAS KACA") Then TextBox1.Text = ("5000")
        If ComboBox1.Text = ("GELAS KACA") Then PictureBox1.Show()
        If ComboBox1.Text = ("CANGKIR") Then TextBox1.Text = ("3000")
        If ComboBox1.Text = ("CANGKIR") Then PictureBox2.Show()
        If ComboBox1.Text = ("PIRING KACA") Then TextBox1.Text = ("6000")
        If ComboBox1.Text = ("PIRING KACA") Then PictureBox3.Show()
        If ComboBox1.Text = ("PIRING KERAMIK") Then TextBox1.Text = ("7000")
        If ComboBox1.Text = ("PIRING KERAMIK") Then PictureBox4.Show()
        If ComboBox1.Text = ("SENDOK") Then TextBox1.Text = ("8000")
        If ComboBox1.Text = ("SENDOK") Then PictureBox5.Show()
        If ComboBox1.Text = ("GARPU") Then TextBox1.Text = ("8000")
        If ComboBox1.Text = ("GARPU") Then PictureBox6.Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If Val(TextBox3.Text) > Val(TextBox6.Text) Then

            MsgBox("Uangnya kurang coooy")

        Else
           
                Me.Close()
            End If

    End Sub

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


        Harga = Val(TextBox1.Text)
        Jumlah_Barang = Val(TextBox5.Text)
        TextBox5.Text = Format(Jumlah_Barang, "#,#")

        If Val(TextBox5.Text) < 0 Then
            MsgBox("jumlah barang error")
            ComboBox1.Text = ""
            TextBox1.Text = ""
            TextBox5.Text = ""
            TextBox2.Text = ""
            Exit Sub
        Else
            Diskon = (Harga * Jumlah_Barang * TextBox2.Text) / 100
            Total_harga = Format((Harga * Jumlah_Barang) - Diskon, "#,#")
            TextBox3.Text = Total_harga
            TextBox7.Text = (Val(TextBox7.Text) + Val(TextBox3.Text))

            DataGridView1.Rows.Insert(0, ComboBox1.Text, TextBox1.Text, TextBox2.Text, TextBox5.Text, TextBox3.Text)

        End If
        If Diskon < 0 Then
            MsgBox("Tidak Melayani Diskon Minus")
            TextBox2.Text = ""
            TextBox3.Text = ""
            Exit Sub
        End If




    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Total_harga = Val(TextBox7.Text)
        Bayar = Val(TextBox6.Text)

        Kembali = Format(Bayar - Total_harga, "#,#")
        TextBox4.Text = Format(Kembali, "#,#")


        If Bayar < Total_harga Then
            MsgBox("jumlah pembayaran salah")
            TextBox4.Text = ""
            Exit Sub
        End If

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ComboBox1.Text = ""
        TextBox1.Text = ""
        TextBox5.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox6.Text = ""
        TextBox7.Text = ""

        PictureBox1.Visible = False

        PictureBox2.Visible = False

        PictureBox3.Visible = False

        PictureBox4.Visible = False

        PictureBox5.Visible = False

        PictureBox6.Visible = False

        DataGridView1.Rows.Clear()
    End Sub
    Private Sub Button5_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        ComboBox1.Text = ""
        TextBox1.Text = ""
        TextBox5.Text = ""
        TextBox2.Text = ""
        TextBox4.Text = ""
        TextBox6.Text = ""

        PictureBox1.Visible = False

        PictureBox2.Visible = False

        PictureBox3.Visible = False

        PictureBox4.Visible = False

        PictureBox5.Visible = False

        PictureBox6.Visible = False
    End Sub

    Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
        If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
            e.Handled = False
        ElseIf Asc(e.KeyChar) = 43 Or Asc(e.KeyChar) = 95 Or Asc(e.KeyChar) = 45 Or Asc(e.KeyChar) = 44 Or Asc(e.KeyChar) = 46 Then
            e.Handled = False
        ElseIf e.KeyChar = vbBack Then
            e.Handled = False
        Else
            e.Handled = True
        End If



    End Sub
End Class










Panduan Pemakaian Program Kasir “Toko Kita”
form1.jpg







Nama barang è untuk memilih barang apa saja yang dibeli
Harga è menunjukkan harga barang tersebut. Mucul secara otomatis
 Jumlah barang è input jumlah barang yang anda beli
Diskon/barang è diskon barang
Sementara è harga sementara sebelum diakumulasi dengan barang jenis lain
Bayar è jumlah uang bayar
Kembali è jumlah uang kembalian
Harga akhir è nominal yang harus dibayar
Tombol total harga è untuk mengeksekusi harga
Tombol lagi è untuk menambahkan barang jenis lain kedalam belanjaan
Tombol kembali è untuk mengeksekusi kembalian uang anda
Tombol refresh è untuk mengkosongkan semua kotak isian
Tombol keluar è untuk keluar program kasir toko kita
Gambar è memunculkan gambar barang yang anda beli
Kotak struk è menampilkan rekap belanja anda

Tidak ada komentar:

Posting Komentar