Ejemplo n.º 1
0
        private void btnX_MatchSetting_Click(object sender, EventArgs e)
        {
            if (CurMatchInfo.MatchStatusID < 100 && CurMatchInfo.MatchStatusID > 0)
            {
                if (m_nCurMatchID <= 0)
                {
                    return;
                }

                MatchSettingFrom frmMatchSetting = new MatchSettingFrom();
                frmMatchSetting.CurMatchInfo = this.CurMatchInfo;
                frmMatchSetting.ShowDialog();
                if (frmMatchSetting.DialogResult == DialogResult.OK)
                {
                    if (frmMatchSetting.CurMatchInfo.EndCount != CurMatchInfo.EndCount ||
                        frmMatchSetting.CurMatchInfo.ArrowCount != CurMatchInfo.ArrowCount)
                    {
                        this.CurMatchInfo = frmMatchSetting.CurMatchInfo;
                        this.InitMatchUserControl();
                    }
                }
                else if (frmMatchSetting.DialogResult == DialogResult.Yes)
                {
                    this.InitMatchUserControl();
                }
            }
        }
Ejemplo n.º 2
0
        public frmOVRCheckResults(AR_MatchInfo curMatchInfo)
        {
            InitializeComponent();
            Localization();

            m_iMatchID = curMatchInfo.MatchID;
            InitGridStyle();
            InitControlData();
        }
Ejemplo n.º 3
0
        public void OnMsgFlushSelMatch(int nWndMode, int nMatchID)
        {
            if (nMatchID <= 0)
            {
                MessageBoxEx.Show(LocalizationRecourceManager.GetString(GVAR.g_ARPlugin.GetSectionName(), "SelectMatchInfo"));
                return;
            }
            if (nMatchID == m_nCurMatchID)
            {
                return;
            }

            m_nCurMatchID = nMatchID;
            CurMatchInfo  = AREntityOperation.GetCurMatchInfo(nMatchID);

            labX_MatchInfo.Text = CurMatchInfo.GetDisplayName();
            this.UpdateMatchStatus();

            InitMatchUserControl();
        }
Ejemplo n.º 4
0
 private void SettingControlsStatus(AR_MatchInfo matchInfo)
 {
     this.CurMatchInfo = matchInfo;
     if (CurMatchInfo.MatchStatusID <= 40 || CurMatchInfo.MatchStatusID >= 100)
     {
         foreach (DataGridViewColumn col in dgv_PlayerA.Columns)
         {
             col.ReadOnly = true;;
         }
         cbX_Auto.Enabled = false;
     }
     else
     {
         foreach (DataGridViewColumn col in dgv_PlayerA.Columns)
         {
             if (col.Name.Contains("End"))
             {
                 col.ReadOnly = true;
             }
             col.ReadOnly = false;;
         }
         cbX_Auto.Enabled = true;
     }
 }
Ejemplo n.º 5
0
 private void UpdateMatchInfo(AR_MatchInfo curMatchInfo)
 {
     this.CurMatchInfo = curMatchInfo;
 }
