public ActionResult Create(BrunchDto brunch) { try { BrunchLoader.Save(brunch); TempData["SuccessMessage"] = "Created Successfully"; // TODO: Add insert logic here return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(int id, BrunchDto brunch) { try { if (id == brunch.Id) { BrunchLoader.Save(brunch); TempData["SuccessMessage"] = "Updated Successfully"; } else { TempData["FailMessage"] = "Updated Failed"; return(View()); } return(RedirectToAction("Index")); } catch { return(View()); } }