Tugas ETS

Muhammad Kiantaqwa Farhan
05111740000146
PBKK C

1. Sebutkan aplikasi POS yang biasa dipakai di masyarakat?

Aplikasi POS atau Point Of Sale Application biasa juga disebut dengan aplikasi kasir adalah aplikasi atau software yang digunakan untuk mendukung transaksi langsung dengan penjual di berbagai toko retail yang memiliki banyak cabang.

- Nobly POS 
Sistem iPad EPOS yang ditujukan untuk ukuran kecil dan menengah, Nobly POS menawarkan antarmuka intuitif yang dirancang untuk membantu bisnis menyediakan layanan yang lebih cepat kepada pelanggan mereka.


- Square
Sistem POS yang dapat diakses melalui perangkat seluler dan desktop, Square dibangun untuk memenuhi kebutuhan berbagai bisnis.

- Poster POS 
Sistem POS yang dihosting di cloud untuk bisnis kecil, Poster POS mudah disiapkan, digunakan, dan dipelihara.

- Magestore POS
Magestore POS kaya akan semua fitur yang dibutuhkan dalam sistem POS yang baik yang memungkinkan pengecer untuk melacak semua aktivitas yang terjadi di sekitar toko.

- Toast POS
Toast POS adalah perangkat lunak POS yang dihosting di cloud yang dibuat khusus untuk restoran yang berbasis di Amerika Serikat. Aplikasi ini bertujuan untuk memberi pengguna kendali penuh dan visibilitas atas bisnis mereka melalui fungsionalitas top-of-the-line.

- Shopify
Shopify dapat mengelola produk mereka secara online dan menjangkau orang-orang melalui berbagai saluran seperti media sosial, dll

- Vend 
Vend adalah web hybrid dan perangkat lunak POS seluler untuk bisnis di industri ritel. Fleksibel dan mudah diterapkan, sistem ini dapat menangani manajemen pesanan, tanda terima khusus, pengembalian dan pengembalian produk, serta pembuatan barcode.

  • Kas Kecil dan Buka Tutup Kasir
    • Program kasir majoo mencatat modal awal kas harian saat buka kasir dan biaya pengeluaran untuk belanja modal atau pengeluaran-pengeluaran lain beserta dengan foto nota belanja. Saat tutup kasir akan ditampilkan rincian dan saldo kas akhir, serta daftar produk yang terjual. 


  • Klasifikasi Jenis Order
    • Multi Order
      • Mencatat berbagai jenis order (bungkus, delivery, meja, jasa) sehingga memperkuat analisa transaksi untuk peningkatan volume penjualan maupun efisiensi usaha.
    • Variasi Harga Jual
      • Mengatur berbagai kondisi harga jual produk, yaitu menjual produk yang tidak ada dalam daftar produk (custom amount), mengatur kasir untuk memberikan harga nego dengan batasana harga tertentu, menjual produk dengan jumlah pembelian minimum.
  • Metode Pembayaran
    • Multi Payment
      • Satu transaksi dapat dibayar dengan lebih dari satu jenis pembayaran. Kemampuan membedakan jenis pembayaran baik cash, edc, transfer bank, wallet, compliment, deposit, poin dan kupon yang terhubung dengan fungsi keuangan akunting.
    • Invoice
      • Pembayaran dapat dirubah menjadi metode bayar invoice dengan pilihan jatuh tempo pembayaran.
    • Pembulatan Pembayaran
      • Membulatkan tagihan/bill ke pecahan uang yang umum sehingga mempermudah pengembalian pembayaran. Contoh: tagihan/bill Rp. 10.260,- dibulatkan ke ratusan atau lima ratusan menjadi Rp. 10.300,- atau 10.500,-.
    • Pengaturan Pembayaran
      • Fleksibel mengatur pembayaran dengan/tanpa pajak termasuk pajak promo (pajak sebelum diskon, pajak, harga termasuk) serta tambahan biaya layanan atau service charge.
    • Pisah Bayar
      • Pisah Jumlah
        • Pembayaran transaksi dapat dipisah sesuai dengan nominal yang ditentukan. Dengan cara ini, beberapa pelanggan yang melakukan transaksi bersama, dapat membagi nilai total transaksinya dan masing-masing pelanggan dapat melakukan pembayaran secara terpisah.
      • Pisah Produk
        • Pemisahan pembayaran juga dapat dilakukan berdasarkan produk yang dipilih. Jadi jika ada beberapa pelanggan bertransaksi di satu transaksi yang sama, pelanggan dapat membayar produk yang mereka beli atau gunakan masing-masing secara terpisah.
      • Self Order, Display Order, dan Proses Kitchen
        • Kitchen Display
          • Selain menggunakan printer dapur, proses order dari kasir dapat dikirimkan ke bagian dapur/bar/proses menggunakan kitchen/order display, lebih canggih dengan pencatatan status setiap item yang diposes, sehingga mudah untuk melacak dan menghindari double order atau order tidak terproses.
        • Order Display
          • Order display akan menampilkan nomor nomor order yang sedang di proses dan yang telah selesai di proses, ditampilkan dalam tv layar lebar untuk mempermudah pelanggan menunggu dan mendapatkan produk, serta meningkatkan penjualan karena terdapat ruang display untuk menampilkan video atau gambar iklan produk.
        • Self Order
          • Layanan order tanpa kasir dengan pembayaran non-tunai melalui ewallet (Dana Gopay Ovo LinkAja Shopeepay Dll.). Self order juga dapat digunakan bersamaan dengan kasir untuk memecah order atau meningkatkan order karena pelanggan bisa membuka semua menu atau mendapatkan promo khusus.
        • Invoice
          • Invoice dengan format dokumen standar yang diperlukan untuk penjualan yang memerlukan bukti transaksi legal sebagai penagihan.

    3. Buat rancangan UI dan navigasi aplikasi POS mu sendiri?

    Aplikasi POS yang kami buat merupakan desktop application yang melayani transaksi penjualan food and beverages, cara kerjanya menyerupai mesin kasir. Berikut adalah rancangan UI beserta penjelasan fitur aplikasi POS kami :

    UI halaman utama :

