Esempio n. 1
0
        // GET: Details
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                _logger.Error("Error receiving Details() of task. id == null");
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UsersTask usersTask = await _userTaskService.Get((int)id);

            if (usersTask == null)
            {
                _logger.Error("Error receiving Details() of task. The task is not found");
                return(HttpNotFound());
            }
            return(View(usersTask));
        }
Esempio n. 2
0
 public ActionResult Create(int?taskId)
 {
     if (taskId != null)
     {
         var userIdentityName         = User.Identity.Name;
         var user                     = _vUserProfileService.GetVUserProfile(userIdentityName);
         var task                     = _vUserTaskService.GetTaskForUser(user.UserId, taskId.Value);
         var userTaskModel            = _userTaskTService.Get(user.UserId, task.TaskId);
         TaskTrackViewModel viewModel = new TaskTrackViewModel
         {
             Name       = task.TaskName,
             TrackDate  = DateTime.Now,
             TaskId     = task.TaskId,
             UserId     = user.UserId,
             UserTaskId = userTaskModel.UserTaskId
         };
         return(View(viewModel));
     }
     else
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
 }