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 ProjectSelectionChange(object obj) { if (ConfigProjectsLibsView.Cast <ConfigProjectsLib>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigProjectsLibsView.SourceCollection.Cast <ConfigProjectsLib>().ToList().Count()) { AllProjectsSelected = true; } else { AllProjectsSelected = false; } }
private void ViewRefresh() { if (ConfigAreaView != null) { ConfigAreaView.Refresh(); } if (ConfigProjectsLibsView != null) { ConfigProjectsLibsView.Refresh(); } if (ConfigCompanyCollectionView != null) { ConfigCompanyCollectionView.Refresh(); } if (CandidatesView != null) { CandidatesView.Refresh(); } }
private bool ConfigCompanyFilter(object item) { if (string.IsNullOrEmpty(CompanyNameFilter) && 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() ) { return(true); } else { if ((string.IsNullOrEmpty(CompanyNameFilter) || ((ConfigCompany)item).Company.ToLower().StartsWith(CompanyNameFilter.ToLower())) && ( ( 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() ) || ConfigProjectCollection. Join((ConfigProjectsLibsView.Cast <ConfigProjectsLib>().Where(e => e.Selected.Equals(true))).ToList(), cp => cp.ConfigProjectLibID, cpl => cpl.Id, (cp, cpl) => cp). Join(ConfigCompanyProjectCollection, cp => cp.ID, ccp => ccp.ProjectID, (cp, ccp) => ccp).ToList().Where(ccp => ccp.CompanyID.Equals(((ConfigCompany)item).ID)).ToList().Count > 0 ) ) { return(true); } return(false); } }