private bool ConfigProjectsLibsFilter(object item)
        {
            if (string.IsNullOrEmpty(ProjectNameFilter) &&

                ConfigAreaView.Cast <ConfigArea>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigAreaView.SourceCollection.Cast <ConfigArea>().ToList().Count()
                )
            {
                return(true);
            }
            else
            {
                if ((string.IsNullOrEmpty(ProjectNameFilter) || ((ConfigProjectsLib)item).ProjectName.ToLower().Contains(ProjectNameFilter.ToLower()))
                    &&
                    (
                        ConfigAreaView.Cast <ConfigArea>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigAreaView.SourceCollection.Cast <ConfigArea>().ToList().Count() ||
                        ConfigProjectCollection.Join((ConfigAreaView.Cast <ConfigArea>().Where(e => e.Selected.Equals(true))).ToList(), cp => cp.ConfigAreaID, ca => ca.ID, (cp, ca) => cp).Where(cp => cp.ConfigProjectLibID.Equals(((ConfigProjectsLib)item).Id)).ToList().Count() > 0
                    )
                    )


                {
                    return(true);
                }
                return(false);
            }
        }
        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 AreaSelectionChange(object obj)
 {
     if (ConfigAreaView.Cast <ConfigArea>().ToList().Where(e => e.Selected.Equals(true)).Count() == ConfigAreaView.SourceCollection.Cast <ConfigArea>().ToList().Count())
     {
         AllAreasSelected = true;
     }
     else
     {
         AllAreasSelected = 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);
            }
        }