Exemplo n.º 1
0
        private void FillLVViewOrder()
        {
            ViewOrders viewOrders = ViewOrders.GetInstances();

            listViewViewOrders.Items.Clear();

            foreach (OrderItem item in viewOrders.changedSortedItems)
            {
                ListViewItem lvItem = new ListViewItem(new string[] { item.MenuProduct.Name, item.Quantity.ToString(), item.Comment });
                lvItem.Tag = item;
                listViewViewOrders.Items.Add(lvItem);
            }
        }
Exemplo n.º 2
0
        private void btn_OrdersDelete_Click(object sender, EventArgs e)
        {
            ViewOrders viewOrders = ViewOrders.GetInstances();

            if (listViewViewOrders.SelectedItems.Count == 0)
            {
                return;
            }

            viewOrders.Delete((OrderItem)listViewViewOrders.SelectedItems[0].Tag);

            FillLVViewOrder();
        }
Exemplo n.º 3
0
        private void btn_OrdersPlus_Click(object sender, EventArgs e)
        {
            ViewOrders viewOrders = ViewOrders.GetInstances();

            if (listViewViewOrders.SelectedItems.Count == 0)
            {
                return;
            }

            OrderItem orderItem = (OrderItem)listViewViewOrders.SelectedItems[0].Tag;

            viewOrders.AddQuantity(orderItem);

            FillLVViewOrder(orderItem);
        }
Exemplo n.º 4
0
        private void btn_OrdersChangeConfirm_Click(object sender, EventArgs e)
        {
            ViewOrders viewOrders = ViewOrders.GetInstances();

            if (btn_OrdersChangeConfirm.Text == "Wijzig")
            {
                btn_OrdersDelete.Show();
                btn_OrdersMinus.Show();
                btn_OrdersPlus.Show();

                btn_OrdersBackCancel.Text    = "Annuleer";
                btn_OrdersChangeConfirm.Text = "Bevestig";
            }
            else if (btn_OrdersChangeConfirm.Text == "Bevestig")
            {
                order_Service.ChangeOrders(viewOrders.ConfirmChanges());
                ShowPanel("ViewOrders");
            }
        }
Exemplo n.º 5
0
        private void FillLVViewOrder(OrderItem orderItem)
        {
            ViewOrders viewOrders   = ViewOrders.GetInstances();
            int        selectedItem = 0;

            listViewViewOrders.Items.Clear();

            foreach (OrderItem item in viewOrders.changedSortedItems)
            {
                ListViewItem lvItem = new ListViewItem(new string[] { item.MenuProduct.Name, item.Quantity.ToString(), item.Comment });
                lvItem.Tag = item;
                listViewViewOrders.Items.Add(lvItem);
            }

            foreach (ListViewItem lvItem in listViewViewOrders.Items)
            {
                if (lvItem.Tag == orderItem)
                {
                    listViewViewOrders.Items[selectedItem].Selected = true;
                    break;
                }
                selectedItem++;
            }
        }
Exemplo n.º 6
0
 public static ViewOrders MakeInstances(List <OrderItem> orderItems)
 {
     return(uniqueInstance = new ViewOrders(orderItems));
 }
Exemplo n.º 7
0
        private void ShowPanel(string panelName)
        {
            // Hide all panels
            HideAllPanels();

            //Show designated panel
            if (panelName == "menu")
            {
                SetTableColors();
                pnl_Menu.Show();
            }
            else if (panelName == "tableMenu")
            {
                pnl_TableMenu.Show();
                lbl_TableNumber.Text = "Tafel: " + TableNumber;

                if (tableButtons[TableNumber - 1].BackColor == Color.Red)
                {
                    btn_TableInUse.Text = "Zet tafel niet bezet";
                }
                else
                {
                    btn_TableInUse.Text = "Zet tafel bezet";
                }
            }
            else if (panelName == "takeOrder")
            {
                pnl_TakeOrder.Show();

                ResetButtons(true);

                cb_Quantity.SelectedIndex = 0;
                OverviewButtomText();
            }
            else if (panelName == "OverviewOrder")
            {
                pnl_OverviewOrder.Show();

                lbl_OrderOverQuantity.Hide();
                btn_AddQuantity.Hide();
                btn_RemoveQuantity.Hide();
                btn_RemoveItem.Hide();

                listViewOrderOverview.Items.Clear();

                foreach (OrderItem item in orderItems)
                {
                    ListViewItem lvItem = new ListViewItem(new string[] { item.MenuProduct.Name, item.Quantity.ToString(), item.Comment });
                    lvItem.Tag = item;
                    listViewOrderOverview.Items.Add(lvItem);
                }
            }
            else if (panelName == "ViewOrders")
            {
                pnl_ViewOrders.Show();

                lbl_OrdersQuantity.Hide();
                btn_OrdersDelete.Hide();
                btn_OrdersMinus.Hide();
                btn_OrdersPlus.Hide();

                btn_OrdersBackCancel.Text    = "Terug";
                btn_OrdersChangeConfirm.Text = "Wijzig";

                orderItems = order_Service.GetOrderItems(TableNumber);

                listViewViewOrders.Items.Clear();

                ViewOrders viewOrders = ViewOrders.MakeInstances(orderItems);

                foreach (OrderItem item in viewOrders.GetSortedItems())
                {
                    ListViewItem lvItem = new ListViewItem(new string[] { item.MenuProduct.Name, item.Quantity.ToString(), item.Comment });
                    lvItem.Tag = item;
                    listViewViewOrders.Items.Add(lvItem);
                }
            }

            //else if (panelName == "....")
            //{
            //    pnl_,,,.Show();
            //}
        }