예제 #1
0
        public IActionResult Post(ToDoListVM todolistVM)
        {
            var push = _todolistService.Create(todolistVM);

            if (push > 0)
            {
                return(Ok(push));
            }
            return(BadRequest("Added Row Failed!"));
        }
        public IActionResult Post(ToDoListVM toDoListVM)
        {
            var data = _toDoListService.Create(toDoListVM);

            if (data > 0)
            {
                return(Ok(data));
            }
            return(BadRequest("Failed"));
        }
예제 #3
0
        public ActionResult Create(ToDoListDto model)
        {
            var result = _toDoListService.Create(model);

            if (result.HasError)
            {
                return(View("Edit", model));
            }

            return(RedirectToAction("List"));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("Id,Name")] ToDoList toDoToDoList)
        {
            if (ModelState.IsValid)
            {
                await _toDoListService.Create(toDoToDoList);

                this.AddAlertSuccess($"{toDoToDoList.Name} created.");

                return(RedirectToAction(nameof(Index)));
            }

            return(View(toDoToDoList));
        }
예제 #5
0
 public IActionResult AddList(ToDoList entity)
 {
     entity.isValid = true;
     _toDoListService.Create(entity);
     return(RedirectToAction("Index"));
 }