private void LocalProcesItem(object itm) { if (itm == null) { return; } if (itm.GetType() == typeof(RMSDataAccessLayer.SearchItem)) { switch (((ISearchItem)itm).DisplayName) { case "Add Patient": Patient p = SalesVM.CreateNewEntity <Patient>(); SalesVM.rms.Persons.AddObject(p); ItemEditor.Content = p; break; case "Add Doctor": Doctor d = SalesVM.CreateNewEntity <Doctor>(); SalesVM.rms.Persons.AddObject(d); ItemEditor.Content = d; break; default: ItemEditor.Content = ((RMSDataAccessLayer.SearchItem)itm).SearchObject; break; } } else if (itm.GetType() == typeof(RMSDataAccessLayer.Pass) && ((RMSDataAccessLayer.Pass)itm).Status.Contains("Invalid") == true) { TransStatusTxt.Text = "Invalid Pass"; TransStatusTxt.Focus(); } else { SalesVM.ProcessSearchListItem(itm); MoveToNextControl(ItemEditor); } }
private void LocalProcesItem(object itm) { if (itm == null) { return; } if (edititem == true) { ItemEditor.Content = itm; edititem = false; return; } if (itm.GetType() == typeof(RMSDataAccessLayer.SearchItem)) { switch (((ISearchItem)itm).DisplayName) { case "Add Patient": Patient p = SalesVM.Instance.CreateNewPatient(); // SalesVM.rms.Persons.AddObject(p); ItemEditor.Content = p; break; case "Add Doctor": Doctor d = SalesVM.Instance.CreateNewDoctor(); // SalesVM.rms.Persons.AddObject(d); ItemEditor.Content = d; break; default: ItemEditor.Content = ((RMSDataAccessLayer.SearchItem)itm).SearchObject; break; } } else { if (showPatientPrescriptions == true) { if (itm.GetType() == typeof(RMSDataAccessLayer.Patient)) { ItemEditor.Content = SalesVM.Instance.GetPatientTransactionList(itm as Patient); showPatientPrescriptions = false; } if (itm.GetType() == typeof(RMSDataAccessLayer.Doctor)) { ItemEditor.Content = SalesVM.Instance.GetDoctorTransactionList(itm as Doctor); showPatientPrescriptions = false; } } else { SalesVM.ProcessSearchListItem(itm); MoveToNextControl(ItemEditor); } } }