public ActionResult Create([Bind(Include = "ID,FK_ID_order_details,FK_ID_theorical_content,FK_ID_made_tolerance,FK_ID_unit_made_tolerance,FK_ID_unit_theorical_content,FK_ID_gaz_type,FK_ID_testing_tolerance,FK_ID_unit_testing_tolerance")] tbl_607_gaz tbl_607_gaz, int IDPosteNumber) { if (ModelState.IsValid) { db.tbl_607_gaz.Add(tbl_607_gaz); try { db.SaveChanges(); return(RedirectToAction("Index")); } catch (DbEntityValidationException ex) { string s = ex.Message; return(RedirectToAction("../Ooops", new { message = s })); } } ViewBag.FK_ID_gaz_type = new SelectList(db.tbl_607_gaz_type.OrderBy(e => e.gaz_type), "ID", "gaz_type", tbl_607_gaz.FK_ID_gaz_type); ViewBag.FK_ID_made_tolerance = new SelectList(db.tbl_607_made_tolerance.OrderBy(e => e.made_tolerance), "ID", "made_tolerance", tbl_607_gaz.FK_ID_made_tolerance); ViewBag.FK_ID_unit_made_tolerance = new SelectList(db.tbl_607_units, "ID", "unit", tbl_607_gaz.FK_ID_unit_made_tolerance); ViewBag.FK_ID_testing_tolerance = new SelectList(db.tbl_607_testing_tolerance.OrderBy(e => e.testing_tolerance), "ID", "testing_tolerance", tbl_607_gaz.FK_ID_testing_tolerance); ViewBag.FK_ID_unit_testing_tolerance = new SelectList(db.tbl_607_units, "ID", "unit", tbl_607_gaz.FK_ID_unit_testing_tolerance); ViewBag.FK_ID_theorical_content = new SelectList(db.tbl_607_theorical_content.OrderBy(e => e.theorical_content), "ID", "theorical_content", tbl_607_gaz.FK_ID_theorical_content); ViewBag.FK_ID_unit_theorical_content = new SelectList(db.tbl_607_units, "ID", "unit", tbl_607_gaz.FK_ID_unit_theorical_content); return(View(tbl_607_gaz)); }
/// <summary> /// Affichage de la vue Suppression /// </summary> /// <param name="id">id du Gaz sélectionné</param> /// <returns>Vue Suppression</returns> // GET: Gaz/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_607_gaz tbl_607_gaz = db.tbl_607_gaz.Find(id); if (tbl_607_gaz == null) { return(HttpNotFound()); } return(View("_DeletePartialGazByPoste", tbl_607_gaz)); }
public ActionResult DeleteConfirmed(int id) { tbl_607_gaz tbl_607_gaz = db.tbl_607_gaz.Find(id); db.tbl_607_gaz.Remove(tbl_607_gaz); try { db.SaveChanges(); return(RedirectToAction("Index")); } catch (DbEntityValidationException ex) { string s = ex.Message; return(RedirectToAction("../Ooops", new { message = s })); } }