0% found this document useful (0 votes)
59 views10 pages

Laporan Aplikasi Kasir Resto

This document describes a simple cash register application created in Visual Studio. It discusses the user interface elements like labels, textboxes, and buttons. It also includes the code for the application's main class (ClsObjek) which defines properties and methods for storing and calculating order details. The form code (Form1) handles user input, saving data to file, and clearing fields. When the "Add" button is clicked, it validates the input, saves the order details to file, and displays a message. This provides a basic cash register application for storing and viewing sales transactions.

Uploaded by

azhamscribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views10 pages

Laporan Aplikasi Kasir Resto

This document describes a simple cash register application created in Visual Studio. It discusses the user interface elements like labels, textboxes, and buttons. It also includes the code for the application's main class (ClsObjek) which defines properties and methods for storing and calculating order details. The form code (Form1) handles user input, saving data to file, and clearing fields. When the "Add" button is clicked, it validates the input, saves the order details to file, and displays a message. This provides a basic cash register application for storing and viewing sales transactions.

Uploaded by

azhamscribd
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

LAPORAN VISUAL STUDIO MEMBUAT APLIKASI KASIR SEDERHANA

NAMA KELAS NPM

: AZHAM SOBRI BAFADAL : 2C : 1123117

POLITEKNIK POS INDONESIA TAHUN AJARAN 2013/2014

BENTUK PENGERJAAN
LABEL TEXTBOX

GroupBox FORM

BUTTON RichTextBox Textbox

Script ClsObjek.vb
Public Class ClsObjek Private m_Makanan As String Private m_Harga As Single Private m_Jumlah As Single Private m_outputfile As String Private outputfile As System.IO.StreamWriter Public Sub New(ByVal value As String) m_Makanan = "Masukan Menu Makanan" m_Harga = 0 m_outputfile = value End Sub Public Property Makanan() As String Get Return m_Makanan End Get Set(ByVal value As String) If value <> "" And value <> "Masukan Menu Makanan" Then m_Makanan = value Else MessageBox.Show("Masukan Menu Makanan", "Makanan") End If End Set End Property Public Property Harga() As Single Get Return m_Harga End Get Set(ByVal value As Single) If value > 0 Then m_Harga = value Else MessageBox.Show("Masukan Harga Makanan", "Harga") End If End Set End Property Public Property Jumlah() As Single Get Return m_Jumlah End Get Set(ByVal value As Single) If value > 0 Then m_Jumlah = value Else MessageBox.Show("Masukan Jumlah Makanan", "Jumlah") End If End Set End Property Public Sub Bersih() m_Makanan = "" m_Jumlah = 0 m_Harga = 0 End Sub Function isValid() As Boolean

If m_Makanan <> "" And m_Makanan <> "Masukan Menu Makanan" And m_Harga > 0 And m_Jumlah > 0 Then Return True Else Return False End If End Function Function SubTotal() As Single Return m_Harga * m_Jumlah End Function Function PPN() As Single Return SubTotal() / 10% End Function Function Total() As Single Return SubTotal() + PPN() End Function Public Sub Cetak() outputfile = System.IO.File.AppendText(m_outputfile) outputfile.WriteLine("-------------------------------------------------") outputfile.WriteLine("MENU MAKANAN : " & m_Makanan) outputfile.WriteLine("HARGA : Rp." & m_Harga) outputfile.WriteLine("JUMLAH : " & m_Jumlah) outputfile.WriteLine("Sub Total : Rp." & SubTotal()) outputfile.WriteLine("PPN : Rp." & PPN()) outputfile.WriteLine("TOTAL : RP." & Total()) outputfile.WriteLine("-------------------------------------------------") outputfile.Close() End Sub End Class

Script Form1.vb
Public Class Form1 Dim Bayar As New ClsObjek("D:\Tagihan.txt") Private Sub btntambah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btntambah.Click Bayar.Makanan = txtmkanan.Text Bayar.Harga = txthrga.Text Bayar.Jumlah = txtjml.Text If Bayar.isValid Then Bayar.Cetak() bersihIsian() MessageBox.Show("Data Sudah Disimpan", "Daftar Menu") End If Dim tampil As Integer = FreeFile() FileOpen(tampil, "D:\Tagihan.txt", OpenMode.Input) rtxtTampil.Text = InputString(tampil, LOF(tampil)) FileClose(tampil) End Sub Private Sub bersihIsian() With Bayar .Bersih() txtmkanan.Text = .Makanan txtjml.Text = .Jumlah txthrga.Text = .Harga End With End Sub Public Sub New() InitializeComponent() txtmkanan.Text = Bayar.Makanan txtjml.Text = Bayar.Jumlah txthrga.Text = Bayar.Harga End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click bersihIsian() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

Hasil Dari Pengerjaan 1. Tampilan awal saat start debugging

2. Memasukkan Nama Makanan, harga dan jumlah

3. Menggunakan Tombol batal (field makanan, harga, dan jumlah berubah menjadi kosong)

4. Menggunakan Tombol Tambah

5. Hasil Dari Penggunaan Tombol Tambah

6. Hasil Dari Kegunaan Fungsi Tombol Tambah yang lain

7. Hasil Dari Tampilan (selesai)

You might also like