Exemple #1
0
        public ActionResult Index()
        {
            capstone6Entities ORM = new capstone6Entities();


            ViewBag.Task = ORM.tasklists.ToList();

            return(View());
        }
Exemple #2
0
        public ActionResult ChangeStatus(int taskID)
        {
            capstone6Entities ORM = new capstone6Entities();

            tasklist task = ORM.tasklists.Find(taskID);

            task.status = true;

            ORM.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        public ActionResult DeleteTask(int taskID)
        {
            capstone6Entities ORM = new capstone6Entities();

            tasklist ItemToDelete = ORM.tasklists.Find(taskID);

            // remove
            ORM.tasklists.Remove(ItemToDelete);

            ORM.SaveChanges(); // To Do: use try catch

            return(RedirectToAction("Index"));
        }