public ActionResult Update()
        {
            List <ToDoItems> allItems = ToDoItems.GetAll();
            int itemId = int.Parse((Request.Query["id"]));

            return(View(allItems[itemId]));
        }
        public ActionResult UpdateSubmit()
        {
            List <ToDoItems> allItems = ToDoItems.GetAll();
            int itemId = int.Parse((Request.Form["id"]));

            allItems[itemId].SetTitle(Request.Form["title"]);
            allItems[itemId].SetDescription(Request.Form["description"]);
            allItems[itemId].SetDueDate(Request.Form["due-date"]);
            allItems[itemId].SetImportance(Request.Form["importance"]);

            return(View("Index", allItems));
        }
        public ActionResult CreateToDoItem()
        {
            var       title        = (Request.Form["title"]);
            var       description  = (Request.Form["description"]);
            var       dueDate      = (Request.Form["due-date"]);
            var       importance   = (Request.Form["importance"]);
            ToDoItems toDoListItem = new ToDoItems(title, description, dueDate, importance);

            toDoListItem.Save();

            List <ToDoItems> allItems = ToDoItems.GetAll();

            return(View("Index", allItems));
        }
        public ActionResult Delete()
        {
            List <ToDoItems> allItems = ToDoItems.GetAll();
            int itemId = int.Parse((Request.Query["id"]));

            allItems.RemoveAt(itemId);
            foreach (ToDoItems item in allItems)
            {
                if (item.GetId() > itemId)
                {
                    item.DecrementId(item.GetId());
                }
            }


            return(View("Index", allItems));
        }
        public ActionResult Index()
        {
            List <ToDoItems> allItems = ToDoItems.GetAll();

            return(View("Index", allItems));
        }
        public ActionResult ToDoList()
        {
            List <ToDoItems> allItems = ToDoItems.GetAll();

            return(View("ToDoList", allItems));
        }