示例#1
0
        public IActionResult Index()
        {
            var model = new RemoveJobPositionBaseModel
            {
                RemoveJobPositionInputModel = new RemoveJobPositionInputModel(),
                AllJobsPositions            = this.removeJobService.GetAllJobsPositions(),
            };

            return(this.View(model));
        }
示例#2
0
        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));
            }
        }