private void addOrder_Click(object sender, EventArgs e) { DetailForm detailForm = new DetailForm(false, 0); detailForm.ShowDialog(); orderBindingSource.ResetBindings(false); }
private void editOrder_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow != null) { int index = orderService.orderList.IndexOf(new Order.Order() { orderNo = (int)dataGridView1.CurrentRow.Cells[0].Value }); DetailForm detailForm = new DetailForm(true, index); detailForm.ShowDialog(); orderBindingSource.ResetBindings(false); } }