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