Exemplo n.º 1
0
        // ---------------------------------------------------------------------
        // Confirms the user's card is valid and creates a tangiable order
        // to be used on the kitchen form and sends info to the SQL server.
        // ---------------------------------------------------------------------
        private void btnPay_Click(object sender, EventArgs e)
        {
            if (ConfirmCard())
            {
                List <string> order = lstVw_cartSummary.Items.Cast <ListViewItem>()
                                      .Select(item => item.Text).ToList();
                foreach (string s in order)
                {
                    if (!s.Contains('+'))
                    {
                        orderController.processOrderSQL(s);
                    }
                }

                OrderController.saveOrderSQL(orderController.getCurrentOrder());

                orderController.createNewOrder();
                refreshCartSummary();
                categoryBtnBox.Visible = true;
                foreach (Control con in pnl_summary.Controls)
                {
                    con.Visible = true;
                }
                pnl_payment.Visible  = false;
                pnl_summary.Location = new Point(categoryBtnBox.Location.X + categoryBtnBox.Width, categoryBtnBox.Location.Y);



                lstVw_cartSummary.Width    = (int)(this.Width * ONE_THIRD);
                lstVw_cartSummary.Height   = (int)(this.Height * .60) - CORRECTION * 3;
                lstVw_cartSummary.Location = new Point(0, btn_ArrowUp.Height + btn_ArrowUp.Location.Y + CORRECTION);
                btn_checkout.Visible       = true;
                updateSubTotal(0.0f);
                ClearCard();
            }
        }
Exemplo n.º 2
0
 public OrderForm()
 {
     InitializeComponent();
     centerY = this.Height / 2;
     centerX = this.Width / 2;
     buttonX = (int)(this.Width * .20);
     buttonY = (int)(this.Height * .15);
     smallX  = (int)(this.Width * .10);
     smallY  = (int)(this.Height * .10);
     scaling();
     itemList        = new List <string>();
     orderController = new OrderController();
     itemList        = orderController.getMenuItemNames();
     orderController.createNewOrder();
     load_views();
     load_categories();
     load_items();
     load_options();
     lstVw_cartSummary.Items.Clear();
     txtbox_Item.Location        = new Point(categoryGrpBxList[0].Left, pnl_summary.Top - txtbox_Item.Height);
     txtbox_description.Location = new Point(categoryGrpBxList[0].Right - txtbox_description.Width, pnl_summary.Top - txtbox_description.Height);
     updateSubTotal(0.0f);
     // categoryBtnBox.FlatStyle = FlatStyle.Popup;
 }
Exemplo n.º 3
0
 public KitchenController()
 {
     currentOrders = new List <Order>();
     currentOrders = OrderController.GetOrders();
 }
 // ---------------------------------------------------------------------
 // Contrustor for form controller.
 // Why does form controller exist?
 // Answer: Due to the nature of our program the forms can not simply
 //         manage themselves. On exit, admin form and order form
 //         must be destroyed to correctly maintain the list of items
 //         and list of orders respectively.
 // ---------------------------------------------------------------------
 public FormController(LoginForm log)
 {
     OrderController.createOrdersTableSQL();
     OrderController.getOrdersSQL();
     loginForm = log;
 }