Exemplo n.º 1
0
 public ActionResult ModyfyTask(int id, TaskUserControllerViewModel model)
 {
     _db.ModyfiTaskByUser(id, new Task()
     {
         Name        = model.Name,
         Description = model.Description,
         Status      = model.Status
     });
     return(RedirectToAction("TaskDetails", new { id = id }));
 }
Exemplo n.º 2
0
        public ActionResult TaskDetails(int id)
        {
            var temp  = _db.GetTask(id);
            var model = new TaskUserControllerViewModel()
            {
                Description  = temp.Description,
                ExpectedTime = temp.ExpectedTime,
                Id           = temp.Id,
                Name         = temp.Name,
                Status       = temp.Status,
                TeamName     = temp.Team.Name,
                Time         = temp.Time,
                InWork       = temp.Works.Where(x => x.EndHour == null).FirstOrDefault() == null ? false : true,
                StartTime    = temp.Works.Where(x => x.EndHour == null).FirstOrDefault() == null?TimeSpan.Parse("00:00:00") : temp.Works.Where(x => x.EndHour == null).FirstOrDefault().StartHour
            };

            return(View(model));
        }