Exemple #1
0
        bool IsCorrectStatus(int gvTournamentStatusID, TournamentMatchStatusE tournamentMatchStatusID)
        {
            bool IsTrue = true;
            TournamentMatchStatusE gvTournamentStatusIDE = (TournamentMatchStatusE)Enum.ToObject(typeof(TournamentMatchStatusE), gvTournamentStatusID);

            switch (tournamentMatchStatusID)
            {
            case TournamentMatchStatusE.Absent:
                IsTrue = (gvTournamentStatusIDE == TournamentMatchStatusE.Scheduled) || (gvTournamentStatusIDE == TournamentMatchStatusE.Postpond) ? false : true;
                break;

            case TournamentMatchStatusE.Scheduled:
                break;

            case TournamentMatchStatusE.Postpond:
                IsTrue = gvTournamentStatusIDE == TournamentMatchStatusE.Finsihed || gvTournamentStatusIDE == TournamentMatchStatusE.InProgress ? true : false;
                break;

            case TournamentMatchStatusE.InProgress:
                IsTrue = gvTournamentStatusIDE == TournamentMatchStatusE.Scheduled ? false : true;
                break;

            case TournamentMatchStatusE.Finsihed:
                break;

            default:
                break;
            }
            return(IsTrue);
        }
        private void UpdateMatchStatus(TournamentMatchStatusE tournamentMatchStatusID, string matchStatus)
        {
            if (this.Tournament == null)
            {
                return;
            }
            if (this.Tournament.TournamentID == 0)
            {
                return;
            }

            string matchIDs = string.Empty;

            foreach (DataGridViewRow row in dgvMatches.Rows)
            {
                if (row.Cells["Select"].Value != null)
                {
                    if ((bool)row.Cells["Select"].Value)
                    {
                        if (GridTable.Rows[row.Index]["WhiteUserID"].ToString() != "2" && GridTable.Rows[row.Index]["BlackUserID"].ToString() != "2")
                        {
                            matchIDs += "," + GridTable.Rows[row.Index]["TournamentMatchID"].ToString();
                        }
                    }
                }
            }

            if (matchIDs.Length > 0)
            {
                matchIDs = matchIDs.Remove(0, 1);

                if (MessageForm.Confirm(this.ParentForm, MsgE.ConfirmItemTask, "update match status to ", matchStatus) != DialogResult.Yes)
                {
                    return;
                }

                ProgressForm frmProgress = ProgressForm.Show(this, "Updating match status...");
                DataSet      ds          = SocketClient.UpdateTournamentMatchStatus(tournamentMatchStatusID, this.Tournament.TournamentID, matchIDs);
                frmProgress.Close();

                if (ds != null)
                {
                    if (ds.Tables.Count > 0)
                    {
                        Kv kv = new Kv(ds.Tables[0]);
                        if (kv.GetInt32("Result") > 0)
                        {
                            MessageForm.Error(this.ParentForm, (MsgE)kv.GetInt32("Result"));
                            return;
                        }
                    }
                }
                RefreshGrid();
            }
            else
            {
                MessageForm.Error(this.ParentForm, MsgE.ErrorTournamentMatchStartRequest);
            }
        }
        private void UpdateTournamentMatchStatus(TournamentMatchStatusE tournamentMatchStatusID)
        {
            string matchStatus = string.Empty;

            switch (tournamentMatchStatusID)
            {
            case TournamentMatchStatusE.Scheduled:
                matchStatus = "Scheduled";
                break;

            case TournamentMatchStatusE.InProgress:
                matchStatus = "In Progress";
                break;

            case TournamentMatchStatusE.Finsihed:
                break;

            case TournamentMatchStatusE.Postpond:
                matchStatus = "postponed";
                break;

            case TournamentMatchStatusE.Absent:
                matchStatus = "Absent";
                break;

            case TournamentMatchStatusE.Draw:
                break;

            case TournamentMatchStatusE.WhiteBye:
                matchStatus = "White Bye";
                break;

            case TournamentMatchStatusE.BlackBye:
                matchStatus = "Black Bye";
                break;

            case TournamentMatchStatusE.ForcedWhiteWin:
                matchStatus = "Forced White Win";
                break;

            case TournamentMatchStatusE.ForcedWhiteLose:
                matchStatus = "Forced White Lose";
                break;

            case TournamentMatchStatusE.ForcedDraw:
                matchStatus = "Forced Draw";
                break;

            default:
                break;
            }

            //if (MessageForm.Confirm(this.ParentForm, MsgE.ConfirmItemTask, "update match status to ", matchStatus) == DialogResult.Yes)
            //{
            //    UpdateMatchStatus(tournamentMatchStatusID);
            //}
            UpdateMatchStatus(tournamentMatchStatusID, matchStatus);
        }
        private DataRow GetRow(TournamentMatchStatusE status)
        {
            DataRow[] rows = DataTable.Select("TournamentMatchRuleID = " + status.ToString("d"));

            if (rows.Length > 0)
            {
                return(rows[0]);
            }

            return(null);
        }
        public static DataSet UpdateTournamentMatchStatus(TournamentMatchStatusE tournamentMatchStatusID, int tournamentID, string matchIDs)
        {
            Kv kv = new Kv();

            kv.Set("MethodName", (int)MethodNameE.UpdateTournamentMatchStatus);
            kv.Set(StdKv.CurrentUserID, Ap.CurrentUserID);
            kv.Set("TournamentMatchStatusID", tournamentMatchStatusID.ToString("d"));
            kv.Set("TournamentID", tournamentID);
            kv.Set("MatchIDs", matchIDs);

            DataSet ds = SocketClient.Instance.Invoke(kv.DataTable);

            return(ds);
        }
