示例#1
0
        //Adds order.orderItems to database and opens order overview
        private void btn_ConfirmOrder_Click(object sender, EventArgs e)
        {
            this.Hide();

            foreach (ListView listView in listViews)
            {
                for (int i = 0; i < listView.Items.Count; i++)
                {
                    int amount = Convert.ToInt32(listView.Items[i].SubItems[1].Text);
                    int ID     = Convert.ToInt32(listView.Items[i].SubItems[2].Text);


                    if (amount >= 1)
                    {
                        Item item = items.Find(j => j.itemID == ID);

                        AddItemToOrder(amount, item, listView.Items[i].SubItems[4].Text);
                    }
                }
            }
            try
            {
                orderItemLogic.AddItemsToOrder(order);
            }
            catch
            {
                order.orderItems.Clear();
                MessageBox.Show("Probleem met het laden van de database. Probeer opnieuw.");
            }

            order.orderItems.Clear();
            orderOverviewUI = new OrderOverviewUI(order, orderMenuUI);
            orderOverviewUI.ShowDialog();
        }
示例#2
0
        private void btn_OrderOverview_Click(object sender, EventArgs e)
        {
            this.Hide();
            OrderOverviewUI orderOverview = new OrderOverviewUI(order, this);

            orderOverview.ShowDialog();
        }