Beispiel #1
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));
        }
Beispiel #2
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));
        }