Example #1
0
        public IActionResult ToggleComplete(int id)
        {
            var OneListItem = ListDbManager.OneListItem(id);

            if (OneListItem != null)
            {
                OneListItem.Completed = !OneListItem.Completed;
                ListDbManager.SaveListItem(OneListItem);
            }

            return(null);
        }
Example #2
0
        public IActionResult Edit(int id)
        {
            var model = new AListViewModel();

            if (id > 0)
            {
                model         = ListDbManager.OneList(id);
                model.Message = "Item Count: " + model.Items.Count;
            }

            return(View(model));
        }
Example #3
0
        public IActionResult Edit(int id, AListViewModel model)
        {
            if (ModelState.IsValid)
            {
                AList toSave = model;
                toSave.ID = id;
                ListDbManager.SaveList(toSave);
                return(RedirectToAction("Show", new { id = id }));
            }

            model.Message = "Item Count: " + model.Items.Count;
            return(View(model));
        }
Example #4
0
        public IActionResult Show(int id)
        {
            var model = ListDbManager.OneList(id);

            return(View(model));
        }
Example #5
0
        public IActionResult Index()
        {
            var model = ListDbManager.AllLists();

            return(View(model));
        }