コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PlantDiseaseFactor plantDiseaseFactor = db.PlantDiseaseFactors.Find(id);

            db.PlantDiseaseFactors.Remove(plantDiseaseFactor);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,PlantDiseaseId,FactorId,From,To,CreationDate,CreatedBy")] PlantDiseaseFactor plantDiseaseFactor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plantDiseaseFactor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FactorId       = new SelectList(db.Factors, "Id", "Name", plantDiseaseFactor.FactorId);
     ViewBag.PlantDiseaseId = new SelectList(db.PlantDiseaseJuncs, "Id", "Id", plantDiseaseFactor.PlantDiseaseId);
     return(View(plantDiseaseFactor));
 }
コード例 #3
0
        // GET: PlantDiseaseFactors/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PlantDiseaseFactor plantDiseaseFactor = db.PlantDiseaseFactors.Find(id);

            if (plantDiseaseFactor == null)
            {
                return(HttpNotFound());
            }
            return(View(plantDiseaseFactor));
        }
コード例 #4
0
        // GET: PlantDiseaseFactors/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PlantDiseaseFactor plantDiseaseFactor = db.PlantDiseaseFactors.Find(id);

            if (plantDiseaseFactor == null)
            {
                return(HttpNotFound());
            }
            ViewBag.FactorId       = new SelectList(db.Factors, "Id", "Name", plantDiseaseFactor.FactorId);
            ViewBag.PlantDiseaseId = new SelectList(db.PlantDiseaseJuncs, "Id", "Id", plantDiseaseFactor.PlantDiseaseId);
            return(View(plantDiseaseFactor));
        }