Alur penggunaannya adalah sebagai berikut :
  1. Pengguna memilih menu makanan dan minuman yang tersedia pada gambar dengan cara menekannya. Apabila suatu item dipilih, item tersebut akan secara otomatis tercatat dalam tabel pesanan pada bagian tengah. Pengguna dapat memilih item sebanyak mungkin.
  2. Apabila pengguna ingin menghapus atau mengganti suatu pesanan, pengguna dapat memilih item pada tabel kemudian menekan tombol Remove Item pada bagian kanan bawah.
  3. Setelah selesai memilih pesanan, harga pesanan akan tertampil pada bagian kiri bawah. Dimana : Subtotal - merupakan total harga sebelum pajak. Tax - merupakan total pajak. dan Total - merupakan total harga pesanan setelah pajak.
  4. Untuk melanjutkan ke pembayaran, pengguna terlebih dahulu memilih metode pembayaran pada Payment Method dimana didalamnya terdapat 3 pilihan metode pembarayan yaitu Cash, Visa Card dan Master Card.
  5. Kemudian pengguna memasukkan nominal uang yang dibayarkan dengan mengisinya pada kolom Cost, dengan menekan angka-angka pada bagian kiri atas. 
  6. Selanjutnya pengguna perlu menekan tombol Pay untuk membayar. Apabila terdapat kembalian, nominal pengembalian akan ditampilkan pada kolom Change.
  7. Untuk mencetak struk, pengguna dapat menekan tombol Print
  8. Untuk mengulang transaksi, pengguna dapat menekan tombol Reset.

