예제 #1
0
        public static DialogResult Show(Form owner, int moveID, int tournamentMatchID, int challengerUserID, int opponentUserID,
                                        int wMin, int wSec, int bMin, int bSec, bool isTournamentDirector)
        {
            SetupMatch frm = new SetupMatch();

            frm.setupMatchUc2.TournamentMatchID = tournamentMatchID;
            frm.setupMatchUc2.ChallengerUserID  = challengerUserID;
            frm.setupMatchUc2.OpponentUserID    = opponentUserID;
            frm.setupMatchUc2.MoveID            = moveID;
            frm.setupMatchUc2.WMin = wMin;
            frm.setupMatchUc2.WSec = wSec;
            frm.setupMatchUc2.BMin = bMin;
            frm.setupMatchUc2.BSec = bSec;
            frm.setupMatchUc2.IsTournamentDirector = isTournamentDirector;
            return(frm.ShowDialog(owner));
        }
        private void tsRestartMatchSetup_Click(object sender, EventArgs e)
        {
            if (dgvMatches.RowCount <= 0)
            {
                return;
            }

            if (this.Tournament == null)
            {
                return;
            }

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

            if (this.Tournament.TournamentStatusIDE != TournamentStatusE.InProgress)
            {
                return;
            }

            int senderUserID   = 0;
            int receiverUserID = 0;

            bool            IsRestartTournamentDirector = false;
            TournamentMatch tm = GetOpponentAndChallenger(ref IsRestartTournamentDirector);

            if (tm != null)
            {
                senderUserID   = Ap.CurrentUserID;
                receiverUserID = tm.OpponentUserID(Ap.CurrentUserID);

                if (Ap.Game != null)
                {
                    Ap.Game.Pause();
                }

                if (receiverUserID > 0 && tm.TournamentMatchID > 0)
                {
                    DialogResult dr = SetupMatch.Show(this.ParentForm, 0, tm.TournamentMatchID, senderUserID, receiverUserID, 0, 0, 0, 0, IsRestartTournamentDirector);
                }
            }
        }