Exemple #1
0
        public IActionResult ChangeStatus(Guid jobPositionId, JobPositionStatus selectedStatus)
        {
            try
            {
                jobPositionAppService.ChangeStatus(CurrentUserId, jobPositionId, selectedStatus);

                string url = Url.Action("Index", "JobPosition", new { area = "Work" });

                return(Json(new OperationResultRedirectVo(url)));
            }
            catch (Exception ex)
            {
                return(Json(new OperationResultVo(ex.Message)));
            }
        }
        public OperationResultVo ChangeStatus(Guid currentUserId, Guid jobPositionId, JobPositionStatus selectedStatus)
        {
            try
            {
                JobPosition jobPosition = jobPositionDomainService.GetById(jobPositionId);

                if (jobPosition == null)
                {
                    return(new OperationResultVo("Idea not found!"));
                }

                jobPosition.Status = selectedStatus;

                jobPositionDomainService.Update(jobPosition);

                unitOfWork.Commit();

                return(new OperationResultVo(true));
            }
            catch (Exception ex)
            {
                return(new OperationResultVo(ex.Message));
            }
        }