private void btnEdit_Click(object sender, EventArgs e) { if (this.dgvDiagnosis.SelectedRows.Count == 0) { MessageBox.Show(this, Resources.DiagnosisForm_btnEdit_Click_Please_select_a_diagnosis_to_edit, Resources.DiagnosisForm_btnEdit_Click_Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { var diagnosis = (Diagnosis) this.dgvDiagnosis.SelectedRows[0].DataBoundItem; var editDiagnosis = new AddEditDiagnosisForm(diagnosis); editDiagnosis.ShowDialog(); this.updateTable(); } catch (Exception exc) { this.handleError(exc); } } }
private void btnAdd_Click(object sender, EventArgs e) { var addDiagnosis = new AddEditDiagnosisForm(this.appt.AppointmentId); addDiagnosis.ShowDialog(); this.updateTable(); }