本文整理汇总了C#中DataAccess.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.Refresh方法的具体用法?C# DataAccess.Refresh怎么用?C# DataAccess.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.Refresh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveGame
private int SaveGame(DataAccess.CSSDataContext db, DataAccess.CSSStatsDataContext statsDB, DataAccess.GameServer gameServer, Data.GameDataset.GameRow gameRow)
{
DataAccess.Game game = new Allegiance.CommunitySecuritySystem.DataAccess.Game()
{
GameDefections = gameRow.AllowDefections,
GameDevelopments = gameRow.AllowDevelopments,
GameShipyards = gameRow.AllowShipyards,
GameConquest = gameRow.Conquest,
GameCore = TrimString(gameRow.CoreFile, 50),
GameDeathMatch = gameRow.DeathMatch,
GameDeathmatchGoal = gameRow.DeathmatchGoal,
GameEndTime = gameRow.EndTime,
GameFriendlyFire = gameRow.FriendlyFire,
GameName = TrimString(gameRow.GameName, 254),
GameInvulStations = gameRow.InvulnerableStations,
GameMap = TrimString(gameRow.MapName, 49),
GameMaxImbalance = gameRow.MaxImbalance,
GameResources = gameRow.Resources,
GameRevealMap = gameRow.RevealMap,
GameSquadGame = gameRow.SquadGame,
GameStartingMoney = gameRow.StartingMoney,
GameStartTime = gameRow.StartTime,
GameStatsCount = gameRow.StatsCount,
GameTotalMoney = gameRow.TotalMoney,
GameID = gameRow.GameID,
GameServer = gameServer.GameServerID
};
statsDB.Games.InsertOnSubmit(game);
try
{
statsDB.SubmitChanges();
}
catch (Exception ex)
{
string dbLengthErrors = Utilities.LinqErrorDetector.AnalyzeDBChanges(statsDB);
throw new Exception("CSSStats[games]: DB Error, Linq Length Analysis: " + dbLengthErrors + "\r\n", ex);
}
SaveGameEvents(db, statsDB, gameRow, game.GameIdentID);
SaveTeams(db, statsDB, gameRow, game.GameIdentID);
SaveChatLog(db, statsDB, gameRow, game.GameIdentID);
try
{
statsDB.SubmitChanges();
}
catch (Exception ex)
{
string dbLengthErrors = Utilities.LinqErrorDetector.AnalyzeDBChanges(statsDB);
throw new Exception("CSSStats[game data]: DB Error, Linq Length Analysis: " + dbLengthErrors + "\r\n", ex);
}
try
{
db.SubmitChanges();
}
catch (Exception ex)
{
string dbLengthErrors = Utilities.LinqErrorDetector.AnalyzeDBChanges(db);
throw new Exception("CSS DB Error, Linq Length Analysis: " + dbLengthErrors + "\r\n", ex);
}
statsDB.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, game);
UpdateLeaderboard(game.GameIdentID);
UpdateFactionStats(game.GameIdentID);
UpdateMetrics(game.GameIdentID);
statsDB.SubmitChanges();
db.SubmitChanges();
return game.GameIdentID;
}