public ActionResult Create(Referee referee)
        {
            if (ModelState.IsValid)
            {
                db.Referees.AddObject(referee);
                db.SaveChanges();
                return PartialView("GridData", new Referee[] { referee });
            }

            return PartialView("Edit", referee);
        }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Referees EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReferees(Referee referee)
 {
     base.AddObject("Referees", referee);
 }
Пример #3
0
 /// <summary>
 /// Create a new Referee object.
 /// </summary>
 /// <param name="refereeID">Initial value of the RefereeID property.</param>
 public static Referee CreateReferee(global::System.Int32 refereeID)
 {
     Referee referee = new Referee();
     referee.RefereeID = refereeID;
     return referee;
 }
        public ActionResult Edit(Referee referee)
        {
            if (ModelState.IsValid)
            {
                db.Referees.Attach(referee);
                db.ObjectStateManager.ChangeObjectState(referee, EntityState.Modified);
                db.SaveChanges();
                return PartialView("GridData", new Referee[] { referee });
            }

            return PartialView(referee);
        }