コード例 #1
0
        private void btn_treat_Click(object sender, EventArgs e)
        {
            //Display complete and detailed list of all elements in order
            //Only one item can be chosen at a time for edit
            foreach (ListViewItem item in listView_active.Items)
            {
                if (item.Selected)
                {
                    //Find index
                    int order_id = Int32.Parse(item.Text);
                    label7.Text = "";

                    //Find order
                    Order treat_order = db.List_of_orders.Find(a => a.OrderID == order_id);
                    int   index       = db.List_of_orders.FindIndex(a => a.OrderID == order_id);
                    order = treat_order;

                    //Set flag for view
                    Order_debug.billingFlag = true;
                    this.Hide();
                    Order_debug billing = new Order_debug(db, treat_order);
                    billing.ShowDialog();

                    //Update order in db
                    db.UpdateOrder(order, index);

                    if (order.State == "Passive")
                    {
                        //Update count of each element in stock
                        db.UpdateStock_onOrder(order);
                    }
                    //refresh display
                    Display1();
                    break;
                }
                else if (listView_active.SelectedItems.Count == 0)
                {
                    label7.ForeColor = Color.Red;
                    label7.Text      = "You have not selected an item !";
                    break;
                }
            }


            //Generate pdf also?
        }
コード例 #2
0
        private void btn_Delete_recap_Click(object sender, EventArgs e)
        {
            Order_debug debug = new Order_debug(db, order);

            debug.Show();
        }