public static OpenHRPatient ChoosePatient() { using (PatientFindForm patientFindForm = new PatientFindForm(DataStore.OpenHRPatients)) if (patientFindForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { return(patientFindForm.SelectedPatient); } return(null); }
private void OpenPatientRecord() { OpenHRPatient patient = PatientFindForm.ChoosePatient(); if (patient != null) { TabPage previousTabPage = _patientTabPage; _patientTabPage = new PatientTabPage(patient); tcTabControl.TabPages.Insert(0, _patientTabPage); tcTabControl.SelectedTab = _patientTabPage; if (previousTabPage != null) { tcTabControl.TabPages.Remove(previousTabPage); } } }
private void btnBookSlot_Click(object sender, EventArgs e) { OpenHRPatient patient = PatientFindForm.ChoosePatient(); if (patient != null) { Control control = ((sender as ToolStripMenuItem) .WhenNotNull(t => (t.Owner as ContextMenuStrip).WhenNotNull(s => s.SourceControl))); if (control != null) { ClearAndDisposeControls(control.Controls); Control l = CreateBookedPatientControl(patient); Slot slot = control.Tag as Slot; slot.Patient = patient; control.Controls.Add(l); } } }