public ActionResult Create(GrandChampion grandchampion)
        {
            if (ModelState.IsValid)
            {
                db.GrandChampions.AddObject(grandchampion);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.RankId = new SelectList(db.Ranks, "RankId", "Description", grandchampion.RankId);
            return View(grandchampion);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GrandChampions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGrandChampions(GrandChampion grandChampion)
 {
     base.AddObject("GrandChampions", grandChampion);
 }
 public ActionResult Edit(GrandChampion grandchampion)
 {
     if (ModelState.IsValid)
     {
         db.GrandChampions.Attach(grandchampion);
         db.ObjectStateManager.ChangeObjectState(grandchampion, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.RankId = new SelectList(db.Ranks, "RankId", "Description", grandchampion.RankId);
     return View(grandchampion);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create a new GrandChampion object.
 /// </summary>
 /// <param name="grandChampionId">Initial value of the GrandChampionId property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 /// <param name="rankId">Initial value of the RankId property.</param>
 /// <param name="divisionCount">Initial value of the DivisionCount property.</param>
 public static GrandChampion CreateGrandChampion(global::System.Int32 grandChampionId, global::System.String description, global::System.Int32 rankId, global::System.Int32 divisionCount)
 {
     GrandChampion grandChampion = new GrandChampion();
     grandChampion.GrandChampionId = grandChampionId;
     grandChampion.Description = description;
     grandChampion.RankId = rankId;
     grandChampion.DivisionCount = divisionCount;
     return grandChampion;
 }