Exemple #6
0
        public static void UpdateStatus(Cxt cxt, TournamentMatchStatusE tournamentMatchStatusID, string tournamentMatchIDs, GameResultE gameResultID)
        {
            SqlTransaction trans = null;

            try
            {
                trans = SqlHelper.BeginTransaction(Config.ConnectionString);

                UpdateStatus(trans, cxt, tournamentMatchStatusID, tournamentMatchIDs, gameResultID);

                SqlHelper.CommitTransaction(trans);
            }
            catch (Exception ex)
            {
                SqlHelper.RollbackTransaction(trans);
                Log.Write(cxt, ex);
            }
        }
Exemple #7
0
        public static GameResultE GetGameResultID(TournamentMatchStatusE tournamentMatchStatusIDE)
        {
            switch (tournamentMatchStatusIDE)
            {
            case TournamentMatchStatusE.None:
                return(GameResultE.None);

            case TournamentMatchStatusE.Scheduled:
                return(GameResultE.None);

            case TournamentMatchStatusE.InProgress:
                return(GameResultE.InProgress);

            case TournamentMatchStatusE.Finsihed:
                return(GameResultE.None);

            case TournamentMatchStatusE.Postpond:
                return(GameResultE.NoResult);

            case TournamentMatchStatusE.Absent:
                return(GameResultE.Absent);

            case TournamentMatchStatusE.Draw:
                return(GameResultE.Draw);

            case TournamentMatchStatusE.WhiteBye:
                return(GameResultE.WhiteBye);

            case TournamentMatchStatusE.BlackBye:
                return(GameResultE.BlackBye);

            case TournamentMatchStatusE.ForcedWhiteWin:
                return(GameResultE.ForcedWhiteWin);

            case TournamentMatchStatusE.ForcedWhiteLose:
                return(GameResultE.ForcedWhiteLose);

            case TournamentMatchStatusE.ForcedDraw:
                return(GameResultE.ForcedDraw);

            default:
                return(GameResultE.None);
            }
        }
