public ActionResult Create(TopTenEdit topTenEdit) { if (ModelState.IsValid) { TopTen topTen = topTenEdit.GetModel(); TopTenCache.Insert(Db, UserId, ref topTen); return RedirectToAction("Index"); } PopulateToUserId(topTenEdit.ToUserId); PopulateStatus(topTenEdit.Status); return View(topTenEdit); }
public ActionResult Edit(TopTenEdit topTenEdit) { if (ModelState.IsValid) { TopTen topTen = topTenEdit.GetModel(); bool success = TopTenCache.Update(Db, UserId, ref topTen); if (!success) { return RedirectToAccessDenied(); } return RedirectToAction("Index"); } return View(topTenEdit); }