Пример #1
0
        public ActionResult ApproveTask(Guid?userTaskId)
        {
            if (userTaskId.HasValue)
            {
                UserTask userTask = UserTaskHelpers.GetUserTask(userTaskId.Value);

                switch (userTask.TaskType)
                {
                case TaskTypeEnum.UserOnHold:      //Make AppUser active
                    AppUserHelpers.UpdateEntityStatus(userTask.ReferenceKey, EntityStatusEnum.Active);
                    break;

                case TaskTypeEnum.BranchOnHold:      //Make Branch active
                    BranchHelpers.UpdateEntityStatus(userTask.ReferenceKey, EntityStatusEnum.Active);
                    break;
                }

                //close the Task
                UserTaskHelpers.UpdateEntityStatus(userTask.UserTaskId, EntityStatusEnum.Closed);

                return(Json(new { success = true }));
            }
            else
            {
                return(Json(new { success = false }));
            }
        }