Пример #1
0
        public void OnMatchChanged(Int32 iWndMode)
        {
            dgvStatItemRefersh();

            btnsStatAutoRefresh.Checked = true;
            btnsStatSet1.Checked        = false;
            btnsStatSet2.Checked        = false;
            btnsStatSet3.Checked        = false;
            btnsStatSet4.Checked        = false;
            btnsStatSet5.Checked        = false;
            btnStatWorkType.Text        = "Auto refresh";
            btnStatWorkType.ForeColor   = Color.Blue;

            DataTable tbl = Common.dbGetMatchInfo(Common.g_nMatchID, Common.g_strLanguage);

            if (tbl != null)
            {
                //比分模块中的NOC
                dgvMatchScore[0, 1].Value = tbl.Rows[0]["F_TeamANameL"].ToString();
                dgvMatchScore[0, 2].Value = tbl.Rows[0]["F_TeamBNameL"].ToString();

                labNocA.Text = tbl.Rows[0]["F_TeamANameL"].ToString();
                labNocB.Text = tbl.Rows[0]["F_TeamBNameL"].ToString();

                _tabHeaderTeamA.Text = "STAT-" + tbl.Rows[0]["F_TeamANameL"].ToString();
                _tabHeaderTeamB.Text = "STAT-" + tbl.Rows[0]["F_TeamBNameL"].ToString();
                labMatchInfo.Text    = "PlugIn:" + (Common.g_isVB ? "VB" : "BV") +
                                       tbl.Rows[0]["F_MatchDesc"];

                //比分模块中的IRM
//				dgvMatchScore[1, 1].Value = tbl.Rows[0]["F_IRMCodeA"].ToString();
//				dgvMatchScore[1, 2].Value = tbl.Rows[0]["F_IRMCodeB"].ToString();
            }
            else
            {
                dgvMatchScore[0, 1].Value = "";
                dgvMatchScore[0, 2].Value = "";
            }

            btnMainRefresh_Click(null, null);
            btnMainSendMessage_Click(null, null);

            this.Enabled             = true;
            m_timerDbRefresh.Enabled = true;

            return;
        }
