コード例 #1
0
ファイル: Game.cs プロジェクト: rafeyhusain/InfinityChess
        public static DataSet GetLastInprogressGame(int userId)
        {
            DataSet ds = BaseCollection.ExecuteDataset("GetLastInprogressGame", userId);

            ds.Tables[0].TableName = "Challenge";
            ds.Tables[1].TableName = "Game";
            ds.Tables[2].TableName = "Users";
            ds.Tables[3].TableName = "Engines";
            ds.Tables[4].TableName = "TournamentMatch";
            ds.Tables[5].TableName = "Tournament";
            return(ds);
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: rafeyhusain/InfinityChess
        public static DataSet GetGameDataByGameID(Cxt cxt, int gameId)
        {
            DataSet ds = new DataSet();

            ds = BaseCollection.ExecuteDataset("GetGameByGameID", gameId);
            ds.Tables[0].TableName = "Challenge";
            ds.Tables[1].TableName = "Game";
            ds.Tables[2].TableName = "Users";
            ds.Tables[3].TableName = "Engines";
            ds.Tables[4].TableName = "TournamentMatch";
            ds.Tables[5].TableName = "Tournament";

            return(ds);
        }
コード例 #3
0
ファイル: Game.cs プロジェクト: rafeyhusain/InfinityChess
        public static DataSet GetGameDataByChallengeID(DataTable dt)
        {
            Kv      kv = new Kv(dt);
            DataSet ds = new DataSet();

            ds = BaseCollection.ExecuteDataset("GetGameByChallengeID", kv.GetInt32("ChallengeID"), kv.GetInt32(StdKv.CurrentUserID));
            ds.Tables[0].TableName = "Challenge";
            ds.Tables[1].TableName = "Game";
            ds.Tables[2].TableName = "Users";
            ds.Tables[3].TableName = "Engines";
            ds.Tables[4].TableName = "TournamentMatch";
            ds.Tables[5].TableName = "Tournament";

            return(ds);
        }
コード例 #4
0
ファイル: Db.cs プロジェクト: rafeyhusain/InfinityChess
        public static DataSet GetDataByRoomID(Cxt cxt, int roomID, int userID, int userStatus, int engineID, bool isFromTimer)
        {
            DataSet   ds = new DataSet();
            DataTable dt = new DataTable();

            if (userID != 0 && !isFromTimer)
            {
                SqlTransaction t = null;
                try
                {
                    t = SqlHelper.BeginTransaction(Config.ConnectionString);
                    Challenges.UpdateChallengesStatus(t, userID);
                    User.UpdatedUserRoom(cxt, t, roomID, userStatus, engineID, userID); //Transaction also commited in this method
                }
                catch (Exception ex)
                {
                    SqlHelper.RollbackTransaction(t);

                    throw ex;
                }
            }

            ds = BaseCollection.ExecuteDataset("ApData", userID, roomID);
            ds.Tables[0].TableName = "Room";
            ds.Tables[1].TableName = "Users";
            ds.Tables[2].TableName = "Games";
            ds.Tables[3].TableName = "Challenges";
            ds.Tables[4].TableName = "RoomUsersCount";
            ds.Tables[5].TableName = "LoggedinUsers";
            ds.Tables[6].TableName = "UserMessages";
            ds.Tables[7].TableName = "Table7";

            dt           = new DataTable();
            dt           = Challenge.GetAcceptedChallenge(cxt, roomID, userID);
            dt.TableName = "AcceptedChallenge";
            ds.Tables.Add(dt.Copy());

            return(ds);
        }
コード例 #5
0
ファイル: Game.cs プロジェクト: rafeyhusain/InfinityChess
 public static DataSet GetGameData(int challengeID, int opponentUserID, int opponentChessTypeID, bool isOfferedReMatch)
 {
     return(BaseCollection.ExecuteDataset("GetGameData", challengeID, opponentUserID, opponentChessTypeID, isOfferedReMatch));
 }
コード例 #6
0
 public static void Add(int userid, string accesscode)
 {
     BaseCollection.ExecuteDataset("AddAccessCode", userid, accesscode);
 }
コード例 #7
0
ファイル: User.cs プロジェクト: rafeyhusain/InfinityChess
        private static DataSet Login(Cxt cxt, string userName, string password, string code, string Ip, string machineCode, DateTime serverDate)
        {
            DataSet ds = BaseCollection.ExecuteDataset("LoginUser", userName, password, code, Ip, machineCode, serverDate);

            return(ds);
        }