Exemplo n.º 1
0
 public IActionResult AddTask(TaskAddDto model)
 {
     if (ModelState.IsValid)
     {
         var entity = _mapper.Map <TaskEntity>(model);
         _taskService.Add(entity);
         return(RedirectToAction("Index"));
     }
     else
     {
         ViewBag.Urgencies = new SelectList(_urgencyService.GetAll(), "Id", "Description");
     }
     return(View(model));
 }
Exemplo n.º 2
0
 public IActionResult AddTask(TaskAddDto model)
 {
     if (ModelState.IsValid)
     {
         _taskService.Save(new Task
         {
             Name        = model.Name,
             Description = model.Description,
             PriorityId  = model.PriorityId
         });
         return(RedirectToAction("Index"));
     }
     ViewBag.PriorityList = new SelectList(_priorityService.GetAll(), "Id", "Definition");
     TempData["Active"]   = TempdataInfo.Task;
     return(View(model));
 }