Exemple #8
0
        public static Kv UpdateTournamentMatchStatus(Cxt cxt, int tournamentID, TournamentMatchStatusE tournamentMatchStatusID, TournamentMatches matches)
        {
            Kv  kv     = new Kv();
            int result = 0;

            if (tournamentMatchStatusID == TournamentMatchStatusE.InProgress)
            {
                result = GetRoundInprogress(cxt, tournamentID, matches);
                if (result > 0)
                {
                    kv.Set("Result", result);
                    return(kv);
                }
            }
            DataTable dt = new DataTable("TournamentMatchResult");

            dt.Columns.Add("Round", typeof(Int32));
            dt.Columns.Add("TournamentMatchID", typeof(Int32));
            dt.Columns.Add("Player1", typeof(Int32));
            dt.Columns.Add("Player2", typeof(Int32));

            for (int i = 0; i < matches.Count; i++)
            {
                result = 0;

                TournamentMatch item = matches[i];


                if (tournamentMatchStatusID == TournamentMatchStatusE.InProgress)
                {
                    result = IsPlayerAvailable(cxt, item);
                }

                if (result == 0)
                {
                    UpdateTournamentMatchStatus(cxt, tournamentMatchStatusID, item);
                    dt.Rows.Add(item.Round, item.TournamentMatchID, item.WhiteUserID, item.BlackUserID);
                }
            }
            kv.Set("TournamentMatchResult", UData.ToString(dt));
            kv.Set("Result", result);

            return(kv);
        }
Exemple #9
0
        public static void UpdateStatus(SqlTransaction trans, Cxt cxt, TournamentMatchStatusE tournamentMatchStatusID, string tournamentMatchIDs, GameResultE gameResultID)
        {
            StringBuilder sb = new StringBuilder();

            BaseCollection.Execute(trans, "UpdateTournamentMatchStatus",
                                   tournamentMatchIDs,
                                   tournamentMatchStatusID.ToString("d"),
                                   gameResultID.ToString("d"),
                                   cxt.CurrentUserID
                                   );

            if (tournamentMatchStatusID != TournamentMatchStatusE.Scheduled &&
                tournamentMatchStatusID != TournamentMatchStatusE.Absent)
            {
                BaseCollection.Execute(trans, "UpdateTournamentChallengeStatus",
                                       tournamentMatchIDs,
                                       StatusE.Deleted.ToString("d"),
                                       cxt.CurrentUserID);
            }
        }
        private void tsbEditMatch_Click(object sender, EventArgs e)
        {
            int rowIndex = -1;

            int counter = 0;

            foreach (DataGridViewRow row in dgvMatches.Rows)
            {
                if (row.Cells["Select"].Value != null)
                {
                    if ((bool)row.Cells["Select"].Value)
                    {
                        counter++;
                        if (counter > 1)
                        {
                            MessageForm.Error(this.ParentForm, MsgE.ErrorMultipleItemsNotAllowed);
                            return;
                        }
                        rowIndex = row.Index; //Convert.ToInt32(GridTable.Rows[row.Index]["TournamentMatchID"]);
                    }
                }
            }

            if (counter == 0)
            {
                MessageForm.Error(this.ParentForm, MsgE.ErrorNoSelection, "match");
                return;
            }

            TournamentMatchStatusE tms = (TournamentMatchStatusE)Convert.ToInt32(GridTable.Rows[rowIndex]["TournamentMatchStatusID"]);

            if (tms != TournamentMatchStatusE.Scheduled)
            {
                MessageForm.Error(this.ParentForm, MsgE.ErrorTournamentMatchNotInStatus, "Scheduled");
                return;
            }

            EditMatch(rowIndex);
        }