Пример #2
0
        public frmTeamMemberEntry(int nMatchID, String strLangCode)
        {
            InitializeComponent();

            if (nMatchID <= 0 || strLangCode.Length == 0)
            {
                Debug.Assert(false);
                return;
            }

            DataTable tbl = Common.dbGetMatchInfo(Common.g_nMatchID, Common.g_strLanguage);

            if (tbl == null || tbl.Rows.Count < 1 || tbl.Columns.Count < 1)
            {
                return;
            }

            m_iMatchID         = Common.Str2Int(tbl.Rows[0]["F_MatchID"]);
            m_iHomeRegisterID  = Common.Str2Int(tbl.Rows[0]["F_TeamARegID"]);
            m_iVisitRegisterID = Common.Str2Int(tbl.Rows[0]["F_TeamBRegID"]);
            m_strHomeName      = tbl.Rows[0]["F_TeamAName"].ToString();
            m_strVisitName     = tbl.Rows[0]["F_TeamBName"].ToString();
        }
        public bool dgvMatchScoreRefresh(GameGeneralBall gameObj = null)
        {
            if (gameObj == null)
            {
                gameObj = Common.g_Game;
            }

            dgvMatchScore[2, 1].Value = gameObj.IsServeTeamB() ? "" : "●";
            dgvMatchScore[2, 2].Value = gameObj.IsServeTeamB() ? "●" : "";

            dgvMatchScore[3, 1].Value = gameObj.GetScoreSetStr(false, 1);
            dgvMatchScore[3, 2].Value = gameObj.GetScoreSetStr(true, 1);
            dgvMatchScore[4, 1].Value = gameObj.GetScoreSetStr(false, 2);
            dgvMatchScore[4, 2].Value = gameObj.GetScoreSetStr(true, 2);
            dgvMatchScore[5, 1].Value = gameObj.GetScoreSetStr(false, 3);
            dgvMatchScore[5, 2].Value = gameObj.GetScoreSetStr(true, 3);
            dgvMatchScore[6, 1].Value = gameObj.GetScoreSetStr(false, 4);
            dgvMatchScore[6, 2].Value = gameObj.GetScoreSetStr(true, 4);
            dgvMatchScore[7, 1].Value = gameObj.GetScoreSetStr(false, 5);
            dgvMatchScore[7, 2].Value = gameObj.GetScoreSetStr(true, 5);
            dgvMatchScore[8, 1].Value = gameObj.GetScoreMatchStr(false);
            dgvMatchScore[8, 2].Value = gameObj.GetScoreMatchStr(true);

            dgvMatchScore[3, 1].Style.ForeColor = gameObj.GetWinSet(1) == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[3, 2].Style.ForeColor = gameObj.GetWinSet(1) == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[4, 1].Style.ForeColor = gameObj.GetWinSet(2) == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[4, 2].Style.ForeColor = gameObj.GetWinSet(2) == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[5, 1].Style.ForeColor = gameObj.GetWinSet(3) == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[5, 2].Style.ForeColor = gameObj.GetWinSet(3) == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[6, 1].Style.ForeColor = gameObj.GetWinSet(4) == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[6, 2].Style.ForeColor = gameObj.GetWinSet(4) == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[7, 1].Style.ForeColor = gameObj.GetWinSet(5) == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[7, 2].Style.ForeColor = gameObj.GetWinSet(5) == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[8, 1].Style.ForeColor = gameObj.GetWinMatch() == EGbTeam.emTeamA ? ClrScr_Win : ClrScr_Nor;
            dgvMatchScore[8, 2].Style.ForeColor = gameObj.GetWinMatch() == EGbTeam.emTeamB ? ClrScr_Win : ClrScr_Nor;

            dgvMatchScore[3, 3].Value = gameObj.GetTimeSetStr(1);
            dgvMatchScore[4, 3].Value = gameObj.GetTimeSetStr(2);
            dgvMatchScore[5, 3].Value = gameObj.GetTimeSetStr(3);
            dgvMatchScore[6, 3].Value = gameObj.GetTimeSetStr(4);
            dgvMatchScore[7, 3].Value = gameObj.GetTimeSetStr(5);
            dgvMatchScore[8, 3].Value = gameObj.GetTimeMatchStr();

            Int32 nCurSet = gameObj.GetCurSet();

            dgvMatchScore[3, 0].Value = (nCurSet == 1) ? "●" : "";
            dgvMatchScore[4, 0].Value = (nCurSet == 2) ? "●" : "";
            dgvMatchScore[5, 0].Value = (nCurSet == 3) ? "●" : "";
            dgvMatchScore[6, 0].Value = (nCurSet == 4) ? "●" : "";
            dgvMatchScore[7, 0].Value = (nCurSet == 5) ? "●" : "";

            DataTable tblMatchInfo = Common.dbGetMatchInfo(Common.g_nMatchID, Common.g_strLanguage);

            if (tblMatchInfo != null)
            {
                dgvMatchScore[1, 1].Value = tblMatchInfo.Rows[0]["F_IRMCodeA"].ToString();
                dgvMatchScore[1, 2].Value = tblMatchInfo.Rows[0]["F_IRMCodeB"].ToString();
            }

            dgvMatchScore[8, 0].Value = gameObj.GetPointInfo().GetCountStr() + ' ' + gameObj.GetPointInfo().GetPointStr();

            return(true);
        }
