public void InitializeDoctorList() { tabDoctorCards.Controls.Clear(); List <GetBriefQueue_Result> allQueues = null; allQueues = MerkDBBusinessLogicEngine.GetBriefQueue(null, null, null, null); List <IGrouping <int, GetBriefQueue_Result> > groupedByList = allQueues.GroupBy(item => item.DoctorID).ToList(); if (groupedByList.Count == 0) { return; } if (CheckButtonDictionaryList == null) { CheckButtonDictionaryList = new Dictionary <int, QueueManager_DoctorCard_UC>(); } foreach (IGrouping <int, GetBriefQueue_Result> queueResults in groupedByList) { QueueManager_DoctorCard_UC doctorCard = new QueueManager_DoctorCard_UC(); doctorCard.Dock = DockStyle.Right; Doctor_cu doctor = Doctor_cu.ItemsList.Find(item => Convert.ToInt32(item.Person_CU_ID).Equals(Convert.ToInt32(queueResults.Key))); if (doctor == null) { continue; } doctorCard.Initiaize(doctor, this); tabDoctorCards.Controls.Add(doctorCard); CheckButtonDictionaryList.Add(doctor.Person_CU_ID, doctorCard); } }
public void Initiaize(Doctor_cu doctor, QueueManagerContainer_UC parentQueueManagerContainer) { if (doctor == null) { return; } ActiveDoctor = doctor; if (ActiveDoctor != null) { DoctorID = ActiveDoctor.ID; } chkDoctor.Text = ActiveDoctor.Name_P; ParentQueueManagerContainer = parentQueueManagerContainer; chkDoctor.CheckedChanged += ChkDoctorOnCheckedChanged; IsCheckChanged = false; }
public void Initialize() { tabWaitingPatients.Controls.Clear(); tabServedPatients.Controls.Clear(); tabPausedPatients.Controls.Clear(); List <GetBriefQueue_Result> allQueues = null; allQueues = MerkDBBusinessLogicEngine.GetBriefQueue((int?)DoctorID, null, null, null); if (allQueues == null || allQueues.Count == 0) { return; } List <GetBriefQueue_Result> waitingQueue = allQueues.FindAll(item => Convert.ToInt32(item.QueueStatusID).Equals((int)DB_QueueManagerStatus.Waiting)); List <GetBriefQueue_Result> pausedQueue = allQueues.FindAll(item => Convert.ToInt32(item.QueueStatusID).Equals((int)DB_QueueManagerStatus.Paused)); List <GetBriefQueue_Result> servedQueue = allQueues.FindAll(item => Convert.ToInt32(item.QueueStatusID).Equals((int)DB_QueueManagerStatus.Served)); #region waitingQueue if (waitingQueue.Count > 0) { foreach (GetBriefQueue_Result queue in waitingQueue) { InvoiceManagerPatientQueueCard_UC card = new InvoiceManagerPatientQueueCard_UC(); card.Dock = DockStyle.Top; Invoice invoice = DBCommon.GetEntity <Invoice>(queue.InvoiceID); if (invoice == null) { continue; } Patient_cu patient = DBCommon.GetEntity <Patient_cu>(invoice.Patient_CU_ID); if (patient == null) { continue; } InvoiceDetail invoiceDetail = DBCommon.GetEntity <InvoiceDetail>(queue.InvoiceDetailID); if (invoiceDetail == null) { continue; } QueueManager queueManager = DBCommon.GetEntity <QueueManager>(queue.QueueManagerID); if (queueManager == null) { continue; } card.Initialize(this, invoice, patient, invoiceDetail, queueManager, queue.PatientID.ToString(), queue.PatientFullName, queue.DoctorID.ToString(), queue.DoctorFullName, queue.ServiceName, queue.ReservationTime.ToString()); tabWaitingPatients.Controls.Add(card); } } #endregion #region PausedQueue if (pausedQueue.Count > 0) { foreach (GetBriefQueue_Result queue in pausedQueue) { InvoiceManagerPatientQueueCard_UC card = new InvoiceManagerPatientQueueCard_UC(); card.Dock = DockStyle.Top; Invoice invoice = DBCommon.GetEntity <Invoice>(queue.InvoiceID); if (invoice == null) { continue; } Patient_cu patient = DBCommon.GetEntity <Patient_cu>(invoice.Patient_CU_ID); if (patient == null) { continue; } InvoiceDetail invoiceDetail = DBCommon.GetEntity <InvoiceDetail>(queue.InvoiceDetailID); if (invoiceDetail == null) { continue; } QueueManager queueManager = DBCommon.GetEntity <QueueManager>(queue.QueueManagerID); if (queueManager == null) { continue; } card.Initialize(this, invoice, patient, invoiceDetail, queueManager, queue.PatientID.ToString(), queue.PatientFullName, queue.DoctorID.ToString(), queue.DoctorFullName, queue.ServiceName, queue.ReservationTime.ToString()); tabPausedPatients.Controls.Add(card); } } #endregion #region servedQueue if (servedQueue.Count > 0) { foreach (GetBriefQueue_Result queue in servedQueue) { InvoiceManagerPatientQueueCard_UC card = new InvoiceManagerPatientQueueCard_UC(); card.Dock = DockStyle.Top; Invoice invoice = DBCommon.GetEntity <Invoice>(queue.InvoiceID); if (invoice == null) { continue; } Patient_cu patient = DBCommon.GetEntity <Patient_cu>(invoice.Patient_CU_ID); if (patient == null) { continue; } InvoiceDetail invoiceDetail = DBCommon.GetEntity <InvoiceDetail>(queue.InvoiceDetailID); if (invoiceDetail == null) { continue; } QueueManager queueManager = DBCommon.GetEntity <QueueManager>(queue.QueueManagerID); if (queueManager == null) { continue; } card.Initialize(this, invoice, patient, invoiceDetail, queueManager, queue.PatientID.ToString(), queue.PatientFullName, queue.DoctorID.ToString(), queue.DoctorFullName, queue.ServiceName, queue.ReservationTime.ToString()); tabServedPatients.Controls.Add(card); } } #endregion if (DoctorID != null) { Doctor_cu doctor = Doctor_cu.ItemsList.Find(item => Convert.ToInt32(item.Person_CU_ID).Equals(Convert.ToInt32(DoctorID))); if (doctor != null) { tabDoctorName.Text = doctor.Name_P; } } }