private void btnNewCustomer_Click(object sender, EventArgs e) { frmAddOrEdit frm = new frmAddOrEdit(); if (frm.ShowDialog() == DialogResult.OK) { BindGrid(); } }
private void btnEditCustomer_Click(object sender, EventArgs e) { if (dgCustomers.CurrentRow != null) { int customerId = int.Parse(dgCustomers.CurrentRow.Cells[0].Value.ToString()); frmAddOrEdit frmEdit = new frmAddOrEdit(); frmEdit.customerId = customerId; if (frmEdit.ShowDialog() == DialogResult.OK) { BindGrid(); } } }