public async Task <IActionResult> Delete(string jobPositionId, string returnUrl = null, string returnUrlFail = null)
        {
            var userId = _userManager.GetUserId(HttpContext.User);

            try
            {
                await _jobPositionService.RemoveJobPosition(jobPositionId, userId);

                TempData["Success"] = _stringLocalizer["Successfully deleted."].ToString();
                return(RedirectToLocal(returnUrl));
            }
            catch (CustomRecruiterException ex)
            {
                TempData["Error"] = ex.Message;
            }

            if (returnUrlFail != null)
            {
                return(RedirectToLocal(returnUrlFail));
            }
            return(RedirectToLocal(returnUrl));
        }
Example #2
0
 public string RemoveJobPosition(long periodId, long jobPositionId)
 {
     jobPositionService.RemoveJobPosition(new PeriodId(periodId), new SharedJobPositionId(jobPositionId));
     return("JobPosition with Id " + jobPositionId + " removed");
 }