Ejemplo n.º 1
0
        public static Room GetRoomByTournamentID(Cxt cxt, ChessTypeE chessTypeE)
        {
            Room Room = null;

            if (chessTypeE == ChessTypeE.Human)
            {
                Room = new Room(cxt, BaseCollection.SelectItem(InfiChess.Room, "ParentID = 7 and (TournamentID is NULL or TournamentID = 0) "));
            }
            else if (chessTypeE == ChessTypeE.Engine)
            {
                Room = new Room(cxt, BaseCollection.SelectItem(InfiChess.Room, "ParentID = 12 and (TournamentID is NULL or TournamentID = 0) "));
            }
            return(Room);
        }
Ejemplo n.º 2
0
        public static Challenge CreateChallenge(TournamentMatch m)
        {
            Challenge c = new Challenge(m.Cxt, BaseCollection.SelectItem(InfiChess.Challenge, "TournamentMatchID", m.TournamentMatchID));

            c.ChallengerUserID      = m.WhiteUserID;
            c.OpponentUserID        = m.BlackUserID;
            c.ChessTypeIDE          = m.Tournament.ChessTypeIDE;
            c.ChallengeTypeIDE      = ChallengeTypeE.Challenge;
            c.IsRated               = m.Tournament.Rated;
            c.WithClock             = true;
            c.IsChallengerSendsGame = false;
            c.GameTypeIDE           = Game.GetGameType(m.TimeMin, m.TimeSec);
            c.ColorIDE              = ColorE.White;
            c.TournamentMatchID     = m.TournamentMatchID;

            if (m.TournamentMatchTypeE == TournamentMatchTypeE.SuddenDeath)
            {
                Tournament t = new Tournament(m.Cxt, m.TournamentID);
                c.TimeMin        = t.SuddenDeathWhiteMin;
                c.GainPerMoveMin = t.SuddenDeathSec;
            }
            else
            {
                c.TimeMin        = m.TimeMin;
                c.GainPerMoveMin = m.TimeSec;
            }

            if (m.Tournament.RoomID > 0)
            {
                c.RoomID = m.Tournament.RoomID;
            }

            if (m.IsNotBye)
            {
                c.ChallengeStatusIDE = ChallengeStatusE.Seeking;
                c.StatusIDE          = StatusE.Active;
            }
            else
            {
                c.ChallengeStatusIDE = ChallengeStatusE.Accepted;
                c.StatusIDE          = StatusE.Inactive;
            }

            return(c);
        }
Ejemplo n.º 3
0
 public static UserVoucher GetUserVoucher(Cxt cxt, int orderID)
 {
     return(new UserVoucher(cxt, BaseCollection.SelectItem(InfiChess.UserVoucher, orderID)));
 }
 public static TournamentWantinUser GetTournamentWantinUserById(Cxt cxt, int tournamentWantinUserId)
 {
     return(new TournamentWantinUser(cxt, BaseCollection.SelectItem(InfiChess.TournamentWantinUser, tournamentWantinUserId)));
 }
Ejemplo n.º 5
0
 public static UserMessage GetMessageById(Cxt cxt, int userMessageId)
 {
     return(new UserMessage(cxt, BaseCollection.SelectItem(InfiChess.UserMessage, userMessageId)));
 }
Ejemplo n.º 6
0
 public static Challenge GetChallangeById(Cxt cxt, int challengeID)
 {
     return(new Challenge(cxt, BaseCollection.SelectItem(InfiChess.Challenge, challengeID)));
 }
Ejemplo n.º 7
0
 public static Event GetEventByTournamentID(Cxt cxt, int tournamentID)
 {
     return(new Event(cxt, BaseCollection.SelectItem(InfiChess.Event, " EventObjectID= " + tournamentID)));
 }
Ejemplo n.º 8
0
 public static News GetNewsById(Cxt cxt, int newsId)
 {
     return(new News(cxt, BaseCollection.SelectItem(InfiChess.News, newsId)));
 }
Ejemplo n.º 9
0
 public static TournamentMatch GetTournamntMatchByTournamentAndPlayerID(Cxt cxt, int tournamentMatchID)
 {
     return(new TournamentMatch(cxt, BaseCollection.SelectItem(InfiChess.TournamentMatch, tournamentMatchID)));
 }
Ejemplo n.º 10
0
 public static Room GetRoomByTournamentID(Cxt cxt, int tournamentID)
 {
     return(new Room(cxt, BaseCollection.SelectItem(InfiChess.Room, "TournamentID =" + tournamentID)));
 }
Ejemplo n.º 11
0
 public static Room GetRoomByName(Cxt cxt, int roomName)
 {
     return(new Room(cxt, BaseCollection.SelectItem(InfiChess.Room, "Name = " + roomName)));
 }
