コード例 #1
0
 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);
 }
コード例 #2
0
        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;
 }