public ActionResult DeleteConfirmed(int id) { PlantDiseaseFactor plantDiseaseFactor = db.PlantDiseaseFactors.Find(id); db.PlantDiseaseFactors.Remove(plantDiseaseFactor); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
// 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)); }
// 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)); }