private void detach_Games3(Game entity) { this.SendPropertyChanging(); entity.Player3 = null; }
partial void DeleteGame(Game instance);
private void attach_Games3(Game entity) { this.SendPropertyChanging(); entity.Player3 = this; }
partial void UpdateGame(Game instance);
partial void InsertGame(Game instance);
public void Delete(Game game) { db.Games.DeleteOnSubmit(game); }
//Insert/Delete/Update public void Add(Game game) { db.Games.InsertOnSubmit(game); }
public ActionResult Play(int blue1, int blue2, int red1, int red2, bool? isTest = false) { var blue1StartDefCount = GetDefCount(blue1); var blue2StartDefCount = GetDefCount(blue2); var red1StartDefCount = GetDefCount(red1); var red2StartDefCount = GetDefCount(red2); int blueOff = blue1, blueDef = blue2, redOff = red1, redDef = red2; if (blue1StartDefCount < blue2StartDefCount) { blueDef = blue2; blueOff = blue1; } if (red1StartDefCount < red2StartDefCount) { redDef = red2; redOff = red1; } var game = new Game() { Blue1 = blueDef, Blue2 = blueOff, Red1 = redDef, Red2 = redOff, DateStart = DateTime.Now, DateEnd = DateTime.Now, IsTest = isTest.Value }; var status = string.Format(GetStartTweet(), playerRep.GetPlayer(blue1), playerRep.GetPlayer(blue2), playerRep.GetPlayer(red1), playerRep.GetPlayer(red2)); Tweet(status); gameRep.Add(game); gameRep.Save(); return RedirectToAction("Play", "Home", new { BlueDef = blueDef, BlueOff = blueOff, RedDef = redDef, RedOff = redOff, GameID = game.ID }); }