Exemple #11
0
        public void CreateChallange(TournamentMatchStatusE tournamentMatchStatusIDE)
        {
            bool isTrue = false;

            int    i        = 0;
            string matchIDs = string.Empty;

            foreach (DataGridViewRow row in dgvMatches.Rows)
            {
                int chessTypeID = Convert.ToInt32(table.Rows[i]["ChessTypeId"]);

                if (dgvMatches[0, row.Index].State == DataGridViewElementStates.Selected)
                {
                    int matchID = Convert.ToInt32(table.Rows[i]["TournamentMatchID"]);
                    int gvTournamentMatchStatusID = Convert.ToInt32(table.Rows[i]["TournamentMatchStatusID"]);
                    int wRating = Convert.ToInt32(table.Rows[i]["WRating"]);
                    int bRating = Convert.ToInt32(table.Rows[i]["BRating"]);

                    isTrue = !IsCorrectStatus(gvTournamentMatchStatusID, tournamentMatchStatusIDE);
                    if (!isTrue)
                    {
                        continue;
                    }

                    matchIDs += "," + matchID.ToString();
                }
                i++;
            }

            if (matchIDs.Length > 0)
            {
                SocketClient.StartTournamentMaches(TournamentID, matchIDs, tournamentMatchStatusIDE, TeamLooseStatusE.None, GameResultE.None);
            }

            RefreshGrid();
        }
Exemple #12
0
        void TournamentRoundStarted()
        {
            int i = 0, j = 0;

            foreach (DataGridViewRow row in dgvMatches.Rows)
            {
                int gvTournamentMatchStatusID = Convert.ToInt32(table.Rows[i]["TournamentMatchStatusID"]);
                int matchID = Convert.ToInt32(table.Rows[i]["TournamentMatchID"]);

                TournamentMatchStatusE TournamentMatchStatusIDE = (TournamentMatchStatusE)Enum.ToObject(typeof(TournamentMatchStatusE),
                                                                                                        gvTournamentMatchStatusID);

                if (TournamentMatchStatusIDE == TournamentMatchStatusE.InProgress)
                {
                    //RsPanel.ShowMessage(Msg.GetMsg(MsgE.ErrorRoundStarts), true);
                    return;
                }
                i++;
            }

            foreach (DataGridViewRow row in dgvMatches.Rows)
            {
                bool isTrue = false;
                int  gvTournamentMatchStatusID = Convert.ToInt32(table.Rows[i]["TournamentMatchStatusID"]);

                int round = Convert.ToInt32(table.Rows[j]["Round"]);

                TournamentMatchStatusE TournamentMatchStatusIDE = (TournamentMatchStatusE)Enum.ToObject(typeof(TournamentMatchStatusE),
                                                                                                        gvTournamentMatchStatusID);

                if (TournamentMatchStatusIDE == TournamentMatchStatusE.Scheduled)
                {
                    DataView dv = table.DefaultView;

                    dv.RowFilter = "Round = " + round.ToString();

                    foreach (DataRow item in dv.ToTable().Rows)
                    {
                        int wRating = 0, bRating = 0, matchStatus = 0;
                        matchStatus = (item["TournamentMatchStatusID"] != DBNull.Value) ? Convert.ToInt32(item["TournamentMatchStatusID"]) : 0;
                        int matchID = (item["TournamentMatchID"] != DBNull.Value) ? Convert.ToInt32(item["TournamentMatchID"]) : 0;
                        TournamentMatchStatusE TournamentMatchStatusID = (TournamentMatchStatusE)Enum.ToObject(typeof(TournamentMatchStatusE), matchStatus);

                        if (TournamentMatchStatusID == TournamentMatchStatusE.Scheduled)
                        {
                            wRating = (item["WRating"] != DBNull.Value) ? Convert.ToInt32(item["WRating"]) : 0;
                            bRating = (item["BRating"] != DBNull.Value) ? Convert.ToInt32(item["BRating"]) : 0;
                            //GetTournamentMatch(TournamentMatchStatusE.InProgress, wRating, bRating, false, RsToolbarButton.StartRound);
                            isTrue = true;
                        }
                    }
                    if (isTrue)
                    {
                        //StartMatches(false, RsToolbarButton.StartRound);
                        return;
                    }
                    else
                    {
                        //RsPanel.ShowMessage(Msg.GetMsg(MsgE.ErrorMatchStarts), true);
                    }
                }
                j++;
            }
        }
