public ActionResult Edit([Bind(Include = "idProgramme,nom,annee,dateValidation,idDevis")] Programme programme) { if (ModelState.IsValid) { db.Entry(programme).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create")); } ViewBag.idDevis = BuildDevisSelectList(programme.idDevis); return(View(programme)); }
public ActionResult Edit([Bind(Include = "idGrille,nom")] GrilleCours grilleCours) { if (ModelState.IsValid) { db.Entry(grilleCours).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(grilleCours)); }
public ActionResult Edit([Bind(Include = "idCritere,description,numero,commentaire,idElement")] CriterePerformance criterePerformance) { Trim(criterePerformance); if (ModelState.IsValid) { db.Entry(criterePerformance).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create", new { idElement = criterePerformance.idElement })); } return(View(criterePerformance)); }
public ActionResult Edit([Bind(Include = "idContexte,numero,description,commentaire,idCompetence")] ContexteRealisation contexteRealisation) { Trim(contexteRealisation); if (ModelState.IsValid) { db.Entry(contexteRealisation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create", new { idCompetence = contexteRealisation.idCompetence })); } return(View(contexteRealisation)); }
public ActionResult Edit([Bind(Include = "idCompetence,codeCompetence,description,motClef,obligatoire,actif,commentaire,idDevis")] EnonceCompetence enonceCompetence) { bool existe; existe = db.EnonceCompetence.Any(ec => ec.idCompetence != enonceCompetence.idCompetence && ec.codeCompetence == enonceCompetence.codeCompetence && ec.idDevis == enonceCompetence.idDevis); Trim(enonceCompetence); if (!existe && ModelState.IsValid) { db.Entry(enonceCompetence).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create", "ContexteRealisation", new { idCompetence = enonceCompetence.idCompetence })); } if (existe) { ModelState.AddModelError("Duplique", "Erreur, un énoncé de compétence avec ce code existe déjà."); } return(View(enonceCompetence)); }
public ActionResult Edit([Bind(Include = "idPlanCadre,numeroCours,titreCours,indicationPedago,environementPhys,ressource,nbHeureTheorie,nbHeurePratique,nbHeureDevoir,idProgramme")] PlanCadre planCadre) { bool existe; existe = db.PlanCadre.Any(pc => pc.idProgramme != planCadre.idProgramme && pc.titreCours == planCadre.titreCours); //Trim(); if (!existe && ModelState.IsValid) { db.Entry(planCadre).State = EntityState.Modified; planCadre.idType = 1; db.SaveChanges(); return(RedirectToAction("info", new { idPlanCadre = planCadre.idPlanCadre })); } if (existe) { ModelState.AddModelError("Duplique", "Erreur, un plan cadre avec ce nom existe déjà."); } return(View(planCadre)); }
public ActionResult Edit([Bind(Include = "idDevis, codeProgramme, annee, codeSpecialisation")] DevisMinistere devisMinistere) { bool existe; existe = db.DevisMinistere.Any(p => p.idDevis != devisMinistere.idDevis && p.codeProgramme == devisMinistere.codeProgramme && p.annee == devisMinistere.annee && p.codeSpecialisation == devisMinistere.codeSpecialisation); if (!existe && ModelState.IsValid) { devisMinistere.codeSpecialisation = devisMinistere.codeSpecialisation.ToUpper(); db.Entry(devisMinistere).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create")); } if (existe) { ModelState.AddModelError("Duplique", "Erreur, ce devisMinistere existe déjà."); } ViewBag.codeProgramme = BuildCodeDevisMinistereSelectList(); return(View(devisMinistere)); }
public ActionResult Edit([Bind(Include = "idDevis, codeProgramme, annee, codeSpecialisation, nom, dateValidation, docMinistere, specialisation, sanction, nbUnite, condition, nbHeurefrmGenerale,nbHeurefrmSpecifique")] DevisMinistere devisMinistere, HttpPostedFileBase docMinistere) { devisMinistere.EnteteProgramme = db.EnteteProgramme.Find(devisMinistere.codeProgramme); if (docMinistere != null) { if (!UploadFile(docMinistere, devisMinistere)) { ModelState.AddModelError("PDF", "Le fichier doit être de type PDF."); } } Trim(devisMinistere); if (ModelState.IsValid) { db.Entry(devisMinistere).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Info", "DevisMinistere", new { idDevis = devisMinistere.idDevis })); } return(View(devisMinistere)); }