Ejemplo n.º 12
0
 public static Room GetRoomById(Cxt cxt, int roomId)
 {
     return(new Room(cxt, BaseCollection.SelectItem(InfiChess.Room, roomId)));
 }
Ejemplo n.º 13
0
 public static UserFormula GetUserFormulaByUserID(Cxt cxt, int userID)
 {
     return(new UserFormula(cxt, BaseCollection.SelectItem(InfiChess.UserFormula, "UserID =" + userID)));
 }
Ejemplo n.º 14
0
 public static UserFormula GetUserFormulaById(Cxt cxt, int UserFormulaId)
 {
     return(new UserFormula(cxt, BaseCollection.SelectItem(InfiChess.UserFormula, UserFormulaId)));
 }
Ejemplo n.º 15
0
 public static ScheduledJob GetScheduledJobById(Cxt cxt, int ScheduledJobID)
 {
     return(new ScheduledJob(cxt, BaseCollection.SelectItem(InfiChess.ScheduledJob, ScheduledJobID)));
 }
Ejemplo n.º 16
0
 public static OrderDetail GetOrderDetail(Cxt cxt, int orderID)
 {
     return(new OrderDetail(cxt, BaseCollection.SelectItem(InfiChess.OrderDetail, "OrderID = " + orderID)));
 }
Ejemplo n.º 17
0
 public static BlockedIP GetBlockedIPsById(Cxt cxt, int BlockedIPsId)
 {
     return(new BlockedIP(cxt, BaseCollection.SelectItem(InfiChess.BlockedIP, BlockedIPsId)));
 }
Ejemplo n.º 18
0
 public static Game GetGameByID(Cxt cxt, int tournamentMatchID)
 {
     return(new Game(cxt, BaseCollection.SelectItem(InfiChess.Game, "TournamentMatchID", tournamentMatchID)));
 }
Ejemplo n.º 19
0
 public static Order GetOrderByID(Cxt cxt, int orderID)
 {
     return(new Order(cxt, BaseCollection.SelectItem(InfiChess.Order, orderID)));
 }
Ejemplo n.º 20
0
 public static Event GetEventID(Cxt cxt, int eventID)
 {
     return(new Event(cxt, BaseCollection.SelectItem(InfiChess.Event, eventID)));
 }
Ejemplo n.º 21
0
 public static ServerEventLog GetServerEventLogById(Cxt cxt, int ServerEventLogById)
 {
     return(new ServerEventLog(cxt, BaseCollection.SelectItem(InfiChess.ServerEventLog, ServerEventLogById)));
 }
Ejemplo n.º 22
0
 public static SendMessage GetMessageById(Cxt cxt, int SendMessageId)
 {
     return(new SendMessage(cxt, BaseCollection.SelectItem(InfiChess.SendMessage, SendMessageId)));
 }
Ejemplo n.º 23
0
 private static Game GetGame(Cxt cxt, TournamentMatch m)
 {
     return(new Game(m.Cxt, BaseCollection.SelectItem(InfiChess.Game, "TournamentMatchID", m.TournamentMatchID)));
 }
Ejemplo n.º 24
0
 public static Challenge GetChallangeByMatchId(Cxt cxt, int matchID)
 {
     return(new Challenge(cxt, BaseCollection.SelectItem(InfiChess.Challenge, "TournamentMatchID=" + matchID)));
 }
Ejemplo n.º 25
0
 public static Contact GetContactById(Cxt cxt, int contactID)
 {
     return(new Contact(cxt, BaseCollection.SelectItem(InfiChess.Contact, contactID)));
 }
Ejemplo n.º 26
0
 public static UserMessage GetMessagesByUserID(Cxt cxt, int userID)
 {
     return(new UserMessage(cxt, BaseCollection.SelectItem(InfiChess.UserMessage, "UserIDFrom=" + userID + " OR UserIDTo=" + userID)));
 }
Ejemplo n.º 27
0
 public static TournamentRound GetTournamentRoundById(Cxt cxt, int TournamentRoundId)
 {
     return(new TournamentRound(cxt, BaseCollection.SelectItem(InfiChess.TournamentRound, TournamentRoundId)));
 }
 public static TournamentWantinUser GetTournamentWantinUserById(Cxt cxt, int tournamentID, int userID)
 {
     return(new TournamentWantinUser(cxt, BaseCollection.SelectItem(InfiChess.TournamentWantinUser, "TournamentID = " + tournamentID + " AND UserID = " + userID)));
 }
Ejemplo n.º 29
0
 public static TournamentUser GetTournamentUserById(Cxt cxt, int TournamentID, int UserID)
 {
     return(new TournamentUser(cxt, BaseCollection.SelectItem(InfiChess.TournamentUser, "TournamentID = " + TournamentID + " and UserID = " + UserID)));
 }