Пример #1
0
 private bool SearchCriteriaEntered()
 {
     if (SurnameSearch != null && SurnameSearch.Trim() != "")
     {
         return(true);
     }
     if (GivenNamesSearch != null && GivenNamesSearch.Trim() != "")
     {
         return(true);
     }
     if (MrnSearch != null && MrnSearch.Trim() != "")
     {
         return(true);
     }
     return(false);
 }
Пример #2
0
        private void search()
        {
            if (SearchCriteriaEntered())
            {
                object           p      = new object();
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += (o, ea) =>
                {
                    List <RetrievalCriteria> criter = new List <RetrievalCriteria>();
                    if (SurnameSearch != null && SurnameSearch.Trim() != "")
                    {
                        RetrievalCriteria rc = new RetrievalCriteria("Surname", CriteraType.TextMatch, SurnameSearch);
                        criter.Add(rc);
                    }
                    if (GivenNamesSearch != null && GivenNamesSearch.Trim() != "")
                    {
                        RetrievalCriteria rc = new RetrievalCriteria("GivenNames", CriteraType.TextMatch, GivenNamesSearch);
                        criter.Add(rc);
                    }
                    if (MrnSearch != null && MrnSearch.Trim() != "")
                    {
                        RetrievalCriteria rc = new RetrievalCriteria("PatientID", CriteraType.TextMatch, MrnSearch);
                        criter.Add(rc);
                    }


                    _patients = DesktopApplication.Librarian.GetItems(typeof(Patient), criter);
                    RaisePropertyChanged("Patients");
                    //ViewModelCollection = Application.GetLibrarian().GetViewModels(typeof(iRadiate.DataModel.HealthCare.Patient), criter);
                };
                worker.RunWorkerCompleted += (o, ea) =>
                {
                    Busy = false;
                };
                Busy = true;
                worker.RunWorkerAsync();
            }
        }