public IActionResult AddTask(CoupleAddNewTaskVM newTaskVM) { if (!ModelState.IsValid) { return(View(newTaskVM)); } coupleServices.AddNewTask(newTaskVM); return(RedirectToAction(nameof(Checklist))); }
public IActionResult AddTask(CoupleAddNewTaskVM newTaskVM, string saveAdd, string saveCancel) { if (!ModelState.IsValid) { return(View(newTaskVM)); } if (!string.IsNullOrEmpty(saveAdd)) { coupleServices.AddNewTask(newTaskVM); return(RedirectToAction(nameof(AddTask))); } else if (!string.IsNullOrEmpty(saveCancel)) { coupleServices.AddNewTask(newTaskVM); return(RedirectToAction(nameof(Checklist))); } return(RedirectToAction(nameof(Checklist))); }