public List <UserTable> GetAllUser() { var toReturn = new List <UserTable>(); try { using (var db = new connectionsLinqDataContext()) { var temp = db.GetAllUser().ToList(); foreach (var v in temp) { UserTable toAdd = ConvertToUser(v); var decryptedpassword = PasswordSecurity.Decrypt("securityPassword", toAdd.password, false); toAdd.password = decryptedpassword; toReturn.Add(toAdd); } return(toReturn); } } catch (Exception) { return(null); } }
public void DeleteSystemLog(int logId) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { db.DeleteSystemLogById(logId); } } catch (Exception e) { } }
public void AddGameToUserSpectetorGames(int userId, int roomId, int gameId) { try { using (var db = new connectionsLinqDataContext()) { db.AddNewSpectetorGamesOfUser(userId, roomId, gameId); } } catch (Exception) { return; } }
public void EditUserAvatar(int id, string newAvatar) { try { using (var db = new connectionsLinqDataContext()) { db.EditAvatar(id, newAvatar); } } catch (Exception) { return; } }
public void EditUserPoints(int id, int newPoints) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserPoints(id, newPoints); } } catch (Exception) { return; } }
public void EditUserTotalProfit(int id, int newTotalProfit) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserTotalProfit(id, newTotalProfit); } } catch (Exception) { return; } }
public void EditUserNumOfGamesPlayed(int id, int newEditUserNumOfGamesPlayed) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserNumOfGamesPlayed(id, newEditUserNumOfGamesPlayed); } } catch (Exception) { return; } }
public void EditUserLeagueName(int id, LinqToSql.LeagueName newLeagueName) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserLeagueName(id, newLeagueName.League_Value); } } catch (Exception) { return; } }
public void EditUserIsActive(int id, bool newIsActive) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserIsActive(id, newIsActive); } } catch (Exception) { return; } }
public void EditUserHighestCashGainInGame(int Id, int newHighestCashGainInGame) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserHighestCashGainInGame(Id, newHighestCashGainInGame); } } catch (Exception) { return; } }
public void EditEmail(int id, string newEmail) { try { using (var db = new connectionsLinqDataContext()) { db.EditEmail(id, newEmail); } } catch (Exception) { return; } }
public void EditUserName(int id, string newUserName) { try { using (var db = new connectionsLinqDataContext()) { db.EditUsername(id, newUserName); } } catch (Exception) { return; } }
public void EditUserId(int oldId, int newId) { try { using (var db = new connectionsLinqDataContext()) { db.EditUserId(newId, oldId); } } catch (Exception) { return; } }
public void DeleteUserByUsername(string username) { try { using (var db = new connectionsLinqDataContext()) { db.DeleteUserByUserName(username); } } catch (Exception) { return; } }
public void DeleteActiveGameOfUser(int userId, int roomId, int gameId) { try { using (var db = new connectionsLinqDataContext()) { db.DeleteUserActiveGame(userId, roomId, gameId); } } catch (Exception) { return; } }
public void DeleteUserById(int userId) { try { using (var db = new connectionsLinqDataContext()) { db.DeleteUserById(userId); } } catch (Exception e) { return; } }
public List <SystemLog> GetAllSystemLogs() { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { return(db.SystemLogs.ToList()); } } catch (Exception e) { return(null); } }
public List <TexasHoldem.Database.LinqToSql.Log> GetAllLogs() { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { return(db.Logs.ToList()); } } catch (Exception e) { return(null); } }
public int GetLeagueValByName(string name) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { var temp = db.GetLeageValByName(name); return(temp.First().League_Value); } } catch (Exception e) { return(-1); } }
public int GetGameModeValByName(string v) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { var temp = db.GetGameModeValByName(v); return(temp.First().Game_mode_value); } } catch (Exception e) { return(-1); } }
public bool DeleteGameRoomPref(int roomId) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { db.DeleteGameRoomPref(roomId); return(true); } } catch (Exception e) { return(false); } }
public bool UpdateGameRoomPotSize(int newPot, int roomId) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { db.UpdateGameRoomPotSize(newPot, roomId); return(true); } } catch (Exception e) { return(false); } }
public GetErrorLogByIdResult GetErrorLogById(int logId) { try { using (var db = new connectionsLinqDataContext()) { var res = db.GetErrorLogById(logId).ToList().First(); return(res); } } catch (Exception e) { return(null); } }
/* public LinqToSql.GameRoomPreferance GetPrefByRoomId(int roomId) * { * LinqToSql.GameRoomPreferance toRet = new GameRoomPreferance(); * try * { * using (connectionsLinqDataContext db = new connectionsLinqDataContext()) * { * var temp = db.getga(roomId).ToList(); * foreach (var v in temp) * { * toRet.Game_Id = v.Game_Id; * toRet.Game_Mode = v.Game_Mode; * toRet.is_Spectetor = v.is_Spectetor; * toRet.League_name = v.League_name; * toRet.max_player_in_room = v.max_player_in_room; * toRet.Min_player_in_room = v.Min_player_in_room; * toRet.room_id = v.room_id; * toRet.Sb = v.Sb; * toRet.starting_chip = v.starting_chip; * toRet.enter_paying_money = v.enter_paying_money; * toRet.Bb = v.Bb; * } * return toRet; * } * } * catch (Exception e) * { * return null; * } * }*/ public bool InsertGameRoom(GameRoom toIns) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { db.InsertGameRoomToDb(toIns.RoomId, toIns.GameId, toIns.Replay, toIns.GameXML, toIns.isActive); return(true); } } catch (Exception e) { return(false); } }
public bool UpdateGameRoom(int roomId, int gameId, XElement newXML, bool newIsActive, string newRep) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { string oldRep = db.GetGameRoomReplyById(roomId).First().Replay; db.UpdateGameRoom(roomId, gameId, newXML, newIsActive, string.Concat(oldRep, newRep)); return(true); } } catch (Exception e) { return(false); } }
public void EditPassword(int id, string newPassword) { try { using (var db = new connectionsLinqDataContext()) { var encryptedpassword = PasswordSecurity.Encrypt("securityPassword", newPassword, false); db.EditPassword(id, encryptedpassword); } } catch (Exception) { return; } }
public List <GetUserSpectetorsGameResult> GetUserSpectetorsGameResult(int userId) { List <GetUserSpectetorsGameResult> toReturn = new List <GetUserSpectetorsGameResult>(); try { using (var db = new connectionsLinqDataContext()) { toReturn = db.GetUserSpectetorsGame(userId).ToList(); return(toReturn); } } catch (Exception) { return(toReturn); } }
public bool InsertPref(GameRoomPreferance toAdd) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { db.InsertPrefToDb(toAdd.Roomid, toAdd.CanSpectate, toAdd.MinPlayers, toAdd.MaxPlayers, toAdd.BuyInPolicy, toAdd.EnterGamePolicy, toAdd.MinBet, toAdd.League, toAdd.GameMode, toAdd.GameId, toAdd.PotSize); return(true); } } catch (Exception e) { return(false); } }
public void AddNewUser(UserTable toAddUser) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { var encryptedpassword = PasswordSecurity.Encrypt("securityPassword", toAddUser.password, false); db.AddNewUser(toAddUser.userId, toAddUser.username, toAddUser.name, toAddUser.email, encryptedpassword, toAddUser.avatar, toAddUser.points, toAddUser.money, toAddUser.gamesPlayed, toAddUser.leagueName, toAddUser.winNum, toAddUser.HighestCashGainInGame, toAddUser.TotalProfit, toAddUser.inActive); //db.UserTables.InsertOnSubmit(toAddUser); // db.SubmitChanges(); } } catch (Exception e) { return; } }
public GameRoomPreferance GetGameRoomPrefById(int roomid) { try { using (connectionsLinqDataContext db = new connectionsLinqDataContext()) { var temp = db.GetGameRoomPrefById(roomid).ToList(); if (temp.Capacity == 0) { return(null); } return(ConvertGamePref(temp.First())); } } catch (Exception e) { return(null); } }