public ActionResult Edit(RefereesMatch refereesmatch)
 {
     if (ModelState.IsValid)
     {
         db.RefereesMatches.Attach(refereesmatch);
         db.ObjectStateManager.ChangeObjectState(refereesmatch, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.MatchID = new SelectList(db.FootballMatches, "MatchID", "MatchID", refereesmatch.MatchID);
     ViewBag.RefereeID = new SelectList(db.Referees, "RefereeID", "RefereeNames", refereesmatch.RefereeID);
     return View(refereesmatch);
 }
        public ActionResult Create(RefereesMatch refereesmatch)
        {
            if (ModelState.IsValid)
            {
                db.RefereesMatches.AddObject(refereesmatch);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.MatchID = new SelectList(db.FootballMatches, "MatchID", "MatchID", refereesmatch.MatchID);
            ViewBag.RefereeID = new SelectList(db.Referees, "RefereeID", "RefereeNames", refereesmatch.RefereeID);
            return View(refereesmatch);
        }
Пример #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RefereesMatches EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRefereesMatches(RefereesMatch refereesMatch)
 {
     base.AddObject("RefereesMatches", refereesMatch);
 }
Пример #4
0
 /// <summary>
 /// Create a new RefereesMatch object.
 /// </summary>
 /// <param name="refereeID">Initial value of the RefereeID property.</param>
 /// <param name="matchID">Initial value of the MatchID property.</param>
 public static RefereesMatch CreateRefereesMatch(global::System.Int32 refereeID, global::System.Int32 matchID)
 {
     RefereesMatch refereesMatch = new RefereesMatch();
     refereesMatch.RefereeID = refereeID;
     refereesMatch.MatchID = matchID;
     return refereesMatch;
 }