Esempio n. 1
0
        private void ResetSearch(IEmployer employer, string savedSearchName)
        {
            // Empty the temporary block list.

            if (employer != null)
            {
                _candidateListsCommand.RemoveAllCandidatesFromBlockList(employer, BlockListType.Temporary);
            }

            EmployerContext.SavedSearchName = savedSearchName;

            if (string.IsNullOrEmpty(savedSearchName))
            {
                EmployerContext.IsNewSearch = true;

                // Determine whether the prompt can be shown just the once.

                var searches = EmployerContext.Searches;
                if (searches == 0)
                {
                    EmployerContext.CanShowHelpPrompt = !HasUnlimitedCredits(employer);
                }

                EmployerContext.Searches = searches + 1;
            }
        }
Esempio n. 2
0
        public ActionResult UnblockAllTemporaryCandidates()
        {
            try
            {
                // Look for the blocklist.

                var employer  = CurrentEmployer;
                var blockList = _candidateBlockListsQuery.GetTemporaryBlockList(employer);

                // Remove candidates.

                var count = _candidateListsCommand.RemoveAllCandidatesFromBlockList(employer, blockList);
                return(Json(new JsonListCountModel {
                    Id = blockList.Id, Count = count
                }));
            }
            catch (UserException ex)
            {
                ModelState.AddModelError(ex, new StandardErrorHandler());
            }

            return(Json(new JsonResponseModel()));
        }