public ActionResult Create([Bind(Include = "pseudo,Mot_Pass,Email")] Utilisateur utilisateur) { utilisateur.UID = GestionGlobal.GetUID("UTI"); if (ModelState.IsValid) { userManager.CreateUser(utilisateur); return(RedirectToAction("Index")); } return(View(utilisateur)); }
public ActionResult Create([Bind(Include = "UID,Nom")] Region region) { region.UID = GestionGlobal.GetUID("REG"); if (ModelState.IsValid) { db.Regions.Add(region); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(region)); }
public ActionResult Create([Bind(Include = "UID,Nom,UID_Region")] Ville ville) { ville.UID = GestionGlobal.GetUID("VIL"); if (ModelState.IsValid) { db.Villes.Add(ville); db.SaveChanges(); return(RedirectToAction("Create")); } ViewBag.UID_Region = new SelectList(db.Regions, "UID", "Nom", ville.UID_Region); return(View(ville)); }
public ActionResult Create([Bind(Include = "UID,Cas_Mort,Cas_Retablis,Cas_Confirmer,Cas_Total,Date_Ins,UID_V")] Enumeration enumeration) { RegionModel reg = new RegionModel(); if (ModelState.IsValid) { enumeration.UID = GestionGlobal.GetUID("ENU"); db.Enumerations.Add(enumeration); db.SaveChanges(); // add statstics of region into regionStatiqtics Table reg.AjouterStatistique(enumeration); return(RedirectToAction("Index")); } ViewData.Add("ListRegions", new SelectList(db.Regions, "UID", "Nom")); return(View(enumeration)); }