private void menuItemSearchPatientId_Click(object sender, System.EventArgs e) { decimal patientId = decimal.Zero; try { patientId = Convert.ToDecimal(this.richTextBox.SelectedText); } catch(Exception) { MessageBox.Show("The patient id must be numeric!", "No valid patient id!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //invoke event PatientIdEventArgs eventArgs = new PatientIdEventArgs(patientId); OnSearchPatientId(eventArgs); }
protected virtual void OnSearchPatientId(PatientIdEventArgs e) { if (SearchPatientId != null) { // Invokes the delegates. SearchPatientId(this, e); } }
protected virtual void OnImportPatient(PatientIdEventArgs e) { if (ImportPatient != null) ImportPatient(this, e); }
protected virtual void OnSearchPatientId(PatientIdEventArgs e) { if (SearchPatientId != null) SearchPatientId(this, e); }
void SearchPatientId(object sender, PatientIdEventArgs e) { this.m_searchWindow.PatientId = e.PatientId; this.m_searchWindow.Show(this.dockPanel); this.m_searchWindow.DoSearch(); }