public ActionResult Create(PackVM ovm) { Pack p = new Pack() { TypePack = ovm.TypePack, PackName = ovm.PackName, Description = ovm.Description, Quantity = ovm.Quantity, StartDate = ovm.StartDate, EndDate = ovm.EndDate, }; service.Add(p); service.Commit(); //service.Dispose(); return(RedirectToAction("Index")); }
public ActionResult Create(PackViewModel AVM) { try { // TODO: Add insert logic here Pack A = new Pack(); A.Id = AVM.Id; A.date_deb = AVM.date_deb; A.date_expiration = AVM.date_expiration; A.ListPanier = AVM.ListPanierModel; A.ListProduct = AVM.ListProduct; A.Price = AVM.Price; PackService.Add(A); PackService.Commit(); return(RedirectToAction("Index")); } catch { return(View()); } }