public bool IsSalaryIsInThisWeight(double baseSalary, double salary, string occupation) { bool isSalaryIsThisWeight = false; double salaryMin = baseSalary * SalaryMin; double salaryMax = baseSalary * SalaryMax; if (SalaryMin.Equals(SalaryMax)) { isSalaryIsThisWeight = salary > salaryMax; } else if (OccupationPositionException.Contains(occupation) || (salary >= salaryMin && salary <= salaryMax)) { isSalaryIsThisWeight = true; } return(isSalaryIsThisWeight); }
private void ProcessApplyCommand() { //Words.Where(w => w.Contains(":")); StringBuilder searchFilter = new StringBuilder(); string filterJoin = string.Empty; var selectedGenderList = new ObservableCollection <SortByEntryCMS>(_genderList.Where(w => w.Selected)); var selectedSortByList = new ObservableCollection <SortByEntryCMS>(_sortByList.Where(w => w.Selected)); var selectedJobTypeList = new ObservableCollection <SortByEntryCMS>(_jobTypeList.Where(w => w.Selected)); var selectedWorkTypeList = new ObservableCollection <SortByEntryCMS>(_workTypeList.Where(w => w.Selected)); var selectedShiftTypeList = new ObservableCollection <SortByEntryCMS>(_shiftTypeList.Where(w => w.Selected)); var selectedTeleWorkingList = new ObservableCollection <SortByEntryCMS>(_teleWorkingList.Where(w => w.Selected)); var selectedRequiredEducationList = new ObservableCollection <SortByEntryCMS>(_requiredEducationList.Where(w => w.Selected)); var selectedTravellingRequiredList = new ObservableCollection <SortByEntryCMS>(_travellingRequiredList.Where(w => w.Selected)); var selectedSpecializationList = new ObservableCollection <SortByEntryCMS>(_specializationList.Where(w => w.Selected)); var selectedPostedSinceList = new ObservableCollection <SortByEntryCMS>(_postedSinceList.Where(w => w.Selected)); if (selectedJobTypeList == null || selectedJobTypeList.Count < 1) { filterJoin = String.Format("JobType eq * and "); searchFilter.Append(filterJoin); } else { foreach (SortByEntryCMS jobType in selectedJobTypeList) { filterJoin = String.Format("JobType eq '{0}' and ", jobType.Value); searchFilter.Append(filterJoin); } } if (selectedGenderList != null && selectedGenderList.Count > 0) { foreach (SortByEntryCMS gender in selectedGenderList) { filterJoin = String.Format("Gender eq '{0}' and ", gender.Value); searchFilter.Append(filterJoin); } } if (selectedSortByList != null && selectedSortByList.Count > 0) { foreach (SortByEntryCMS sortBy in selectedSortByList) { filterJoin = String.Format("SortBy eq '{0}' and ", sortBy.Value); searchFilter.Append(filterJoin); } } if (selectedWorkTypeList != null && selectedWorkTypeList.Count > 0) { foreach (SortByEntryCMS workType in selectedWorkTypeList) { filterJoin = String.Format("WorkTime eq '{0}' and ", workType.Value); searchFilter.Append(filterJoin); } } if (selectedShiftTypeList != null && selectedShiftTypeList.Count > 0) { foreach (SortByEntryCMS shiftType in selectedShiftTypeList) { filterJoin = String.Format("ShiftType eq '{0}' and ", shiftType.Value); searchFilter.Append(filterJoin); } } if (selectedRequiredEducationList != null && selectedRequiredEducationList.Count > 0) { foreach (SortByEntryCMS requiredEducation in selectedRequiredEducationList) { filterJoin = String.Format("Education eq '{0}' and ", requiredEducation.Value); searchFilter.Append(filterJoin); } } if (selectedTravellingRequiredList != null && selectedTravellingRequiredList.Count > 0) { foreach (SortByEntryCMS travellingRequired in selectedTravellingRequiredList) { filterJoin = String.Format("WillegnessToTravel eq '{0}' and ", travellingRequired.Value); searchFilter.Append(filterJoin); } } if (selectedTeleWorkingList != null && selectedTeleWorkingList.Count > 0) { foreach (SortByEntryCMS teleWorking in selectedTeleWorkingList) { filterJoin = String.Format("TeleWorking eq '{0}' and ", teleWorking.Value); searchFilter.Append(filterJoin); } } if (selectedSpecializationList != null && selectedSpecializationList.Count > 0) { foreach (SortByEntryCMS specialization in selectedSpecializationList) { filterJoin = String.Format("Specialization eq '{0}' and ", specialization.Value); searchFilter.Append(filterJoin); } } if (selectedPostedSinceList != null && selectedPostedSinceList.Count > 0) { foreach (SortByEntryCMS postedSince in selectedPostedSinceList) { filterJoin = String.Format("PostedSince eq '{0}' and ", postedSince.Value); searchFilter.Append(filterJoin); } } filterJoin = String.Format("SalaryFrom eq '{0}' and ", SalaryMin.ToString()); searchFilter.Append(filterJoin); filterJoin = String.Format("SalaryTo eq '{0}' and ", SalaryMax.ToString()); searchFilter.Append(filterJoin); if (searchFilter.Length > 0) { searchFilter.Remove(searchFilter.Length - 4, 4); } GlobalSetting.FilterQuery = searchFilter.ToString(); // need to set/store all the options and pass them back to the search page _nav.GoBackAsync(); }