Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ref_HighValueCrop ref_HighValueCrop = db.ref_HighValueCrop.Find(id);

            db.ref_HighValueCrop.Remove(ref_HighValueCrop);
            db.SaveChanges();
            return(RedirectToAction("Create"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "HighValueCropID,HighValueCrop,CropCommodityID")] ref_HighValueCrop ref_HighValueCrop)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ref_HighValueCrop).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Create"));
     }
     return(View(ref_HighValueCrop));
 }
Example #3
0
        public ActionResult Create([Bind(Prefix = "Item1", Include = "HighValueCropID,HighValueCrop,CropCommodityID")] ref_HighValueCrop ref_HighValueCrop)
        {
            if (ModelState.IsValid)
            {
                db.ref_HighValueCrop.Add(ref_HighValueCrop);
                db.SaveChanges();
                return(RedirectToAction("Create"));
            }

            return(View(ref_HighValueCrop));
        }
Example #4
0
        // GET: HighValueCrop/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ref_HighValueCrop ref_HighValueCrop = db.ref_HighValueCrop.Find(id);

            if (ref_HighValueCrop == null)
            {
                return(HttpNotFound());
            }
            return(View(ref_HighValueCrop));
        }