Exemple #13
0
        //public static void UpdateTournamentMatchStatus(Cxt cxt, int tournamentID, int tournamentMatchStatusID, string matchIDs)
        //{

        //    string[] matches = matchIDs.Split(',');

        //    foreach (string item in matches)
        //    {
        //        UpdateTournamentMatchStatus(cxt, tournamentMatchStatusID, Convert.ToInt32(item));
        //    }
        //}

        #region Update Match Status

        public static void UpdateTournamentMatchStatus(Cxt cxt, TournamentMatchStatusE tournamentMatchStatusID, TournamentMatch m)
        {
            SqlTransaction t = null;
            Game           g = null;
            Challenge      c = null;

            DataTable         dtMatches = TournamentMatches.GetTournamentsMatchByTournamentID(m.TournamentID);
            TournamentMatches matches   = new TournamentMatches(cxt, dtMatches);
            DataTable         dtGame    = Games.GetAllGamesByTournamentID(cxt, m.TournamentID);

            DataTable dtTUser = TournamentUsers.GetTournamentUsersByTournamentID(StatusE.Active, m.TournamentID);

            try
            {
                if (!TournamentMatchRules.Instance.CanChangeStatus(m.TournamentMatchStatusE, tournamentMatchStatusID))
                {
                    return;
                }

                m.EloBlackBefore         = (m.EloBlackBefore == 0) ? 1500 : m.EloBlackBefore;
                m.EloWhiteBefore         = (m.EloWhiteBefore == 0) ? 1500 : m.EloWhiteBefore;
                m.TournamentMatchStatusE = tournamentMatchStatusID;

                if (GetGameResultID((TournamentMatchStatusE)tournamentMatchStatusID) != GameResultE.None)
                {
                    m.GameResultIDE = GetGameResultID((TournamentMatchStatusE)tournamentMatchStatusID);
                }

                if (m.TournamentMatchStatusE == TournamentMatchStatusE.InProgress || m.IsBye || m.IsForced)
                {
                    c = CreateChallenge(m);
                }

                t = SqlHelper.BeginTransaction(Config.ConnectionString);

                m.Save(t);

                if (c != null)
                {
                    if (c.IsNew)
                    {
                        c.Save(t);
                    }
                }

                if (m.IsBye || m.IsForced)
                {
                    if (c != null)
                    {
                        c.ChallengeStatusIDE = ChallengeStatusE.Decline;
                        c.StatusIDE          = StatusE.Inactive;
                        c.Save(t);
                    }

                    TournamentUserResult(cxt, dtTUser, m, matches, dtGame).Save(t);

                    g = GetGame(cxt, m);

                    if (!g.IsNew)
                    {
                        g.GameResultIDE = m.GameResultIDE;
                        g.GameFlags     = "";
                        g.Save(t);
                    }
                }

                SqlHelper.CommitTransaction(t);

                switch (m.TournamentMatchStatusE)
                {
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    TournamentMatch.CreateChildMatchIfRequired(cxt, m, dtTUser);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                SqlHelper.RollbackTransaction(t);
                Log.Write(cxt, ex);
            }
        }
        public TournamentMatchRule GetTournamentMatchRule(TournamentMatchStatusE status)
        {
            TournamentMatchRule item = new TournamentMatchRule(this.Cxt, GetRow(status));

            return(item);
        }
        public bool CanChangeStatus(TournamentMatchStatusE currentStatusID, TournamentMatchStatusE requiredStatusID)
        {
            TournamentMatchRule item = GetTournamentMatchRule(currentStatusID);

            return(item.GetColInt32(requiredStatusID.ToString()) == 1);
        }
        private void CreateTournamentRounds()
        {
            if (this.Tournament == null)
            {
                return;
            }

            if (this.Tournament.TournamentID == 0)
            {
                return;
            }

            string msgID  = string.Empty;
            bool   isTrue = false;
            int    round  = 0;

            if (table != null)
            {
                if (table.Rows.Count > 0)
                {
                    foreach (DataRow item in table.Rows)
                    {
                        TournamentMatchStatusE ts = (TournamentMatchStatusE)Convert.ToInt32(item["TournamentMatchStatusID"]);


                        if (ts != TournamentMatchStatusE.Finsihed && ts != TournamentMatchStatusE.Absent &&
                            Tournament.TournamentTypeIDE != TournamentTypeE.Knockout && Tournament.TournamentTypeIDE != TournamentTypeE.Swiss)
                        {
                            isTrue = true;
                        }

                        round = GetRoundNo(item["Round"].ToString());
                    }

                    if (isTrue)
                    {
                        MessageForm.Show(ParentForm, MsgE.ErrorTournamentNextRoundStarted);
                    }
                    else
                    {
                        DataSet ds = SocketClient.CreateTournamentRounds(Tournament.TournamentID, round + 1);

                        if (ds != null)
                        {
                            if (ds.Tables.Count > 0)
                            {
                                Kv kv = new Kv(ds.Tables[0]);
                                if (kv.GetInt32("Result") > 0)
                                {
                                    MessageForm.Error(this.ParentForm, (MsgE)kv.GetInt32("Result"));
                                    return;
                                }
                            }
                        }

                        if (this.Tournament.TournamentTypeE != TournamentTypeE.Swiss)
                        {
                            //Tournament.TournamentCurrentRound = round + 1;
                        }
                    }
                }
            }
            RefreshGrid();
        }
Exemple #17
0
        /*
         *                      S	P	F	PP	A	D	WB	BB	FW	FL	FD
         *  Scheduled		X		X	X		X	X	X	X	X
         *  In Progress							X	X	X	X	X
         *  Finsihed									X	X	X
         *  Postpond	    X
         *  Absent	        X						X	X	X	X	X
         *  Draw									X	X	X
         *  WhiteBye	    X							X	X	X	X
         *  BlackBye	    X						X		X	X	X
         *  Forced White Win									X	X
         *  Forced White Lose								X		X
         *  Forced Draw                                     X	X
         */
        public static bool CanChangeStatus(TournamentMatchStatusE currentStatusID, TournamentMatchStatusE requiredStatusID)
        {
            switch (currentStatusID)
            {
            case TournamentMatchStatusE.None:
                return(false);

            case TournamentMatchStatusE.Scheduled:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Scheduled:
                    return(false);

                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.InProgress:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                    return(false);

                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.Finsihed:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                    return(false);

                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.Postpond:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Postpond:
                    return(false);

                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.Absent:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                    return(false);

                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.Draw:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedDraw:
                    return(false);

                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.WhiteBye:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.WhiteBye:
                    return(false);

                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.BlackBye:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.BlackBye:
                    return(false);

                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.ForcedWhiteWin:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.ForcedWhiteWin:
                    return(false);

                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.Postpond:
                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.ForcedWhiteLose:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.ForcedWhiteLose:
                    return(false);

                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.WhiteBye:
                case TournamentMatchStatusE.ForcedDraw:
                    return(true);
                }
                #endregion
                break;

            case TournamentMatchStatusE.ForcedDraw:
                #region Check Required
                switch (requiredStatusID)
                {
                case TournamentMatchStatusE.None:
                case TournamentMatchStatusE.InProgress:
                case TournamentMatchStatusE.Finsihed:
                case TournamentMatchStatusE.Draw:
                case TournamentMatchStatusE.ForcedDraw:
                case TournamentMatchStatusE.Scheduled:
                case TournamentMatchStatusE.Postpond:
                    return(false);

                case TournamentMatchStatusE.Absent:
                case TournamentMatchStatusE.BlackBye:
                case TournamentMatchStatusE.ForcedWhiteWin:
                case TournamentMatchStatusE.ForcedWhiteLose:
                case TournamentMatchStatusE.WhiteBye:
                    return(true);
                }
                #endregion
                break;
            }

            return(false);
        }