public IActionResult Index() { var model = new RemoveJobPositionBaseModel { RemoveJobPositionInputModel = new RemoveJobPositionInputModel(), AllJobsPositions = this.removeJobService.GetAllJobsPositions(), }; return(this.View(model)); }
public async Task <IActionResult> RemoveJobPosition(RemoveJobPositionBaseModel model) { if (this.ModelState.IsValid) { await this.removeJobService.DeleteJobPosition(model.RemoveJobPositionInputModel.Id); this.TempData["Success"] = MessageConstants.SuccessfullyDeleteJobPosition; return(this.RedirectToAction("Index", "RemoveJobPosition")); } else { this.TempData["Error"] = MessageConstants.InvalidInputModel; return(this.RedirectToAction("Index", "RemoveJobPosition", model)); } }