Пример #4
0
        protected override void OnMgrEvent(object sender, OVRMgr2PluginEventArgs e)
        {
            switch (e.Type)
            {
            case OVRMgr2PluginEventType.emMatchSelected:                        //选择比赛时
            {
                if (m_frmPlugin.Enabled)
                {
                    if (MessageBox.Show("直接切换比赛?", "切换比赛", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                    {
                        return;
                    }
                }

                int nMatchID = Common.Str2Int(e.Args.ToString());
                if (nMatchID <= 0)
                {
                    Debug.Assert(false);
                    return;
                }

                DataTable tblMatch = Common.dbGetMatchInfo(nMatchID, Common.g_strLanguage);
                if (tblMatch == null || tblMatch.Rows.Count < 1 || tblMatch.Columns.Count < 1)
                {
                    MessageBox.Show("exec proc_VB_PRG_MatchInfo failed.\n读取新比赛基础数据失败! 未切换比赛!");
                    return;
                }

                Int32  nDisciplineID = Common.Str2Int(tblMatch.Rows[0]["F_DisciplineID"]);
                Int32  nEventID      = Common.Str2Int(tblMatch.Rows[0]["F_EventID"]);
                Int32  nTeamRegIDA   = Common.Str2Int(tblMatch.Rows[0]["F_TeamARegID"]);
                Int32  nTeamRegIDB   = Common.Str2Int(tblMatch.Rows[0]["F_TeamBRegID"]);
                String strTeamANoc   = tblMatch.Rows[0]["F_TeamANoc"].ToString();
                String strTeamBNoc   = tblMatch.Rows[0]["F_TeamBNoc"].ToString();
                String strTeamAName  = tblMatch.Rows[0]["F_TeamAName"].ToString();
                String strTeamBName  = tblMatch.Rows[0]["F_TeamBName"].ToString();
                String strVenue      = tblMatch.Rows[0]["F_VenueDes"].ToString();

                if (nDisciplineID <= 0 || nEventID <= 0)
                {
                    MessageBox.Show("SprotID,nDispID,nEventID不正确! 未切换比赛!");
                    return;
                }

                if (nTeamRegIDA <= 0 || nTeamRegIDB <= 0)
                {
                    MessageBox.Show("该场比赛未指派双方队伍! 未切换比赛!");
                    return;
                }

                if (strVenue.Length == 0)
                {
                    if (MessageBox.Show("该比赛未指定场馆,是否继续?", "切换比赛", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                    {
                        return;
                    }
                }

                //如果是新建比赛,通过GameObject写入一次库
                int nCretaeMatchResult = Common.dbInitMatch(nMatchID, 5, false);
                if (nCretaeMatchResult == 0)
                {
                    MessageBox.Show("exec proc_VB_PRG_MatchCreate failed.\n在数据库中初始化新比赛局信息失败! 未切换比赛!");
                    return;
                }
                else if (nCretaeMatchResult == 1)
                {
                    GameGeneralBall newGameObj = new GameGeneralBall();
                    if (!Common.dbGetMatch2GameObj(nMatchID, ref newGameObj))
                    {
                        MessageBox.Show("exec proc_VB_PRG_MatchInfo failed.\n读取新比赛比分数据失败! 未切换比赛!");
                        //以后改成强行重置选项
                        return;
                    }

                    //再往库中写一次,是为了避免第一次进入比赛后,没有局标示的问题5
                    if (!Common.dbGameObj2Db(nMatchID, newGameObj))
                    {
                        MessageBox.Show("exec proc_VB_PRG_MatchSetScore failed.\n写入新比分数据失败! 未切换比赛!");
                        return;
                    }
                }

                GameGeneralBall gameObj = new GameGeneralBall();
                if (!Common.dbGetMatch2GameObj(nMatchID, ref gameObj))
                {
                    MessageBox.Show("exec proc_VB_PRG_MatchInfo failed.\n读取比赛比分数据失败! 未切换比赛!");
                    return;
                }

                //开始切换比赛
                Common.g_Game        = gameObj;
                Common.g_nDiscID     = nDisciplineID;
                Common.g_nEventID    = nEventID;
                Common.g_nMatchID    = nMatchID;
                Common.g_nTeamRegIDA = nTeamRegIDA;
                Common.g_nTeamRegIDB = nTeamRegIDB;
                Common.g_strNocA     = strTeamANoc;
                Common.g_strNocB     = strTeamBNoc;

                SetReportContext("MatchID", Common.g_nMatchID.ToString());

                m_frmPlugin.OnMatchChanged(0);

                break;
            }

            case OVRMgr2PluginEventType.emRptContextQuery:
            {
                if (e == null || e.Args == null)
                {
                    return;
                }

                OVRReportContextQueryArgs rptQuery = e.Args as OVRReportContextQueryArgs;

                switch (rptQuery.Name)
                {
                case "MatchID":
                {
                    rptQuery.Value   = Common.g_nMatchID.ToString();
                    rptQuery.Handled = true;
                }
                break;

                case "DisciplineID":
                {
                    rptQuery.Value   = Common.g_nDiscID.ToString();
                    rptQuery.Handled = true;
                }
                break;

                default:
                    break;
                }

                break;
            }
            }
        }