Example #1
0
 private void UpdateDisplayedProfessionCategories()
 {
     DisplayedProfessionCategories = new ObservableCollection <ProfessionCategory>(ProfessionCategories.Where(p => SearchAssistant.GetSearchAction(p.NameProfessionCategory, NameProfessionCategory, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
Example #2
0
 private void UpdateDisplayedProfessions()
 {
     DisplayedProfessions = new ObservableCollection <Profession>(Professions.Where(p => SearchAssistant.GetSearchAction(p.ProfessionName, ProfessionName, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
 private void UpdateDisplayedSubIndustries()
 {
     DisplayedSubIndustries = new ObservableCollection <SubIndustry>(SubIndustries.Where(s => SearchAssistant.GetSearchAction(s.NameSubIndustry, NameSubIndustry, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
 private bool IsInformationCorrect(object information)
 {
     return(SearchAssistant.GetSearchAction(GetTextInformation(information), SearchLine, SearchAssistant.SearchType.AllCriteria).Invoke());
 }
Example #5
0
 private void UpdateDisplayedOrganizations()
 {
     DisplayedOrganizations = new ObservableCollection <v_organizationWithoutPhoto>(Organizations.Where(o => SearchAssistant.GetSearchAction(o.OrganizationName, OrganizationName, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
 private void UpdateDisplayedIndustries()
 {
     DisplayedIndustries = new ObservableCollection <Industry>(Industries.Where(i => SearchAssistant.GetSearchAction(i.IndustryName, IndustryName, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
Example #7
0
 private void UpdateDisplayedBranches()
 {
     DisplayedBranches = new ObservableCollection <v_branchSimplifiedInformation>(Branches.Where(b => SearchAssistant.GetSearchAction(b.Address, Address, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
 private void UpdateDisplayedStreets()
 {
     DisplayedStreets = new ObservableCollection <Street>(Streets.Where(s => SearchAssistant.GetSearchAction(s.StreetName, StreetName, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
 private void UpdateDisplayedCities()
 {
     DisplayedCities = new ObservableCollection <City>(Cities.Where(c => SearchAssistant.GetSearchAction(c.CityName, CityName, SearchAssistant.SearchType.Contains).Invoke()).Take(15).ToList());
 }
        void SearchExecute()
        {
            try
            {
                _searchresults.Clear();
                DrawingsDataContext  dc    = DBCommon.NewDC;
                IQueryable <Drawing> query = dc.Drawings;

                if (!String.IsNullOrEmpty(DrawingNumber))
                {
                    if (IncludeLegacyNumbers)
                    {
                        query = query.Where(d => d.Number.Contains(DrawingNumber) || d.LegacyDrawing.Contains(DrawingNumber));
                    }
                    else
                    {
                        query = query.Where(d => d.Number.Contains(DrawingNumber));
                    }
                }
                if (!String.IsNullOrEmpty(ProjectTitle))
                {
                    query = query.Where(SearchAssistant.SearchText(ProjectTitle, SearchType, d => d.ProjectTitle));
                }
                if (ElectronicOnly)
                {
                    query = query.Where(d => d.Electronic == true);
                }
                if (NonElectronicOnly)
                {
                    query = query.Where(d => d.Electronic == false);
                }
                if (SearchAllTitles)
                {
                    if (!String.IsNullOrEmpty(Title1))
                    {
                        query = query.Where(SearchAssistant.SearchText(Title1, SearchType, d => d.TitleLine1, d => d.TitleLine2, d => d.TitleLine3));
                    }
                }
                else
                {
                    if (!String.IsNullOrEmpty(Title1))
                    {
                        query = query.Where(SearchAssistant.SearchText(Title1, SearchType, d => d.TitleLine1));
                    }
                    if (!String.IsNullOrEmpty(Title2))
                    {
                        query = query.Where(SearchAssistant.SearchText(Title2, SearchType, d => d.TitleLine2));
                    }
                    if (!String.IsNullOrEmpty(Title3))
                    {
                        query = query.Where(SearchAssistant.SearchText(Title3, SearchType, d => d.TitleLine3));
                    }
                }
                if (!CategoryAll)
                {
                    Expression <Func <Drawing, bool> > w = (d => d.Category == DrawingCategory.Undefined);

                    if (CategoryCommunications)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.Communications);
                    }
                    if (CategoryGXPSubstation)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.GxpSubstation);
                    }
                    if (CategoryMiscellaneous)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.Miscellaneous);
                    }
                    if (CategoryOverhead)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.Overhead);
                    }
                    if (CategoryUnderground)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.Underground);
                    }
                    if (CategoryZoneSubstation)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.ZoneSubstation);
                    }
                    if (CategoryGeneration)
                    {
                        w = w.OrElse(d => d.Category == DrawingCategory.Generation);
                    }

                    query = query.Where(w);
                }
                if (!StatusAll)
                {
                    Expression <Func <Drawing, bool> > w = (d => d.Status == DrawingStatus.Undefined);

                    if (StatusSuperseded)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.Superseded);
                    }
                    if (StatusPlanned)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.Planned);
                    }
                    if (StatusCancelled)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.Canceled);
                    }
                    if (StatusAsBuilt)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.AsBuilt);
                    }
                    if (StatusCurrent)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.Current);
                    }
                    if (StatusDraft)
                    {
                        w = w.OrElse(d => d.Status == DrawingStatus.Draft);
                    }
                    query = query.Where(w);
                }
                if (SearchDateRange)
                {
                    query = query.Where(d => d.DrawnDate > StartDate && d.DrawnDate < EndDate);
                }

                foreach (Drawing d in query.ToList())
                {
                    _searchresults.Add(d);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #11
0
 private void UpdateDisplayedOrganizations()
 {
     DisplayedOrganizations = new ObservableCollection <v_organizationWithoutPhoto>(Organizations.Where(o =>
                                                                                                        SearchAssistant.GetSearchAction(o.OrganizationName, OrganizationName, SearchAssistant.SearchType.Contains).Invoke() &&
                                                                                                        (SelectedIdIndustry != null ? o.IdIndustry == (int)SelectedIdIndustry : true) &&
                                                                                                        (SelectedIdSubIndustry != null ? o.IdSubIndustry == (int)SelectedIdSubIndustry : true)).Take(15).ToList());
 }