private void btnAddNewCustomer_Click(object sender, EventArgs e) { frmAddOrEditCustomer frmAddOrEditCustomer = new frmAddOrEditCustomer(); if (frmAddOrEditCustomer.ShowDialog() == 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()); frmAddOrEditCustomer frmAddOrEdit = new frmAddOrEditCustomer(); frmAddOrEdit.customerId = customerId; if (frmAddOrEdit.ShowDialog() == DialogResult.OK) { BindGrid(); } } }