public ActionResult AddTask(ToDoItem item, int categoryId) { ToDoItemsDb db = new ToDoItemsDb(Properties.Settings.Default.ConStr); item.Completed = false; db.AddTask(item, categoryId); return(Redirect("/")); }
public ActionResult AddTask(string title, string description, int categoryId, DateTime dueDate) { ToDoItemsDb db = new ToDoItemsDb(Properties.Settings.Default.ConStr); ToDoItem item = new ToDoItem(); item.Title = title; item.Description = description; item.DueDate = dueDate; item.Completed = false; db.AddTask(item, categoryId); return(Redirect("/")); }