public ActionResult Create(RewardViewModel rvm, int id) { Reward r = new Reward(); // r.Event.EventId = rewardService.GetById(id); r.IdReward = rvm.IdReward; r.Price1 = rvm.Price1; r.Price2 = rvm.Price2; r.Price3 = rvm.Price3; r.titre = rvm.titre; rewardService.Add(r); rewardService.Commit(); return(View()); }
// GET: Reward/Create public ActionResult Create(RewardViewModel rvm, int id) { //int userconnect = 1; Reward r = new Reward(); r.UserId = 1; r.EventId = rvm.EventId = id; r.description1 = rvm.description1; r.firstReward = rvm.firstReward; r.description2 = rvm.description2; r.SecondReward = rvm.SecondReward; r.description3 = rvm.description3; r.ThirdReward = rvm.ThirdReward; RS.Add(r); RS.Commit(); return(View(rvm)); }