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