public ActionResult DeleteConfirmed(int id) { FERTILIZER fERTILIZER = db.FERTILIZERs.Find(id); db.FERTILIZERs.Remove(fERTILIZER); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: AgroPark/FERTILIZERs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FERTILIZER fERTILIZER = db.FERTILIZERs.Find(id); if (fERTILIZER == null) { return(HttpNotFound()); } return(View(fERTILIZER)); }
public ActionResult Edit([Bind(Include = "OBJECTID,FIRM_ID,MARK_ID,MAIN_COMPONENT_ID,PACKING_ID,UNIT_TYPE_ID,WATER_PER_KG,NAME,CATEGORY_ID")] FERTILIZER fERTILIZER) { if (ModelState.IsValid) { db.Entry(fERTILIZER).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CATEGORY_ID = new SelectList(db.CATEGORIES, "OBJECTID", "NAME", fERTILIZER.CATEGORY_ID); ViewBag.MAIN_COMPONENT_ID = new SelectList(db.MAIN_COMPONENTS, "OBJECTID", "NAME", fERTILIZER.MAIN_COMPONENT_ID); ViewBag.FIRM_ID = new SelectList(db.FIRMS, "OBJECTID", "NAME", fERTILIZER.FIRM_ID); ViewBag.MARK_ID = new SelectList(db.MARKS, "OBJECTID", "NAME", fERTILIZER.MARK_ID); ViewBag.PACKING_ID = new SelectList(db.PACKINGs, "OBJECTID", "NAME", fERTILIZER.PACKING_ID); ViewBag.UNIT_TYPE_ID = new SelectList(db.UNITS, "OBJECTID", "NAME", fERTILIZER.UNIT_TYPE_ID); return(View(fERTILIZER)); }
// GET: AgroPark/FERTILIZERs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FERTILIZER fERTILIZER = db.FERTILIZERs.Find(id); if (fERTILIZER == null) { return(HttpNotFound()); } ViewBag.CATEGORY_ID = new SelectList(db.CATEGORIES, "OBJECTID", "NAME", fERTILIZER.CATEGORY_ID); ViewBag.MAIN_COMPONENT_ID = new SelectList(db.MAIN_COMPONENTS, "OBJECTID", "NAME", fERTILIZER.MAIN_COMPONENT_ID); ViewBag.FIRM_ID = new SelectList(db.FIRMS, "OBJECTID", "NAME", fERTILIZER.FIRM_ID); ViewBag.MARK_ID = new SelectList(db.MARKS, "OBJECTID", "NAME", fERTILIZER.MARK_ID); ViewBag.PACKING_ID = new SelectList(db.PACKINGs, "OBJECTID", "NAME", fERTILIZER.PACKING_ID); ViewBag.UNIT_TYPE_ID = new SelectList(db.UNITS, "OBJECTID", "NAME", fERTILIZER.UNIT_TYPE_ID); return(View(fERTILIZER)); }