Exemple #1
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            FormAdd form2 = new FormAdd(new Order());

            if (form2.ShowDialog() == DialogResult.OK)
            {
                orderService.AddOrder(form2.CurrentOrder);
                QueryAll();
            }
        }
Exemple #2
0
        private void EditOrder()
        {
            Order order = bindingSourceOrder.Current as Order;

            if (order == null)
            {
                MessageBox.Show("请选择一个订单进行修改");
                return;
            }
            FormAdd form2 = new FormAdd(order, true);

            if (form2.ShowDialog() == DialogResult.OK)
            {
                orderService.UpdateOrder(form2.CurrentOrder);
                QueryAll();
            }
        }