コード例 #1
0
        public IActionResult AddTask(CoupleAddNewTaskVM newTaskVM)
        {
            if (!ModelState.IsValid)
            {
                return(View(newTaskVM));
            }

            coupleServices.AddNewTask(newTaskVM);
            return(RedirectToAction(nameof(Checklist)));
        }
コード例 #2
0
        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)));
        }