public ActionResult Create(Zone zonesToCreate) { if (!ModelState.IsValid) return View(); try { ZONE _zone = new ZONE(); _zone.NOM = zonesToCreate.NOM; _zone.ID_CONTROLER = zonesToCreate.ID_CONT; _zone.Save(); return RedirectToAction("../Zone/Index"); } catch { return View(); } }
public ActionResult Edit(Zone zones) { int id = Int32.Parse(RouteData.Values["id"].ToString()); if (!ModelState.IsValid) return View(); try { ZONE _zone = new ZONE(); _zone.NOM = zones.NOM; _zone.CONTROLEUR = zones.CONTROLEUR; _zone.ID_CONTROLER = zones.ID_CONT; _zone.SetId(id); _zone.Save(); return RedirectToAction("../Zone/Index"); } catch { return View(); } }