예제 #1
0
        //
        // GET: /Pronostic/Create
        public ActionResult Create(int id)
        {
            PronosticModel Prnmodel = new PronosticModel(); //Create instance of VM
            Prnmodel.game = db.GamesSet.Single(g => g.Id == id);

            return View(Prnmodel);
        }
예제 #2
0
        public ActionResult Create(PronosticModel model)
        {
            if (ModelState.IsValid)
            {
                Pronostics prono = new Pronostics{
                    Score_opp_1 = model.Score_opp_1,
                    Score_opp_2 = model.Score_opp_2,
                    Games = model.game,
                    Sports = model.game.Events.Sports,

                };

                db.PronosticsSet.AddObject(prono);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(model);
        }