Beispiel #1
0
 public ActionResult Create(TodoList.Models.TodoList todoList)
 {
     if (ModelState.IsValid)
     {
         db.Add(todoList);
         TempData["Message"] = "The Task has been added to the List!";
         return(RedirectToAction("Details", new { id = todoList.Id }));
     }
     return(View());
 }
Beispiel #2
0
 public ActionResult Edit(TodoList.Models.TodoList todoList)
 {
     if (ModelState.IsValid)
     {
         db.Update(todoList);
         TempData["Message"] = "The Task has been changed!";
         return(RedirectToAction("Details", new { id = todoList.Id }));
     }
     return(View(todoList));
 }
Beispiel #3
0
 public void Add(TodoList todoList)
 {
     db.TodoItems.Add(todoList);
     db.SaveChanges();
 }