/// <inheritdoc /> public ProgrammationDocumentPGE AddProgrammationDocumentPGE(ProgrammationDocumentPGE pge) { using (RatpHidalgoEntities context = new RatpHidalgoEntities(Resource1.RatpConnectionString)) { context.ProgrammationDocumentPGE.Add(pge); context.SaveChanges(); } return(pge); }
/// <inheritdoc /> public ProgrammationDocumentPGE GetOneProgrammationDocumentPge(int idProgrammationDocumentPge) { ProgrammationDocumentPGE programmationDocumentPGE = null; using (RatpHidalgoEntities context = new RatpHidalgoEntities(Resource1.RatpConnectionString)) { programmationDocumentPGE = context.ProgrammationDocumentPGE.Where(x => x.Id == idProgrammationDocumentPge).SingleOrDefault(); } return(programmationDocumentPGE); }
/// <inheritdoc /> public void UpdateProgrammationDocumentPGE(ProgrammationDocumentPGE pge) { using (RatpHidalgoEntities context = new RatpHidalgoEntities(Resource1.RatpConnectionString)) { var pgeToUpdate = context.ProgrammationDocumentPGE.Find(pge.Id); if (pgeToUpdate != null) { //Information de la PGE pgeToUpdate.NumRang = pge.NumRang; pgeToUpdate.NumMedian = pge.NumMedian; pgeToUpdate.IsExAequo = pge.IsExAequo; // = true pgeToUpdate.IsValideEx = pge.IsValideEx; //== true pgeToUpdate.Commentaire = pge.Commentaire; //Information lié aux travaux sur plusieurs années pgeToUpdate.Annee = pge.Annee; pgeToUpdate.Budget = pge.Budget; pgeToUpdate.IsTravauxPlusieursAnnee = pge.IsTravauxPlusieursAnnee; } context.SaveChanges(); } }