Ejemplo n.º 6
0
        public static AR_MatchInfo GetCurMatchInfo(int nMatchID)
        {
            AR_MatchInfo CurMatchInfo = new AR_MatchInfo();

            GVAR.g_ARPlugin.SetReportContext("MatchID", nMatchID.ToString());

            System.Data.DataTable dt = GVAR.g_ManageDB.GetMatchInfo(nMatchID);
            CurMatchInfo.MatchID = nMatchID;

            #region 比赛参数
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["F_PhaseID"] != DBNull.Value)
                {
                    CurMatchInfo.PhaseID = int.Parse(dt.Rows[0]["F_PhaseID"].ToString());
                }
                else
                {
                    CurMatchInfo.PhaseID = -1;
                }

                if (dt.Rows[0]["F_EventID"] != DBNull.Value)
                {
                    CurMatchInfo.EventID = int.Parse(dt.Rows[0]["F_EventID"].ToString());
                }
                else
                {
                    CurMatchInfo.EventID = -1;
                }

                if (dt.Rows[0]["F_PhaseID"] != DBNull.Value)
                {
                    CurMatchInfo.PhaseID = int.Parse(dt.Rows[0]["F_PhaseID"].ToString());
                }
                else
                {
                    CurMatchInfo.PhaseID = -1;
                }

                if (dt.Rows[0]["F_PlayerA"] != DBNull.Value)
                {
                    CurMatchInfo.PlayerA = int.Parse(dt.Rows[0]["F_PlayerA"].ToString());
                }
                else
                {
                    CurMatchInfo.PlayerA = -1;
                }
                if (dt.Rows[0]["F_PlayerB"] != DBNull.Value)
                {
                    CurMatchInfo.PlayerB = int.Parse(dt.Rows[0]["F_PlayerB"].ToString());
                }
                else
                {
                    CurMatchInfo.PlayerB = -1;
                }
                if (dt.Rows[0]["F_TargetA"] != DBNull.Value)
                {
                    CurMatchInfo.TargetA = dt.Rows[0]["F_TargetA"].ToString();
                }
                else
                {
                    CurMatchInfo.TargetA = "";
                }
                if (dt.Rows[0]["F_TargetB"] != DBNull.Value)
                {
                    CurMatchInfo.TargetB = dt.Rows[0]["F_TargetB"].ToString();
                }
                else
                {
                    CurMatchInfo.TargetB = "";
                }

                if (dt.Rows[0]["EventCode"] != DBNull.Value)
                {
                    CurMatchInfo.EventCode = dt.Rows[0]["EventCode"].ToString();
                }
                else
                {
                    CurMatchInfo.EventCode = "";
                }
                if (dt.Rows[0]["PhaseCode"] != DBNull.Value)
                {
                    CurMatchInfo.PhaseCode = dt.Rows[0]["PhaseCode"].ToString();
                }
                else
                {
                    CurMatchInfo.PhaseCode = "";
                }

                if (dt.Rows[0]["MatchCode"] != DBNull.Value)
                {
                    CurMatchInfo.MatchCode = dt.Rows[0]["MatchCode"].ToString();
                }
                else
                {
                    CurMatchInfo.MatchCode = "";
                }

                if (dt.Rows[0]["SexCode"] != DBNull.Value)
                {
                    CurMatchInfo.SexCode = dt.Rows[0]["SexCode"].ToString();
                }
                else
                {
                    CurMatchInfo.SexCode = "";
                }

                if (dt.Rows[0]["EventName"] != DBNull.Value)
                {
                    CurMatchInfo.EventName = dt.Rows[0]["EventName"].ToString();
                }
                else
                {
                    CurMatchInfo.EventName = "";
                }
                if (dt.Rows[0]["PhaseName"] != DBNull.Value)
                {
                    CurMatchInfo.PhaseName = dt.Rows[0]["PhaseName"].ToString();
                }
                else
                {
                    CurMatchInfo.PhaseName = "";
                }
                if (dt.Rows[0]["MatchName"] != DBNull.Value)
                {
                    CurMatchInfo.MatchName = dt.Rows[0]["MatchName"].ToString();
                }
                else
                {
                    CurMatchInfo.MatchName = "";
                }

                #region 局、箭数
                if (dt.Rows[0]["EndCount"] != DBNull.Value)
                {
                    CurMatchInfo.EndCount = int.Parse(dt.Rows[0]["EndCount"].ToString());
                }
                else
                {
                    CurMatchInfo.EndCount = 0;
                }
                if (dt.Rows[0]["ArrowCount"] != DBNull.Value)
                {
                    CurMatchInfo.ArrowCount = int.Parse(dt.Rows[0]["ArrowCount"].ToString());
                }
                else
                {
                    CurMatchInfo.ArrowCount = 0;
                }

                if (dt.Rows[0]["IsSetPoints"] != DBNull.Value)
                {
                    CurMatchInfo.IsSetPoints = int.Parse(dt.Rows[0]["IsSetPoints"].ToString());
                }
                else
                {
                    CurMatchInfo.IsSetPoints = 0;
                }

                if (dt.Rows[0]["WinPoints"] != DBNull.Value)
                {
                    CurMatchInfo.WinPoints = int.Parse(dt.Rows[0]["WinPoints"].ToString());
                }
                else
                {
                    CurMatchInfo.WinPoints = 0;
                }

                if (dt.Rows[0]["Distince"] != DBNull.Value)
                {
                    CurMatchInfo.Distince = int.Parse(dt.Rows[0]["Distince"].ToString());
                }
                else
                {
                    CurMatchInfo.WinPoints = 0;
                }
                #endregion

                if (dt.Rows[0]["CompetitionRuleID"] != DBNull.Value)
                {
                    CurMatchInfo.CurMatchRuleID = int.Parse(dt.Rows[0]["CompetitionRuleID"].ToString());
                }
                else
                {
                    CurMatchInfo.CurMatchRuleID = -1;
                }

                if (dt.Rows[0]["MatchStatusID"] != DBNull.Value)
                {
                    CurMatchInfo.MatchStatusID = int.Parse(dt.Rows[0]["MatchStatusID"].ToString());
                }
                else
                {
                    CurMatchInfo.MatchStatusID = -1;
                }


                #endregion
            }

            return(CurMatchInfo);
        }