// GET: Reservation/Create public ActionResult Create() { var res = new AffectationViewModel(); res.Mannequins = servicem.GetMany().ToSelectListItems(); return(View(res)); }
public ActionResult Create(AffectationViewModel avm) { Affectation f = new Affectation() { DateEnvoi = DateTime.Now, Etat = Etat.envoyée, Mannequin = servicem.GetById(avm.CIN), }; serviAff.Add(f); serviAff.Commit(); return(RedirectToAction("Index")); }