private void buttonAddAppt_Click(object sender, EventArgs e) { bool refresh = false; using (MakeAppointment newApptForm = new MakeAppointment(this)) { if (newApptForm.ShowDialog() == DialogResult.OK) { refresh = true; } } if (refresh) { refreshData(); } }
private void buttonModifyAppt_Click(object sender, EventArgs e) { bool refresh = false; DataGridViewRow row = appointmentDataGridView.SelectedRows[0]; int apptId = Convert.ToInt32(row.Cells["appointmentId"].Value); using (MakeAppointment modifyApptForm = new MakeAppointment(this, apptId)) { if (modifyApptForm.ShowDialog() == DialogResult.OK) { refresh = true; } } if (refresh) { refreshData(); } }