private void buttonAddCust_Click(object sender, EventArgs e) { bool refresh = false; using (MakeCustomer newCustForm = new MakeCustomer(this)) { if (newCustForm.ShowDialog() == DialogResult.OK) { refresh = true; } } if (refresh) { refreshData(); } }
private void buttonModifyCust_Click(object sender, EventArgs e) { bool refresh = false; DataGridViewRow row = customerDataGridView.SelectedRows[0]; int customerId = Convert.ToInt32(row.Cells["custDgvCustId"].Value); using (MakeCustomer modifyCustomerForm = new MakeCustomer(this, customerId)) { if (modifyCustomerForm.ShowDialog() == DialogResult.OK) { refresh = true; } } if (refresh) { refreshData(); } }