Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id);

            db.IncompatibleAgricultures.Remove(incompatibleAgriculture);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,FirstCulureId,SecondCulureId")] IncompatibleAgriculture incompatibleAgriculture)
 {
     if (ModelState.IsValid)
     {
         db.Entry(incompatibleAgriculture).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FirstCulureId  = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.FirstCulureId);
     ViewBag.SecondCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.SecondCulureId);
     return(View(incompatibleAgriculture));
 }
Beispiel #3
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id);

            if (incompatibleAgriculture == null)
            {
                return(HttpNotFound());
            }
            return(View(incompatibleAgriculture));
        }
Beispiel #4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id);

            if (incompatibleAgriculture == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FirstCulureId  = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.FirstCulureId);
            ViewBag.SecondCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.SecondCulureId);
            return(View(incompatibleAgriculture));
        }