예제 #1
0
        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();
            }
        }
예제 #2
0
        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();
            }
        }