Пример #1
0
 public Player pushPlayer(Player Player)
 {
     Player DBPlayer = Players.Find(Player.Username);
     if ( DBPlayer== null)
     {
         Players.Add(Player);
         return Player;
     }
     else
     {
         return DBPlayer;
     }
 }
Пример #2
0
        public ActionResult Create(Player player)
        {
            player.DefaultTeam = db.Teams.Find(player.DefaultTeam.Name);

            if (ModelState.IsValid)
            {
                db.Players.Add(player);
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            ViewBag.Teams = new SelectList(db.Teams, "Name", "Name");
            return View(player);
        }
Пример #3
0
 public IList<OverallPlayerData> getOverallPlayerData(Player Player)
 {
     return getOverallPlayerData(new List<Player> { Player });
 }
Пример #4
0
        public ActionResult Edit(Player player)
        {
            if (ModelState.IsValid)
            {
                db.Entry(player).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.Teams = new SelectList(db.Teams, "Name", "Name");
            return View(player);
        }