public ActionResult Add(AddViewModel addvm)
 {
     if (ModelState.IsValid)
     {
         var subtask = _service.ConvertVMToSubtask(addvm.SubTaskName, addvm.SubTaskDescription);
         _service.AddSubTask(Guid.Parse(addvm.TaskId), subtask);
         return(RedirectToAction("Index", "SubTask", new { Id = addvm.TaskId }));
     }
     return(View(addvm));
 }
Exemplo n.º 2
0
 public ActionResult AddSubTask(SubTasksVM tasksVM, Guid id, Guid userid)
 {
     if (ModelState.IsValid)
     {
         taskService.AddSubTask(new SubTask
         {
             SubTaskName  = tasksVM.SubTask.SubTaskName,
             CreationDate = DateTime.Now,
             TasksID      = id,
             Status       = tasksVM.SubTask.Status
         });
         return(RedirectToAction("Index", new { id = id, userid = userid }));
     }
     return(View(tasksVM));
 }