Exemplo n.º 1
0
 private void UniversalResetClicked(object sender, RoutedEventArgs e)
 {
     ShowProgress();
     gridViewSource.Source   = mainItemList;
     UniversalSearchBox.Text = "";
     UniversalSearchBox.Focus(FocusState.Keyboard);
     HideProgress();
     RecordGrid.SelectedItem = null;
 }
Exemplo n.º 2
0
        private void search()
        {
            ShowProgress();
            bool addedFlag = false;

            resultList = new List <AnalysisSampleDataItem>();
            String searchQuery = UniversalSearchBox.Text;

            if (!searchQuery.Equals(""))
            {
                foreach (AnalysisSampleDataItem item in mainItemList)
                {
                    if (item.Name.ToLower().Contains(searchQuery))
                    {
                        resultList.Add(item);
                        continue;
                    }
                    if (item.City.ToLower().Contains(searchQuery))
                    {
                        resultList.Add(item);
                        continue;
                    }

                    if (item.State.ToLower().Contains(searchQuery))
                    {
                        resultList.Add(item);
                        continue;
                    }

                    if (item.Occupation.ToLower().Contains(searchQuery))
                    {
                        resultList.Add(item);
                        continue;
                    }

                    foreach (string disease in item.Diseases.Values)
                    {
                        if (disease.ToLower().Contains(searchQuery))
                        {
                            resultList.Add(item);
                            addedFlag = true;
                            break;
                        }
                    }

                    if (addedFlag)
                    {
                        continue;
                    }

                    foreach (string allergy in item.Allergy)
                    {
                        if (allergy.ToLower().Contains(searchQuery))
                        {
                            resultList.Add(item);
                            addedFlag = true;
                            break;
                        }
                    }
                    if (addedFlag)
                    {
                        continue;
                    }

                    foreach (string addiction in item.Addiction)
                    {
                        if (addiction.ToLower().Contains(searchQuery))
                        {
                            resultList.Add(item);
                            addedFlag = true;
                            break;
                        }
                    }
                    if (addedFlag)
                    {
                        continue;
                    }

                    foreach (string vaccine in item.Vaccines.Values)
                    {
                        if (vaccine.ToLower().Contains(searchQuery))
                        {
                            resultList.Add(item);
                            addedFlag = true;
                            break;
                        }
                    }
                    if (addedFlag)
                    {
                        continue;
                    }

                    foreach (string operation in item.Operation)
                    {
                        if (operation.ToLower().Contains(searchQuery))
                        {
                            resultList.Add(item);
                            addedFlag = true;
                            break;
                        }
                    }
                    if (addedFlag)
                    {
                        continue;
                    }
                }
                gridViewSource.Source = resultList;
                UniversalSearchBox.Focus(FocusState.Keyboard);
                RecordGrid.SelectedItem = null;
            }
            HideProgress();
        }