// GET: Lokasi/Edit/5 public ActionResult Edit(int id) { if ((bool)Session["Login"]) { MetaniContext context = new MetaniContext(); return(View(context.FindLokasiTani(id))); } return(RedirectToAction("Login", "Admin")); }
// GET: Lokasi/Details/5 public ActionResult Details(int id) { if ((bool)Session["Login"]) { try { MetaniContext context = new MetaniContext(); return(View(context.FindLokasiTani(id))); } catch { return(RedirectToAction("Index")); } } return(RedirectToAction("Login", "Admin")); }