private void button_newOrder_Click(object sender, EventArgs e) { NewOrderForm newOrderForm = new NewOrderForm(new Order()); if (newOrderForm.ShowDialog() == DialogResult.OK) { orderService.AddOrder(newOrderForm.currentOrder); QueryAll(); } }
private void EditOrder() { Order order = orderBindingSource.Current as Order; if (order == null) { MessageBox.Show("请选择一个订单进行修改"); return; } NewOrderForm form2 = new NewOrderForm(order); if (form2.ShowDialog() == DialogResult.OK) { orderService.UpdateOrder(form2.currentOrder); QueryAll(); } }