public IActionResult ToggleComplete(int id) { var OneListItem = ListDbManager.OneListItem(id); if (OneListItem != null) { OneListItem.Completed = !OneListItem.Completed; ListDbManager.SaveListItem(OneListItem); } return(null); }
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)); }
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)); }
public IActionResult Show(int id) { var model = ListDbManager.OneList(id); return(View(model)); }
public IActionResult Index() { var model = ListDbManager.AllLists(); return(View(model)); }