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);
                }
            }
        }
Esempio n. 2
0
        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);
                }
            }
        }