private bool CandidatesViewFilter(object item) { if (string.IsNullOrEmpty(FirstNameFilter) && CvUploaded == null && string.IsNullOrEmpty(LastNameFilter) && string.IsNullOrEmpty(PositionNameFilter) && string.IsNullOrEmpty(PhoneNumberFilter) && ConfigProjectsLibsView.Cast <ConfigProjectsLib>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigProjectsLibsView.SourceCollection.Cast <ConfigProjectsLib>().ToList().Count() && ConfigCompanyCollectionView.Cast <ConfigCompany>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigCompanyCollectionView.SourceCollection.Cast <ConfigCompany>().ToList().Count() ) { return(true); } else { if ( (string.IsNullOrEmpty(FirstNameFilter) || (((Candidate)item).FirstName.ToLower()).StartsWith(FirstNameFilter.ToLower())) && (string.IsNullOrEmpty(LastNameFilter) || (((Candidate)item).LastName.ToLower()).StartsWith(LastNameFilter.ToLower())) && (string.IsNullOrEmpty(PhoneNumberFilter) || (((Candidate)item).FirstPhone.ToLower().Trim()).StartsWith(PhoneNumberFilter.ToLower().Trim()) || (((Candidate)item).SecondPhone.ToLower().Trim()).StartsWith(PhoneNumberFilter.ToLower().Trim()) ) && (CvUploaded == null || CvUploaded.Equals(((Candidate)item).CvUploaded)) && ( ( ConfigProjectsLibsView.Cast <ConfigProjectsLib>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigProjectsLibsView.SourceCollection.Cast <ConfigProjectsLib>().ToList().Count() && ConfigAreaView.Cast <ConfigArea>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigAreaView.SourceCollection.Cast <ConfigArea>().ToList().Count() && ConfigCompanyCollectionView.Cast <ConfigCompany>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigCompanyCollectionView.SourceCollection.Cast <ConfigCompany>().ToList().Count() ) || ( ((Candidate)item).CandidateProjects.Join((ConfigProjectsLibsView.Cast <ConfigProjectsLib>().Where(e => e.Selected.Equals(true))).ToList(), cp => cp.ConfigProjectLibID, cpl => cpl.Id, (cp, cpl) => cp.ConfigCandidateID).ToList().Count > 0 && ((Candidate)item).CandidateProjects.Join((ConfigCompanyCollectionView.Cast <ConfigCompany>().Where(e => e.Selected.Equals(true))).ToList(), cc => cc.CompanyId, ccc => ccc.ID, (cc, ccc) => cc).ToList().Count > 0 ) ) && (string.IsNullOrEmpty(PositionNameFilter) || ((Candidate)item).CandidateProjects.Where(e => e.Position.ToLower().Contains(PositionNameFilter.ToLower())).Count() > 0 ) ) { return(true); } return(false); } }
private void CompanySelectionChange(object obj) { if (ConfigCompanyCollectionView.Cast <ConfigCompany>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigCompanyCollectionView.SourceCollection.Cast <ConfigCompany>().ToList().Count()) { AllCompaniesSelected = true; } else { AllCompaniesSelected = false; } }
private void ViewRefresh() { if (ConfigAreaView != null) { ConfigAreaView.Refresh(); } if (ConfigProjectsLibsView != null) { ConfigProjectsLibsView.Refresh(); } if (ConfigCompanyCollectionView != null) { ConfigCompanyCollectionView.Refresh(); } if (CandidatesView != null) { CandidatesView.Refresh(); } }