Exemplo n.º 1
0
        //print
        private void btn_logout_Click(object sender, EventArgs e)
        {
            //  MessageBox.Show(updatemode.ToString());
            if (dataGridView_cart.Rows.Count > 0)
            {
                ShowCartTotal();
                gridviewDataIntoDb();
                loadOrderDetails();
                //this.Close();
                //Set Receipt data
                List <Receipt> order;
                order = LoadReceiptData();
                SessionData.setBillamount();

                Billprint bill = new Billprint(order, SessionData.lastbillamout, SessionData.tabel, 1);
                // bill.print("CASHIER");
                bill.print(bilprinter);
                order.Clear();
                btn_logout.Enabled = false;
            }
            else
            {
                MessageBox.Show("No order selected. Please select an order first.",
                                "Print information", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void btn_take_away_Click(object sender, EventArgs e)
        {
            SessionData.SetSeviceCharge(0);
            SessionData.SetTabelDetails("TAKEAWAY");
            if (SessionData.cartTotal > 1)
            {
                Form_Pay frmpay = new Form_Pay();
                frmpay.ShowDialog();

                if (paymentDone)
                {
                    createOrder(2);
                    gridviewDataIntoDb();
                    updateOrder();

                    // if (SessionData.paymentType.Equals(1))
                    // {
                    //save card details
                    saveCardDetails();
                    List <Receipt> order;
                    order = LoadReceiptData();
                    SessionData.setBillamount();



                    Billprint bill = new Billprint(order, cash, SessionData.lastbillamout, SessionData.tabel, balance);
                    //  bill.print("CASHIER");
                    bill.print(bilprinter);
                    order.Clear();
                    // }
                    resetAll();
                }
            }
        }
Exemplo n.º 3
0
        private void btn_pay_Click(object sender, EventArgs e)
        {
            Form_Pay frmpay = new Form_Pay();

            frmpay.ShowDialog();

            if (paymentDone)
            {
                if (SessionData.paymentType.Equals(1))
                {
                    //save card details
                    saveCardDetails();
                    updateOrder();
                    //Set Receipt data
                    List <Receipt> order;
                    order = LoadReceiptData();
                    SessionData.setBillamount();

                    Billprint bill = new Billprint(order, cash, SessionData.lastbillamout, SessionData.tabel, balance);
                    // bill.print("CASHIER");
                    bill.print(bilprinter);
                    bill = null;
                    order.Clear();
                }
                else
                {
                    //cash payment
                    updateOrder();
                    //Set Receipt data
                    List <Receipt> order;
                    order = LoadReceiptData();
                    SessionData.setBillamount();

                    Billprint bill = new Billprint(order, cash, SessionData.lastbillamout, SessionData.tabel, balance);
                    // bill.print("CASHIER");
                    bill.print(bilprinter);
                    bill = null;
                    order.Clear();
                }
                resetAll();

                btn_save.Visible      = false;
                btn_dine_in.Visible   = true;
                btn_take_away.Enabled = true;
                btn_pay.Enabled       = false;
            }
        }