Esempio n. 1
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);
        }
Esempio n. 2
0
 public ActionResult Edit(Pronostics pronostics)
 {
     if (ModelState.IsValid)
     {
         db.PronosticsSet.Attach(pronostics);
         db.ObjectStateManager.ChangeObjectState(pronostics, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(pronostics);
 }
Esempio n. 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PronosticsSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPronosticsSet(Pronostics pronostics)
 {
     base.AddObject("PronosticsSet", pronostics);
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new Pronostics object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="score_opp_1">Initial value of the Score_opp_1 property.</param>
 /// <param name="score_opp_2">Initial value of the Score_opp_2 property.</param>
 public static Pronostics CreatePronostics(global::System.Int32 id, global::System.Double score_opp_1, global::System.Double score_opp_2)
 {
     Pronostics pronostics = new Pronostics();
     pronostics.Id = id;
     pronostics.Score_opp_1 = score_opp_1;
     pronostics.Score_opp_2 = score_opp_2;
     return pronostics;
 }