4. Dengan menggunakan framework .NET implementasikan aplikasi POS yang dirancang.

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.Windows.Forms;
  6.  
  7. namespace ETS_PosApp
  8. {
  9.     static class Program
  10.     {
  11.         /// <summary>
  12.         /// The main entry point for the application.
  13.         /// </summary>
  14.         [STAThread]
  15.         static void Main()
  16.         {
  17.             Application.EnableVisualStyles();
  18.             Application.SetCompatibleTextRenderingDefault(false);
  19.             Application.Run(new Form1());
  20.         }
  21.     }
  22. }


  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace ETS_PosApp
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.        
  20.         public double CostOfItems()
  21.         {
  22.             Double sum = 0;
  23.             int i = 0;
  24.             for (= 0; i < (dataGridView1.Rows.Count); i++)
  25.             {
  26.                 sum += Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value);
  27.             }
  28.             return sum;
  29.         }
  30.  
  31.         private void AddCost()
  32.         {
  33.             Double tax, g;
  34.             tax = 3.9;
  35.             if (dataGridView1.Rows.Count > 0)
  36.             {
  37.                 lblTax.Text = String.Format("{0:c2}"(( CostOfItems() * tax) / 100));
  38.                 lblSubTotal.Text = String.Format("{0:c2}"( CostOfItems() ));
  39.                 g = ((CostOfItems() * tax) / 100);
  40.                 lblTotal.Text = String.Format("{0:c2}"(CostOfItems() + g));
  41.                 lblBarcode.Text = Convert.ToString(+ CostOfItems());
  42.             }
  43.         }
  44.        
  45.         private void Change()
  46.         {
  47.             Double tax, g, c;
  48.             tax = 3.9;
  49.             if (dataGridView1.Rows.Count > 0)
  50.             {
  51.                 g = ((CostOfItems() * tax) / 100) + CostOfItems();
  52.                 c = Convert.ToInt32(lblCash.Text);
  53.                 this.lblChange.Text = String.Format("{0:c2}", c - g);
  54.             }
  55.         }
  56.  
  57.         Bitmap bitmap;
  58.         private void btnPrint_Click(object sender, EventArgs e)
  59.         {
  60.             try
  61.             {
  62.                 int height = dataGridView1.Height;
  63.                 dataGridView1.Height = dataGridView1.RowCount * dataGridView1.RowTemplate.Height * 2;
  64.                 bitmap = new Bitmap(dataGridView1.Width, dataGridView1.Height);
  65.                 dataGridView1.DrawToBitmap(bitmap, new Rectangle(00, dataGridView1.Width, dataGridView1.Height));
  66.                 printPreviewDialog1.PrintPreviewControl.Zoom = 1;
  67.                 printPreviewDialog1.ShowDialog();
  68.                 dataGridView1.Height = height;
  69.             }
  70.             catch(Exception ex)
  71.             {
  72.                 MessageBox.Show(ex.Message);
  73.             }
  74.         }
  75.  
  76.         private void button38_Click(object sender, EventArgs e)
  77.         {
  78.             try
  79.             {
  80.                 int height = dataGridView1.Height;
  81.                 dataGridView1.Height = dataGridView1.RowCount * dataGridView1.RowTemplate.Height * 2;
  82.                 bitmap = new Bitmap(dataGridView1.Width, dataGridView1.Height);
  83.                 dataGridView1.DrawToBitmap(bitmap, new Rectangle(00, dataGridView1.Width, dataGridView1.Height));
  84.                 printPreviewDialog1.PrintPreviewControl.Zoom = 1;
  85.                 printPreviewDialog1.ShowDialog();
  86.                 dataGridView1.Height = height;
  87.             }
  88.             catch (Exception ex)
  89.             {
  90.                 MessageBox.Show(ex.Message);
  91.             }
  92.                
  93.         }
  94.  
  95.         private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
  96.         {
  97.             try
  98.             {
  99.                 e.Graphics.DrawImage(bitmap, 00);
  100.             }
  101.             catch (Exception ex)
  102.             {
  103.                 MessageBox.Show(ex.Message);
  104.             }
  105.         }
  106.  
  107.         private void btnReset_Click(object sender, EventArgs e)
  108.         {
  109.             try
  110.             {
  111.                 lblBarcode.Text = "";
  112.                 lblCash.Text = "0";
  113.                 lblChange.Text = "";
  114.                 lblSubTotal.Text = "";
  115.                 lblTax.Text = "";
  116.                 lblTotal.Text = "";
  117.                 dataGridView1.Rows.Clear();
  118.                 dataGridView1.Refresh();
  119.                 cboPayment.Text = "";
  120.             }
  121.             catch (Exception ex)
  122.             {
  123.                 MessageBox.Show(ex.Message);
  124.             }
  125.         }
  126.  
  127.         private void Form1_Load(object sender, EventArgs e)
  128.         {
  129.             cboPayment.Items.Add("Cash");
  130.             cboPayment.Items.Add("Visa Card");
  131.             cboPayment.Items.Add("Master Card");
  132.         }
  133.  
  134.         private void NumbersOnly1(object sender, EventArgs e)
  135.         {
  136.             Button b = (Button)sender;
  137.  
  138.             if (lblCash.Text == "0")
  139.             {
  140.                 lblCash.Text = "";
  141.                 lblCash.Text = b.Text;
  142.             }
  143.             else if (b.Text == ".")
  144.             {
  145.                 if (!lblCash.Text.Contains("."))
  146.                 {
  147.                     lblCash.Text = lblCash.Text + b.Text;
  148.                 }
  149.             }
  150.             else
  151.                 lblCash.Text = lblCash.Text + b.Text;
  152.         }
  153.  
  154.         private void btnC_Click(object sender, EventArgs e)
  155.         {
  156.             lblCash.Text = "0";
  157.         }
  158.  
  159.         private void btnPay_Click(object sender, EventArgs e)
  160.         {
  161.             if (cboPayment.Text == "Cash")
  162.             {
  163.                 Change();
  164.             }
  165.             else
  166.             {
  167.                 lblChange.Text = "";
  168.                 lblCash.Text = "0";
  169.             }
  170.         }
  171.  
  172.         private void btnRemoveItem_Click(object sender, EventArgs e)
  173.         {
  174.             foreach(DataGridViewRow row in this.dataGridView1.SelectedRows)
  175.             {
  176.                 dataGridView1.Rows.Remove(row);
  177.             }
  178.             AddCost();
  179.             if (cboPayment.Text == "Cash")
  180.             {
  181.                 Change();
  182.             }
  183.             else
  184.             {
  185.                 lblChange.Text = "";
  186.                 lblCash.Text = "0";
  187.             }
  188.         }
  189.  
  190.         private void button24_Click(object sender, EventArgs e)
  191.         {
  192.             Double CostifItem = 12000;
  193.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  194.             {
  195.                 if ((bool)(row.Cells[0].Value = "button24"))
  196.                 {
  197.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  198.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  199.                 }
  200.             }
  201.             dataGridView1.Rows.Add("Bread and Ice Cream""1", CostifItem);
  202.             AddCost();
  203.         }
  204.  
  205.         private void button23_Click(object sender, EventArgs e)
  206.         {
  207.             Double CostifItem = 25000;
  208.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  209.             {
  210.                 if ((bool)(row.Cells[0].Value = "button23"))
  211.                 {
  212.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  213.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  214.                 }
  215.             }
  216.             dataGridView1.Rows.Add("Fried Chicken""1", CostifItem);
  217.             AddCost();
  218.         }
  219.  
  220.         private void button22_Click(object sender, EventArgs e)
  221.         {
  222.             Double CostifItem = 25000;
  223.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  224.             {
  225.                 if ((bool)(row.Cells[0].Value = "button22"))
  226.                 {
  227.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  228.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  229.                 }
  230.             }
  231.             dataGridView1.Rows.Add("Hamburger""1", CostifItem);
  232.             AddCost();
  233.         }
  234.  
  235.         private void button36_Click(object sender, EventArgs e)
  236.         {
  237.             Double CostifItem = 15000;
  238.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  239.             {
  240.                 if ((bool)(row.Cells[0].Value = "button36"))
  241.                 {
  242.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  243.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  244.                 }
  245.             }
  246.             dataGridView1.Rows.Add("Lasagna""1", CostifItem);
  247.             AddCost();
  248.         }
  249.  
  250.         private void button35_Click(object sender, EventArgs e)
  251.         {
  252.             Double CostifItem = 12000;
  253.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  254.             {
  255.                 if ((bool)(row.Cells[0].Value = "button35"))
  256.                 {
  257.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  258.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  259.                 }
  260.             }
  261.             dataGridView1.Rows.Add("Donuts""1", CostifItem);
  262.             AddCost();
  263.         }
  264.  
  265.         private void button34_Click(object sender, EventArgs e)
  266.         {
  267.             Double CostifItem = 50000;
  268.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  269.             {
  270.                 if ((bool)(row.Cells[0].Value = "button34"))
  271.                 {
  272.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  273.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  274.                 }
  275.             }
  276.             dataGridView1.Rows.Add("Gnocci""1", CostifItem);
  277.             AddCost();
  278.         }
  279.  
  280.         private void button21_Click(object sender, EventArgs e)
  281.         {
  282.             Double CostifItem = 50000;
  283.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  284.             {
  285.                 if ((bool)(row.Cells[0].Value = "button21"))
  286.                 {
  287.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  288.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  289.                 }
  290.             }
  291.             dataGridView1.Rows.Add("Birthday Cake""1", CostifItem);
  292.             AddCost();
  293.         }
  294.  
  295.         private void button20_Click(object sender, EventArgs e)
  296.         {
  297.             Double CostifItem = 12000;
  298.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  299.             {
  300.                 if ((bool)(row.Cells[0].Value = "button20"))
  301.                 {
  302.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  303.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  304.                 }
  305.             }
  306.             dataGridView1.Rows.Add("Snacks""1", CostifItem);
  307.             AddCost();
  308.         }
  309.  
  310.         private void button19_Click(object sender, EventArgs e)
  311.         {
  312.             Double CostifItem = 12000;
  313.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  314.             {
  315.                 if ((bool)(row.Cells[0].Value = "button19"))
  316.                 {
  317.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  318.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  319.                 }
  320.             }
  321.             dataGridView1.Rows.Add("Lemonade""1", CostifItem);
  322.             AddCost();
  323.         }
  324.  
  325.         private void button33_Click(object sender, EventArgs e)
  326.         {
  327.             Double CostifItem = 50000;
  328.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  329.             {
  330.                 if ((bool)(row.Cells[0].Value = "button33"))
  331.                 {
  332.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  333.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  334.                 }
  335.             }
  336.             dataGridView1.Rows.Add("Ratatouille""1", CostifItem);
  337.             AddCost();
  338.         }
  339.  
  340.         private void button32_Click(object sender, EventArgs e)
  341.         {
  342.             Double CostifItem = 25000;
  343.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  344.             {
  345.                 if ((bool)(row.Cells[0].Value = "button32"))
  346.                 {
  347.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  348.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  349.                 }
  350.             }
  351.             dataGridView1.Rows.Add("Lasagna""1", CostifItem);
  352.             AddCost();
  353.         }
  354.  
  355.         private void button31_Click(object sender, EventArgs e)
  356.         {
  357.             Double CostifItem = 95000;
  358.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  359.             {
  360.                 if ((bool)(row.Cells[0].Value = "button31"))
  361.                 {
  362.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  363.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  364.                 }
  365.             }
  366.             dataGridView1.Rows.Add("Rainbow Cake""1", CostifItem);
  367.             AddCost();
  368.         }
  369.  
  370.         private void button18_Click(object sender, EventArgs e)
  371.         {
  372.             Double CostifItem = 12000;
  373.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  374.             {
  375.                 if ((bool)(row.Cells[0].Value = "button18"))
  376.                 {
  377.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  378.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  379.                 }
  380.             }
  381.             dataGridView1.Rows.Add("Cheese Toast""1", CostifItem);
  382.             AddCost();
  383.         }
  384.  
  385.         private void button17_Click(object sender, EventArgs e)
  386.         {
  387.             Double CostifItem = 15000;
  388.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  389.             {
  390.                 if ((bool)(row.Cells[0].Value = "button17"))
  391.                 {
  392.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  393.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  394.                 }
  395.             }
  396.             dataGridView1.Rows.Add("Strawberry Juice""1", CostifItem);
  397.             AddCost();
  398.         }
  399.  
  400.         private void button16_Click(object sender, EventArgs e)
  401.         {
  402.             Double CostifItem = 25000;
  403.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  404.             {
  405.                 if ((bool)(row.Cells[0].Value = "button16"))
  406.                 {
  407.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  408.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  409.                 }
  410.             }
  411.             dataGridView1.Rows.Add("Orange Juice""1", CostifItem);
  412.             AddCost();
  413.         }
  414.  
  415.         private void button30_Click(object sender, EventArgs e)
  416.         {
  417.             Double CostifItem = 32000;
  418.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  419.             {
  420.                 if ((bool)(row.Cells[0].Value = "button30"))
  421.                 {
  422.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  423.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  424.                 }
  425.             }
  426.             dataGridView1.Rows.Add("Pasta""1", CostifItem);
  427.             AddCost();
  428.         }
  429.  
  430.         private void button29_Click(object sender, EventArgs e)
  431.         {
  432.             Double CostifItem = 25000;
  433.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  434.             {
  435.                 if ((bool)(row.Cells[0].Value = "button29"))
  436.                 {
  437.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  438.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  439.                 }
  440.             }
  441.             dataGridView1.Rows.Add("Mushroom Pie""1", CostifItem);
  442.             AddCost();
  443.         }
  444.  
  445.         private void button28_Click(object sender, EventArgs e)
  446.         {
  447.             Double CostifItem = 50000;
  448.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  449.             {
  450.                 if ((bool)(row.Cells[0].Value = "button28"))
  451.                 {
  452.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  453.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  454.                 }
  455.             }
  456.             dataGridView1.Rows.Add("Pizza""1", CostifItem);
  457.             AddCost();
  458.         }
  459.  
  460.         private void button15_Click(object sender, EventArgs e)
  461.         {
  462.             Double CostifItem = 32000;
  463.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  464.             {
  465.                 if ((bool)(row.Cells[0].Value = "button15"))
  466.                 {
  467.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  468.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  469.                 }
  470.             }
  471.             dataGridView1.Rows.Add("Soup""1", CostifItem);
  472.             AddCost();
  473.         }
  474.  
  475.         private void button14_Click(object sender, EventArgs e)
  476.         {
  477.             Double CostifItem = 25000;
  478.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  479.             {
  480.                 if ((bool)(row.Cells[0].Value = "button14"))
  481.                 {
  482.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  483.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  484.                 }
  485.             }
  486.             dataGridView1.Rows.Add("Salad""1", CostifItem);
  487.             AddCost();
  488.         }
  489.  
  490.         private void button13_Click(object sender, EventArgs e)
  491.         {
  492.             Double CostifItem = 15000;
  493.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  494.             {
  495.                 if ((bool)(row.Cells[0].Value = "button13"))
  496.                 {
  497.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  498.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  499.                 }
  500.             }
  501.             dataGridView1.Rows.Add("Tea""1", CostifItem);
  502.             AddCost();
  503.         }
  504.  
  505.         private void button27_Click(object sender, EventArgs e)
  506.         {
  507.             Double CostifItem = 12000;
  508.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  509.             {
  510.                 if ((bool)(row.Cells[0].Value = "button27"))
  511.                 {
  512.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  513.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  514.                 }
  515.             }
  516.             dataGridView1.Rows.Add("Mocca Donuts""1", CostifItem);
  517.             AddCost();
  518.         }
  519.  
  520.         private void button26_Click(object sender, EventArgs e)
  521.         {
  522.             Double CostifItem = 12000;
  523.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  524.             {
  525.                 if ((bool)(row.Cells[0].Value = "button26"))
  526.                 {
  527.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  528.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  529.                 }
  530.             }
  531.             dataGridView1.Rows.Add("Bread and Cream""1", CostifItem);
  532.             AddCost();
  533.         }
  534.  
  535.         private void button25_Click(object sender, EventArgs e)
  536.         {
  537.             Double CostifItem = 12000;
  538.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  539.             {
  540.                 if ((bool)(row.Cells[0].Value = "button25"))
  541.                 {
  542.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  543.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  544.                 }
  545.             }
  546.             dataGridView1.Rows.Add("Salty Snacks""1", CostifItem);
  547.             AddCost();
  548.         }
  549.  
  550.         private void lblSubTotal_Click(object sender, EventArgs e)
  551.         {
  552.  
  553.         }
  554.     }
  555. }
  556. using System;
  557. using System.Collections.Generic;
  558. using System.ComponentModel;
  559. using System.Data;
  560. using System.Drawing;
  561. using System.Linq;
  562. using System.Text;
  563. using System.Threading.Tasks;
  564. using System.Windows.Forms;
  565.  
  566. namespace ETS_PosApp
  567. {
  568.     public partial class Form1 : Form
  569.     {
  570.         public Form1()
  571.         {
  572.             InitializeComponent();
  573.         }
  574.        
  575.         public double CostOfItems()
  576.         {
  577.             Double sum = 0;
  578.             int i = 0;
  579.             for (= 0; i < (dataGridView1.Rows.Count); i++)
  580.             {
  581.                 sum += Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value);
  582.             }
  583.             return sum;
  584.         }
  585.  
  586.         private void AddCost()
  587.         {
  588.             Double tax, g;
  589.             tax = 3.9;
  590.             if (dataGridView1.Rows.Count > 0)
  591.             {
  592.                 lblTax.Text = String.Format("{0:c2}"(( CostOfItems() * tax) / 100));
  593.                 lblSubTotal.Text = String.Format("{0:c2}"( CostOfItems() ));
  594.                 g = ((CostOfItems() * tax) / 100);
  595.                 lblTotal.Text = String.Format("{0:c2}"(CostOfItems() + g));
  596.                 lblBarcode.Text = Convert.ToString(+ CostOfItems());
  597.             }
  598.         }
  599.        
  600.         private void Change()
  601.         {
  602.             Double tax, g, c;
  603.             tax = 3.9;
  604.             if (dataGridView1.Rows.Count > 0)
  605.             {
  606.                 g = ((CostOfItems() * tax) / 100) + CostOfItems();
  607.                 c = Convert.ToInt32(lblCash.Text);
  608.                 this.lblChange.Text = String.Format("{0:c2}", c - g);
  609.             }
  610.         }
  611.  
  612.         Bitmap bitmap;
  613.         private void btnPrint_Click(object sender, EventArgs e)
  614.         {
  615.             try
  616.             {
  617.                 int height = dataGridView1.Height;
  618.                 dataGridView1.Height = dataGridView1.RowCount * dataGridView1.RowTemplate.Height * 2;
  619.                 bitmap = new Bitmap(dataGridView1.Width, dataGridView1.Height);
  620.                 dataGridView1.DrawToBitmap(bitmap, new Rectangle(00, dataGridView1.Width, dataGridView1.Height));
  621.                 printPreviewDialog1.PrintPreviewControl.Zoom = 1;
  622.                 printPreviewDialog1.ShowDialog();
  623.                 dataGridView1.Height = height;
  624.             }
  625.             catch(Exception ex)
  626.             {
  627.                 MessageBox.Show(ex.Message);
  628.             }
  629.         }
  630.  
  631.         private void button38_Click(object sender, EventArgs e)
  632.         {
  633.             try
  634.             {
  635.                 int height = dataGridView1.Height;
  636.                 dataGridView1.Height = dataGridView1.RowCount * dataGridView1.RowTemplate.Height * 2;
  637.                 bitmap = new Bitmap(dataGridView1.Width, dataGridView1.Height);
  638.                 dataGridView1.DrawToBitmap(bitmap, new Rectangle(00, dataGridView1.Width, dataGridView1.Height));
  639.                 printPreviewDialog1.PrintPreviewControl.Zoom = 1;
  640.                 printPreviewDialog1.ShowDialog();
  641.                 dataGridView1.Height = height;
  642.             }
  643.             catch (Exception ex)
  644.             {
  645.                 MessageBox.Show(ex.Message);
  646.             }
  647.                
  648.         }
  649.  
  650.         private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
  651.         {
  652.             try
  653.             {
  654.                 e.Graphics.DrawImage(bitmap, 00);
  655.             }
  656.             catch (Exception ex)
  657.             {
  658.                 MessageBox.Show(ex.Message);
  659.             }
  660.         }
  661.  
  662.         private void btnReset_Click(object sender, EventArgs e)
  663.         {
  664.             try
  665.             {
  666.                 lblBarcode.Text = "";
  667.                 lblCash.Text = "0";
  668.                 lblChange.Text = "";
  669.                 lblSubTotal.Text = "";
  670.                 lblTax.Text = "";
  671.                 lblTotal.Text = "";
  672.                 dataGridView1.Rows.Clear();
  673.                 dataGridView1.Refresh();
  674.                 cboPayment.Text = "";
  675.             }
  676.             catch (Exception ex)
  677.             {
  678.                 MessageBox.Show(ex.Message);
  679.             }
  680.         }
  681.  
  682.         private void Form1_Load(object sender, EventArgs e)
  683.         {
  684.             cboPayment.Items.Add("Cash");
  685.             cboPayment.Items.Add("Visa Card");
  686.             cboPayment.Items.Add("Master Card");
  687.         }
  688.  
  689.         private void NumbersOnly1(object sender, EventArgs e)
  690.         {
  691.             Button b = (Button)sender;
  692.  
  693.             if (lblCash.Text == "0")
  694.             {
  695.                 lblCash.Text = "";
  696.                 lblCash.Text = b.Text;
  697.             }
  698.             else if (b.Text == ".")
  699.             {
  700.                 if (!lblCash.Text.Contains("."))
  701.                 {
  702.                     lblCash.Text = lblCash.Text + b.Text;
  703.                 }
  704.             }
  705.             else
  706.                 lblCash.Text = lblCash.Text + b.Text;
  707.         }
  708.  
  709.         private void btnC_Click(object sender, EventArgs e)
  710.         {
  711.             lblCash.Text = "0";
  712.         }
  713.  
  714.         private void btnPay_Click(object sender, EventArgs e)
  715.         {
  716.             if (cboPayment.Text == "Cash")
  717.             {
  718.                 Change();
  719.             }
  720.             else
  721.             {
  722.                 lblChange.Text = "";
  723.                 lblCash.Text = "0";
  724.             }
  725.         }
  726.  
  727.         private void btnRemoveItem_Click(object sender, EventArgs e)
  728.         {
  729.             foreach(DataGridViewRow row in this.dataGridView1.SelectedRows)
  730.             {
  731.                 dataGridView1.Rows.Remove(row);
  732.             }
  733.             AddCost();
  734.             if (cboPayment.Text == "Cash")
  735.             {
  736.                 Change();
  737.             }
  738.             else
  739.             {
  740.                 lblChange.Text = "";
  741.                 lblCash.Text = "0";
  742.             }
  743.         }
  744.  
  745.         private void button24_Click(object sender, EventArgs e)
  746.         {
  747.             Double CostifItem = 12000;
  748.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  749.             {
  750.                 if ((bool)(row.Cells[0].Value = "button24"))
  751.                 {
  752.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  753.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  754.                 }
  755.             }
  756.             dataGridView1.Rows.Add("Bread and Ice Cream""1", CostifItem);
  757.             AddCost();
  758.         }
  759.  
  760.         private void button23_Click(object sender, EventArgs e)
  761.         {
  762.             Double CostifItem = 25000;
  763.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  764.             {
  765.                 if ((bool)(row.Cells[0].Value = "button23"))
  766.                 {
  767.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  768.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  769.                 }
  770.             }
  771.             dataGridView1.Rows.Add("Fried Chicken""1", CostifItem);
  772.             AddCost();
  773.         }
  774.  
  775.         private void button22_Click(object sender, EventArgs e)
  776.         {
  777.             Double CostifItem = 25000;
  778.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  779.             {
  780.                 if ((bool)(row.Cells[0].Value = "button22"))
  781.                 {
  782.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  783.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  784.                 }
  785.             }
  786.             dataGridView1.Rows.Add("Hamburger""1", CostifItem);
  787.             AddCost();
  788.         }
  789.  
  790.         private void button36_Click(object sender, EventArgs e)
  791.         {
  792.             Double CostifItem = 15000;
  793.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  794.             {
  795.                 if ((bool)(row.Cells[0].Value = "button36"))
  796.                 {
  797.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  798.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  799.                 }
  800.             }
  801.             dataGridView1.Rows.Add("Lasagna""1", CostifItem);
  802.             AddCost();
  803.         }
  804.  
  805.         private void button35_Click(object sender, EventArgs e)
  806.         {
  807.             Double CostifItem = 12000;
  808.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  809.             {
  810.                 if ((bool)(row.Cells[0].Value = "button35"))
  811.                 {
  812.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  813.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  814.                 }
  815.             }
  816.             dataGridView1.Rows.Add("Donuts""1", CostifItem);
  817.             AddCost();
  818.         }
  819.  
  820.         private void button34_Click(object sender, EventArgs e)
  821.         {
  822.             Double CostifItem = 50000;
  823.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  824.             {
  825.                 if ((bool)(row.Cells[0].Value = "button34"))
  826.                 {
  827.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  828.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  829.                 }
  830.             }
  831.             dataGridView1.Rows.Add("Gnocci""1", CostifItem);
  832.             AddCost();
  833.         }
  834.  
  835.         private void button21_Click(object sender, EventArgs e)
  836.         {
  837.             Double CostifItem = 50000;
  838.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  839.             {
  840.                 if ((bool)(row.Cells[0].Value = "button21"))
  841.                 {
  842.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  843.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  844.                 }
  845.             }
  846.             dataGridView1.Rows.Add("Birthday Cake""1", CostifItem);
  847.             AddCost();
  848.         }
  849.  
  850.         private void button20_Click(object sender, EventArgs e)
  851.         {
  852.             Double CostifItem = 12000;
  853.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  854.             {
  855.                 if ((bool)(row.Cells[0].Value = "button20"))
  856.                 {
  857.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  858.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  859.                 }
  860.             }
  861.             dataGridView1.Rows.Add("Snacks""1", CostifItem);
  862.             AddCost();
  863.         }
  864.  
  865.         private void button19_Click(object sender, EventArgs e)
  866.         {
  867.             Double CostifItem = 12000;
  868.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  869.             {
  870.                 if ((bool)(row.Cells[0].Value = "button19"))
  871.                 {
  872.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  873.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  874.                 }
  875.             }
  876.             dataGridView1.Rows.Add("Lemonade""1", CostifItem);
  877.             AddCost();
  878.         }
  879.  
  880.         private void button33_Click(object sender, EventArgs e)
  881.         {
  882.             Double CostifItem = 50000;
  883.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  884.             {
  885.                 if ((bool)(row.Cells[0].Value = "button33"))
  886.                 {
  887.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  888.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  889.                 }
  890.             }
  891.             dataGridView1.Rows.Add("Ratatouille""1", CostifItem);
  892.             AddCost();
  893.         }
  894.  
  895.         private void button32_Click(object sender, EventArgs e)
  896.         {
  897.             Double CostifItem = 25000;
  898.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  899.             {
  900.                 if ((bool)(row.Cells[0].Value = "button32"))
  901.                 {
  902.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  903.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  904.                 }
  905.             }
  906.             dataGridView1.Rows.Add("Lasagna""1", CostifItem);
  907.             AddCost();
  908.         }
  909.  
  910.         private void button31_Click(object sender, EventArgs e)
  911.         {
  912.             Double CostifItem = 95000;
  913.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  914.             {
  915.                 if ((bool)(row.Cells[0].Value = "button31"))
  916.                 {
  917.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  918.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  919.                 }
  920.             }
  921.             dataGridView1.Rows.Add("Rainbow Cake""1", CostifItem);
  922.             AddCost();
  923.         }
  924.  
  925.         private void button18_Click(object sender, EventArgs e)
  926.         {
  927.             Double CostifItem = 12000;
  928.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  929.             {
  930.                 if ((bool)(row.Cells[0].Value = "button18"))
  931.                 {
  932.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  933.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  934.                 }
  935.             }
  936.             dataGridView1.Rows.Add("Cheese Toast""1", CostifItem);
  937.             AddCost();
  938.         }
  939.  
  940.         private void button17_Click(object sender, EventArgs e)
  941.         {
  942.             Double CostifItem = 15000;
  943.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  944.             {
  945.                 if ((bool)(row.Cells[0].Value = "button17"))
  946.                 {
  947.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  948.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  949.                 }
  950.             }
  951.             dataGridView1.Rows.Add("Strawberry Juice""1", CostifItem);
  952.             AddCost();
  953.         }
  954.  
  955.         private void button16_Click(object sender, EventArgs e)
  956.         {
  957.             Double CostifItem = 25000;
  958.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  959.             {
  960.                 if ((bool)(row.Cells[0].Value = "button16"))
  961.                 {
  962.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  963.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  964.                 }
  965.             }
  966.             dataGridView1.Rows.Add("Orange Juice""1", CostifItem);
  967.             AddCost();
  968.         }
  969.  
  970.         private void button30_Click(object sender, EventArgs e)
  971.         {
  972.             Double CostifItem = 32000;
  973.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  974.             {
  975.                 if ((bool)(row.Cells[0].Value = "button30"))
  976.                 {
  977.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  978.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  979.                 }
  980.             }
  981.             dataGridView1.Rows.Add("Pasta""1", CostifItem);
  982.             AddCost();
  983.         }
  984.  
  985.         private void button29_Click(object sender, EventArgs e)
  986.         {
  987.             Double CostifItem = 25000;
  988.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  989.             {
  990.                 if ((bool)(row.Cells[0].Value = "button29"))
  991.                 {
  992.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  993.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  994.                 }
  995.             }
  996.             dataGridView1.Rows.Add("Mushroom Pie""1", CostifItem);
  997.             AddCost();
  998.         }
  999.  
  1000.         private void button28_Click(object sender, EventArgs e)
  1001.         {
  1002.             Double CostifItem = 50000;
  1003.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1004.             {
  1005.                 if ((bool)(row.Cells[0].Value = "button28"))
  1006.                 {
  1007.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1008.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1009.                 }
  1010.             }
  1011.             dataGridView1.Rows.Add("Pizza""1", CostifItem);
  1012.             AddCost();
  1013.         }
  1014.  
  1015.         private void button15_Click(object sender, EventArgs e)
  1016.         {
  1017.             Double CostifItem = 32000;
  1018.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1019.             {
  1020.                 if ((bool)(row.Cells[0].Value = "button15"))
  1021.                 {
  1022.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1023.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1024.                 }
  1025.             }
  1026.             dataGridView1.Rows.Add("Soup""1", CostifItem);
  1027.             AddCost();
  1028.         }
  1029.  
  1030.         private void button14_Click(object sender, EventArgs e)
  1031.         {
  1032.             Double CostifItem = 25000;
  1033.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1034.             {
  1035.                 if ((bool)(row.Cells[0].Value = "button14"))
  1036.                 {
  1037.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1038.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1039.                 }
  1040.             }
  1041.             dataGridView1.Rows.Add("Salad""1", CostifItem);
  1042.             AddCost();
  1043.         }
  1044.  
  1045.         private void button13_Click(object sender, EventArgs e)
  1046.         {
  1047.             Double CostifItem = 15000;
  1048.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1049.             {
  1050.                 if ((bool)(row.Cells[0].Value = "button13"))
  1051.                 {
  1052.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1053.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1054.                 }
  1055.             }
  1056.             dataGridView1.Rows.Add("Tea""1", CostifItem);
  1057.             AddCost();
  1058.         }
  1059.  
  1060.         private void button27_Click(object sender, EventArgs e)
  1061.         {
  1062.             Double CostifItem = 12000;
  1063.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1064.             {
  1065.                 if ((bool)(row.Cells[0].Value = "button27"))
  1066.                 {
  1067.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1068.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1069.                 }
  1070.             }
  1071.             dataGridView1.Rows.Add("Mocca Donuts""1", CostifItem);
  1072.             AddCost();
  1073.         }
  1074.  
  1075.         private void button26_Click(object sender, EventArgs e)
  1076.         {
  1077.             Double CostifItem = 12000;
  1078.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1079.             {
  1080.                 if ((bool)(row.Cells[0].Value = "button26"))
  1081.                 {
  1082.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1083.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1084.                 }
  1085.             }
  1086.             dataGridView1.Rows.Add("Bread and Cream""1", CostifItem);
  1087.             AddCost();
  1088.         }
  1089.  
  1090.         private void button25_Click(object sender, EventArgs e)
  1091.         {
  1092.             Double CostifItem = 12000;
  1093.             foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
  1094.             {
  1095.                 if ((bool)(row.Cells[0].Value = "button25"))
  1096.                 {
  1097.                     row.Cells[1].Value = Double.Parse((string)row.Cells[1].Value + 1);
  1098.                     row.Cells[2].Value = Double.Parse((string)row.Cells[1].Value) * CostifItem;
  1099.                 }
  1100.             }
  1101.             dataGridView1.Rows.Add("Salty Snacks""1", CostifItem);
  1102.             AddCost();
  1103.         }
  1104.  
  1105.         private void lblSubTotal_Click(object sender, EventArgs e)
  1106.         {
  1107.  
  1108.         }
  1109.     }
  1110. }


Comments

Popular posts from this blog

tugas pbo

TICKET MACHINE