예제 #1
0
        private void OnReportContextQuery(object sender, OVRReportContextQueryArgs e)
        {
            OVRFrame2ModuleEventArgs oEventArgs = new OVRFrame2ModuleEventArgs(OVRFrame2ModuleEventType.emRptContextQuery, e);

            switch (m_emMainFormUI)
            {
            case EMainFormUIType.emWndGeneralData:
                m_EventGeneralData(this, oEventArgs);
                break;

            case EMainFormUIType.emWndRegister:
                m_EventRegister(this, oEventArgs);
                break;

            case EMainFormUIType.emWndDrawArrange:
                m_EventDrawArrange(this, oEventArgs);
                break;

            case EMainFormUIType.emWndMatchSchedule:
                m_EventMatchSchedule(this, oEventArgs);
                break;

            case EMainFormUIType.emWndPluginMgr:
                m_EventPluginMgr(this, oEventArgs);
                break;

            case EMainFormUIType.emWndRankMedal:
                m_EventRankMedal(this, oEventArgs);
                break;
            }
        }
예제 #2
0
        private void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null)
            {
                return;
            }

            switch (args.Name)
            {
            case "SportID":
            {
                if (dgvSportInfo.Visible)
                {
                    if (dgvSportInfo.SelectedRows.Count > 0)
                    {
                        args.Value   = GetCurSelItemID(dgvSportInfo).ToString();
                        args.Handled = true;
                    }
                }
                else
                {
                    args.Value   = GetActiveSport().ToString();
                    args.Handled = true;
                }
                break;
            }

            case "DisciplineID":
            {
                if (dgvDisciplineInfo.Visible)
                {
                    if (dgvDisciplineInfo.SelectedRows.Count > 0)
                    {
                        args.Value   = GetCurSelItemID(dgvDisciplineInfo).ToString();
                        args.Handled = true;
                    }
                }
                else
                {
                    args.Value   = GetCurActivedDisciplineID().ToString();
                    args.Handled = true;
                }
                break;
            }

            case "EventID":
            {
                if (dgvEventInfo.Visible && dgvEventInfo.SelectedRows.Count > 0)
                {
                    args.Value   = GetCurSelItemID(dgvEventInfo).ToString();
                    args.Handled = true;
                }
                break;
            }
            }
        }
예제 #3
0
        public void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null) return;

            switch (args.Name)
            {
                case "MatchID":
                    {
                        args.Value = m_nCurMatchID.ToString();
                        args.Handled = true;
                    }
                    break;
                default:
                    break;
            }
        }
예제 #4
0
        private void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null)
            {
                return;
            }

            switch (args.Name)
            {
            case "DisciplineID":
                args.Value   = m_iActiveDiscipline.ToString();
                args.Handled = true;
                break;

            case "EventID":
            {
                break;
            }
            }
        }
예제 #5
0
        private void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null)
            {
                return;
            }

            if (m_Plugin != null)
            {
                OVRReportContextQueryArgs oArgs      = new OVRReportContextQueryArgs();
                OVRMgr2PluginEventArgs    oEventArgs = new OVRMgr2PluginEventArgs(OVRMgr2PluginEventType.emRptContextQuery, oArgs);

                oArgs.Name = args.Name;
                m_Mgr2PluginEvent(this, oEventArgs);
                if (oArgs.Handled)
                {
                    args.Value   = oArgs.Value;
                    args.Handled = true;
                }
            }
        }
예제 #6
0
        private void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null)
            {
                return;
            }
            switch (args.Name)
            {
            case "MatchID":
            {
                if (GVAR.g_matchID > 0)
                {
                    args.Value   = GVAR.g_matchID.ToString();
                    args.Handled = true;
                }
                break;
            }

            default:
                break;
            }
        }
예제 #7
0
        private void QueryReportContext(OVRReportContextQueryArgs args)
        {
            if (args == null)
            {
                return;
            }

            switch (args.Name)
            {
            case "DisciplineID":
                args.Value   = m_iActiveDiscipline.ToString();
                args.Handled = true;
                break;

            case "EventID":
                if (this.cmbEvent.Visible)
                {
                    args.Value   = this.m_iSelEventID.ToString();
                    args.Handled = true;
                }
                break;

            case "FederationID":
            {
                if (adv_RegisterTree.Visible && adv_RegisterTree.SelectedNode != null)
                {
                    SNodeInfo oneSNodeInfo = (SNodeInfo)adv_RegisterTree.SelectedNode.Tag;
                    if (m_iCurGroupType == 1)
                    {
                        args.Value = oneSNodeInfo.strGroupID;
                    }
                    else
                    {
                        args.Value = "-1";
                    }
                    args.Handled = true;
                }
                break;
            }

            case "NOCID":
            {
                if (adv_RegisterTree.Visible && adv_RegisterTree.SelectedNode != null)
                {
                    SNodeInfo oneSNodeInfo = (SNodeInfo)adv_RegisterTree.SelectedNode.Tag;
                    if (m_iCurGroupType == 2)
                    {
                        args.Value = oneSNodeInfo.strGroupID;
                    }
                    else
                    {
                        args.Value = "-1";
                    }
                    args.Handled = true;
                }
                break;
            }

            case "ClubID":
            {
                if (adv_RegisterTree.Visible && adv_RegisterTree.SelectedNode != null)
                {
                    SNodeInfo oneSNodeInfo = (SNodeInfo)adv_RegisterTree.SelectedNode.Tag;
                    if (m_iCurGroupType == 3)
                    {
                        args.Value = oneSNodeInfo.strGroupID;
                    }
                    else
                    {
                        args.Value = "-1";
                    }
                    args.Handled = true;
                }
                break;
            }

            case "DelegationID":
            {
                if (adv_RegisterTree.Visible && adv_RegisterTree.SelectedNode != null)
                {
                    SNodeInfo oneSNodeInfo = (SNodeInfo)adv_RegisterTree.SelectedNode.Tag;
                    if (m_iCurGroupType == 4)
                    {
                        args.Value = oneSNodeInfo.strGroupID;
                    }
                    else
                    {
                        args.Value = "-1";
                    }
                    args.Handled = true;
                }
                break;
            }

            case "RegisterID":
            {
                if (adv_RegisterTree.Visible && adv_RegisterTree.SelectedNode != null)
                {
                    SNodeInfo oneSNodeInfo = (SNodeInfo)adv_RegisterTree.SelectedNode.Tag;
                    if (oneSNodeInfo.iRegTypeID == 2 || oneSNodeInfo.iRegTypeID == 3)
                    {
                        args.Value = oneSNodeInfo.iRegisterID.ToString();
                    }
                    else
                    {
                        args.Value = "-1";
                    }
                    args.Handled = true;
                }
                break;
            }
            }
        }
예제 #8
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;
            }
            }
        }