public ActionResult Edit(int idHasilTani, int idJenisTani, int jumlah, int idLokasi) { if ((bool)Session["Login"]) { try { MetaniContext context = new MetaniContext(); context.EditHasilTani(idHasilTani, idJenisTani, jumlah, idLokasi); return(RedirectToAction("Index")); } catch { return(RedirectToAction("Create")); } } return(RedirectToAction("Login", "Admin")); }