Esempio n. 1
0
        // ---------------------------------------------------------------------
        // Constructor for Order Form
        // Sets several variables that allow the menu to generate for most
        // screen resolutions.
        // ---------------------------------------------------------------------
        public OrderForm()
        {
            InitializeComponent();
            Rectangle screen = Screen.PrimaryScreen.WorkingArea;
            int       w      = screen.Width;
            int       h      = screen.Height;

            this.Location = new Point((screen.Width - w) / HALF, (screen.Height - h) / HALF);
            this.Size     = new Size(w, h);
            centerY       = this.Height / HALF;
            centerX       = this.Width / HALF;
            buttonX       = (int)(this.Width * FIFTEEN_PERCENT);
            buttonY       = (int)(this.Height * FIFTEEN_PERCENT);
            smallX        = (int)(this.Width * TEN_PERCENT);
            smallY        = (int)(this.Height * TEN_PERCENT);
            spacingY      = (int)(this.Height * FIVE_PERCENT);
            spacingX      = (int)(this.Width * FIVE_PERCENT);
            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_description.Location = new Point(categoryGrpBxList[0].Right - txtbox_description.Width, pnl_summary.Top - txtbox_description.Height);
            updateSubTotal(0.0f);
        }
Esempio n. 2
0
        private void btnPay_Click(object sender, EventArgs e)
        {
            List <string> order = lstVw_cartSummary.Items.Cast <ListViewItem>()
                                  .Select(item => item.Text).ToList();

            foreach (string s in order)
            {
                if (!s.Contains('+'))
                {
                    orderController.ProcessOrder(s);
                }
            }

            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.Height = TABLE_Y;
            lstVw_cartSummary.Width  = TABLE_X;
        }
Esempio n. 3
0
 public OrderForm()
 {
     InitializeComponent();
     itemList        = new List <string>();
     orderController = new OrderController();
     itemList        = orderController.getMenuItemNames();
     orderController.createNewOrder();
     load_views();
     load_categories();
     load_items();
     lstVw_cartSummary.Items.Clear();
     txtbox_description.Location = new Point(categoryList[0].Right, pnl_summary.Bottom);
     updateSubTotal(0.0f);
 }
Esempio n. 4
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();
            }
        }
Esempio n. 5
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;
 }