// GET: JenisTani
        public ActionResult Index()
        {
            if ((bool)Session["Login"])
            {
                MetaniContext context = new MetaniContext();
                return(View(context.GetAllJenisTani()));
            }

            return(RedirectToAction("Login", "Admin"));
        }
        // GET: JenisTani/Edit/5
        public ActionResult Edit(int id)
        {
            if ((bool)Session["Login"])
            {
                MetaniContext    context   = new MetaniContext();
                List <JenisTani> jenisTani = context.GetAllJenisTani();
                List <Lokasi>    lokasi    = context.GetAllLokasiTani();
                HasilTani        hasilTani = context.FindHasilTani(id);

                TaniLokasi taniLokasi = new TaniLokasi {
                    jenisTani = jenisTani.ToArray(), lokasi = lokasi.ToArray(), hasilTani = hasilTani
                };

                return(View(taniLokasi));
            }

            return(RedirectToAction("Login", "Admin"));
        }