Esempio n. 1
0
 public ActionResult Ajouter(Excursion.Data.Zone zone, string Centre)
 {
     Excursion.Data.Zone zn = new Data.Zone();
     zn.Nom      = zone.Nom;
     zn.CodeZone = zone.CodeZone;
     zn.CentreID = centreRepository.FindOne(x => x.Nom == Centre).CentreID;
     zoneRepository.Add(zn);
     zoneRepository.Save();
     return(RedirectToAction("Ajouter", new RouteValueDictionary(
                                 new { controller = "Excursion", action = "Ajouter" })));
 }
Esempio n. 2
0
 static public void addzone(Zone zone)
 {
     using (ZoneRepository zonerepo = new ZoneRepository())
     {
         zonerepo.context.Entry(zone.PiloteZoneObli).State = EntityState.Unchanged;
         if (zone.PiloteZoneOpti != null)
         {
             zonerepo.context.Entry(zone.PiloteZoneOpti).State = EntityState.Unchanged;
         }
         zonerepo.Add(zone);
         zonerepo.Save();
     }
 }