示例#1
0
        public IActionResult NewItem(ToDoItem item)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            mgr.AddToDoItem(item);
            return(Redirect("/home/index"));
        }
示例#2
0
        public IActionResult MarkAsCompleted(int id)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            mgr.MarkAsCompleted(id);
            return(Redirect("/home/index"));
        }
示例#3
0
        public IActionResult UpdateCategory(Category category)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            mgr.UpdateCategory(category);
            return(Redirect("/home/categories"));
        }
示例#4
0
        public IActionResult SaveNewCategory(string name)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            mgr.AddCategory(name);
            return(Redirect("/home/categories"));
        }
示例#5
0
        public IActionResult EditCategory(int id)
        {
            ToDoItemsManager mgr      = new ToDoItemsManager(_connectionString);
            Category         category = mgr.GetCategory(id);

            return(View(category));
        }
示例#6
0
        public ActionResult SaveNewItem(ToDoItem item)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            mgr.AddToDoItem(item);
            return(Redirect("/home/index"));
        }
示例#7
0
        public ActionResult MarkAsCompleted(int id)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            mgr.MarkAsCompleted(id);
            return(Redirect("/home/index"));
        }
示例#8
0
        public ActionResult UpdateCategory(Category category)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            mgr.UpdateCategory(category);
            return(Redirect("/home/categories"));
        }
示例#9
0
        public ActionResult EditCategory(int id)
        {
            ToDoItemsManager mgr      = new ToDoItemsManager(Properties.Settings.Default.ConStr);
            Category         category = mgr.GetCategory(id);

            return(View(category));
        }
示例#10
0
        public ActionResult SaveNewCategory(string name)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            mgr.AddCategory(name);
            return(Redirect("/home/categories"));
        }
示例#11
0
        public IActionResult ByCategory(int id)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            List <ToDoItem> items = mgr.GetByCategory(id);

            return(View(items));
        }
示例#12
0
        public IActionResult Completed()
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            List <ToDoItem> items = mgr.GetCompleted();

            return(View(items));
        }
示例#13
0
        public ActionResult ByCategory(int id)
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            IEnumerable <ToDoItem> items = mgr.GetByCategory(id);

            return(View(items));
        }
示例#14
0
        public ActionResult Completed()
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            IEnumerable <ToDoItem> items = mgr.GetCompleted();

            return(View(items));
        }
示例#15
0
        public IActionResult NewItem()
        {
            ToDoItemsManager mgr = new ToDoItemsManager(_connectionString);

            return(View(mgr.GetCategories()));
        }
示例#16
0
        public ActionResult NewItem()
        {
            ToDoItemsManager mgr = new ToDoItemsManager(Properties.Settings.Default.ConStr);

            return(View(mgr.GetCategories()));
        }