示例#1
0
        private void btnx_Running_Click(object sender, EventArgs e)
        {
            // Auto Select 1st Split or 1st Set
            if (m_nCurMatchType == SQCommon.MATCH_TYPE_TEAM)
            {
                btnx_Match1.Checked = true;
                m_nCurSplitOffset   = 0;
                if (!ChangeTeamSplit(0))
                {
                    return;
                }
            }
            else if (m_nCurMatchType == SQCommon.MATCH_TYPE_SINGLE)
            {
                rad_Game1.Checked = true;
                m_nCurSplitOffset = 0;
                m_nCurSetOffset   = 0;
            }

            m_nCurStatusID = SQCommon.STATUS_RUNNING;
            Int32 iResult = OVRDataBaseUtils.ChangeMatchStatus(m_nCurMatchID, m_nCurStatusID, SQCommon.g_adoDataBase.m_dbConnect, SQCommon.g_SQPlugin);

            if (iResult == 1)
            {
                UpdateMatchStatus();
            }
        }
示例#2
0
        private void btnx_StartList_Click(object sender, EventArgs e)
        {
            m_nCurStatusID = SECommon.STATUS_STARTLIST;

            Int32 iResult = OVRDataBaseUtils.ChangeMatchStatus(m_nCurMatchID, m_nCurStatusID, SECommon.g_adoDataBase.m_dbConnect, SECommon.g_SEPlugin);
            if (iResult == 1) UpdateMatchStatus();
        }
示例#3
0
        private void btnx_Unofficial_Click(object sender, EventArgs e)
        {
            m_nCurStatusID = SECommon.STATUS_UNOFFICIAL;
            Int32 iResult = OVRDataBaseUtils.ChangeMatchStatus(m_nCurMatchID, m_nCurStatusID, SECommon.g_adoDataBase.m_dbConnect, SECommon.g_SEPlugin);
            if (iResult == 1) UpdateMatchStatus();

            SECommon.g_ManageDB.UpdateSplitStatusUnofficial(m_nCurMatchID);
        }
示例#4
0
        private void btnx_MatchStatus_Click(object sender, EventArgs e)
        {
            int nStatusID = 0;

            if (sender == btnx_Schedule)
            {
                nStatusID = Common.STATUS_SCHEDULE;
            }
            else if (sender == btnx_StartList)
            {
                nStatusID = Common.STATUS_STARTLIST;
            }
            else if (sender == btnx_Running)
            {
                nStatusID = Common.STATUS_RUNNING;
            }
            else if (sender == btnx_Suspend)
            {
                nStatusID = Common.STATUS_SUSPEND;
            }
            else if (sender == btnx_Unofficial)
            {
                nStatusID = Common.STATUS_UNOFFICIAL;
            }
            else if (sender == btnx_Official)
            {
                nStatusID = Common.STATUS_OFFICIAL;
            }
            else if (sender == btnx_Revision)
            {
                nStatusID = Common.STATUS_REVISION;
            }
            else if (sender == btnx_Canceled)
            {
                nStatusID = Common.STATUS_CANCELED;
            }
            else
            {
                return;
            }

            Int32 nResult = OVRDataBaseUtils.ChangeMatchStatus(
                Common.g_nMatchID, nStatusID, Common.g_DataBaseCon, Common.g_Plugin);

            //晋级比赛
            if (sender == btnx_Official)
            {
                //淘汰赛晋级
                OVRDataBaseUtils.AutoProgressMatch(Common.g_nMatchID, Common.g_DataBaseCon, Common.g_Plugin);

                //小组赛计分计算
                Common.dbCalGroupResult(Common.g_nMatchID);
            }

            Common.dbMatchModifyTimeSet();
            RefreshAll();
        }
示例#5
0
        private void btnx_Canceled_Click(object sender, EventArgs e)
        {
            m_nCurStatusID = SQCommon.STATUS_CANCELED;
            Int32 iResult = OVRDataBaseUtils.ChangeMatchStatus(m_nCurMatchID, m_nCurStatusID, SQCommon.g_adoDataBase.m_dbConnect, SQCommon.g_SQPlugin);

            if (iResult == 1)
            {
                UpdateMatchStatus();
            }
        }
示例#6
0
        private void btnx_Status_Click(object sender, EventArgs e)
        {
            if (sender == btnx_StartList)
            {
                m_iCurStatusID = GFCommon.STATUS_STARTLIST;
            }
            else if (sender == btnx_Running)
            {
                m_iCurStatusID = GFCommon.STATUS_RUNNING;
            }
            else if (sender == btnx_Suspend)
            {
                m_iCurStatusID = GFCommon.STATUS_SUSPEND;
            }
            else if (sender == btnx_Unofficial)
            {
                m_iCurStatusID = GFCommon.STATUS_UNOFFICIAL;
            }
            else if (sender == btnx_Official)
            {
                m_iCurStatusID = GFCommon.STATUS_OFFICIAL;
            }
            else if (sender == btnx_Revision)
            {
                m_iCurStatusID = GFCommon.STATUS_REVISION;
            }
            else if (sender == btnx_Canceled)
            {
                m_iCurStatusID = GFCommon.STATUS_CANCELED;
            }

            if (sender == btnx_Unofficial)
            {//计算详细成绩排名信息
                GFCommon.g_ManageDB.UpdateMatchResult(m_iCurMatchID, 1);
                GFCommon.g_ManageDB.UpdateTeamResult(m_iCurMatchID, 1);
            }

            Int32 iResultTeam = OVRDataBaseUtils.ChangeMatchStatus(m_iCurTeamMatchID, m_iCurStatusID, GFCommon.g_DataBaseCon, GFCommon.g_GFPlugin);
            Int32 iResult     = OVRDataBaseUtils.ChangeMatchStatus(m_iCurMatchID, m_iCurStatusID, GFCommon.g_DataBaseCon, GFCommon.g_GFPlugin);

            if (iResult == 1)
            {
                UpdateMatchStatus();
            }

            if (sender == btnx_Unofficial)
            {//计算小项奖牌信息
                GFCommon.g_ManageDB.CalculateEventResult(m_iCurMatchID);
            }
        }
示例#7
0
        private void btnx_HoopStatus_Click(object sender, EventArgs e)
        {
            if (sender == btnx_HoopSchedule)
            {
                m_nCurStatusID = SECommon.STATUS_SCHEDULE;
            }
            else if (sender == btnx_HoopStartList)
            {
                m_nCurStatusID = SECommon.STATUS_STARTLIST;
            }
            else if (sender == btnx_HoopRunning)
            {
                m_nCurStatusID = SECommon.STATUS_RUNNING;
            }
            else if (sender == btnx_HoopSuspend)
            {
                m_nCurStatusID = SECommon.STATUS_SUSPEND;
            }
            else if (sender == btnx_HoopUnOfficial)
            {
                m_nCurStatusID = SECommon.STATUS_UNOFFICIAL;
            }
            else if (sender == btnx_HoopFinished)
            {
                m_nCurStatusID = SECommon.STATUS_FINISHED;
            }
            else if (sender == btnx_HoopRevision)
            {
                m_nCurStatusID = SECommon.STATUS_REVISION;
            }
            else if (sender == btnx_HoopCanceled)
            {
                m_nCurStatusID = SECommon.STATUS_CANCELED;
            }
            else
            {
                return;
            }

            Int32 iResult = OVRDataBaseUtils.ChangeMatchStatus(m_nCurMatchID, m_nCurStatusID, SECommon.g_adoDataBase.m_dbConnect, SECommon.g_SEPlugin);

            if (iResult == 1)
            {
                UpdateHoopMatchStatus();
            }
        }
示例#8
0
        public bool UpdateMatchStatus(int nMatchID, int nMatchStatusID)
        {
            Int32 nChangeStatusResult = 0;

            nChangeStatusResult = OVRDataBaseUtils.ChangeMatchStatus(
                nMatchID, nMatchStatusID,
                SHCommon.g_DataBaseCon, m_oPlugin);

            if (nChangeStatusResult == 1)
            {
                UpdateMatchStatus();
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#9
0
        private bool EditMatch()
        {
            bool bResult = false;

            Int32 iChangeStatusResult = 0;

            iChangeStatusResult = OVRDataBaseUtils.ChangeMatchStatus(m_iMatchID, ConvertStrToInt(CmbStatus.SelectedValue.ToString()), m_DatabaseConnection, m_Module);
            if (iChangeStatusResult != 1)
            {
                switch (iChangeStatusResult)
                {
                case 1:    //修改成功!
                    break;

                case -1:
                    DevComponents.DotNetBar.MessageBoxEx.Show(LocalizationRecourceManager.GetString(m_strSectionName, "MsgEditMatchStatus2"));
                    break;

                default:    //其余的需要为修改失败!
                    DevComponents.DotNetBar.MessageBoxEx.Show(LocalizationRecourceManager.GetString(m_strSectionName, "MsgEditMatchStatus1"));
                    break;
                }
                return(bResult);
            }

            try
            {
                Int32      iOperateResult;
                SqlCommand oneSqlCommand = new SqlCommand();
                oneSqlCommand.Connection  = m_DatabaseConnection;
                oneSqlCommand.CommandText = "proc_EditMatch";
                oneSqlCommand.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter(
                    "@MatchID", SqlDbType.Int, 4,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, m_iMatchID);
                oneSqlCommand.Parameters.Add(cmdParameter0);

                SqlParameter cmdParameter7 = new SqlParameter(
                    "@Code", SqlDbType.NVarChar, 20,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextCode.Text);
                oneSqlCommand.Parameters.Add(cmdParameter7);

                SqlParameter cmdParameter8 = new SqlParameter(
                    "@Order", SqlDbType.Int, 4,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextOrder.Text);
                oneSqlCommand.Parameters.Add(cmdParameter8);

                SqlParameter cmdParameter12 = new SqlParameter(
                    "@MatchNum", SqlDbType.Int, 4,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextMatchNum.Text);
                oneSqlCommand.Parameters.Add(cmdParameter12);

                SqlParameter cmdParameter13 = new SqlParameter(
                    "@HasMedal", SqlDbType.Int, 4,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, ConvertStrToInt(textHasMedal.Text));
                oneSqlCommand.Parameters.Add(cmdParameter13);

                SqlParameter cmdParameter14 = new SqlParameter(
                    "@languageCode", SqlDbType.Char, 3,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, m_strLanguageCode);
                oneSqlCommand.Parameters.Add(cmdParameter14);

                SqlParameter cmdParameter17 = new SqlParameter(
                    "@MatchLongName", SqlDbType.NVarChar, 100,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextLongName.Text);
                oneSqlCommand.Parameters.Add(cmdParameter17);

                SqlParameter cmdParameter18 = new SqlParameter(
                    "@MatchShortName", SqlDbType.NVarChar, 50,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextShortName.Text);
                oneSqlCommand.Parameters.Add(cmdParameter18);

                SqlParameter cmdParameter19 = new SqlParameter(
                    "@MatchComment", SqlDbType.NVarChar, 100,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextComment.Text);
                oneSqlCommand.Parameters.Add(cmdParameter19);

                SqlParameter cmdParameter20 = new SqlParameter(
                    "@MatchComment2", SqlDbType.NVarChar, 100,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, TextComment2.Text);
                oneSqlCommand.Parameters.Add(cmdParameter20);

                SqlParameter cmdParameter21 = new SqlParameter(
                    "@StatusID", SqlDbType.Int, 4,
                    ParameterDirection.Input, true, 0, 0, "",
                    DataRowVersion.Current, ConvertStrToInt(CmbStatus.SelectedValue.ToString()));
                oneSqlCommand.Parameters.Add(cmdParameter21);


                SqlParameter cmdParameterResult = new SqlParameter(
                    "@Result", SqlDbType.Int, 4,
                    ParameterDirection.Output, true, 0, 0, "",
                    DataRowVersion.Current, 0);

                oneSqlCommand.Parameters.Add(cmdParameterResult);

                if (m_DatabaseConnection.State == System.Data.ConnectionState.Closed)
                {
                    m_DatabaseConnection.Open();
                }

                if (oneSqlCommand.ExecuteNonQuery() != 0)
                {
                    iOperateResult = (Int32)cmdParameterResult.Value;
                    switch (iOperateResult)
                    {
                    case 0:
                        DevComponents.DotNetBar.MessageBoxEx.Show(LocalizationRecourceManager.GetString(m_strSectionName, "MsgEditMatch1"));
                        bResult = false;
                        break;

                    case -1:
                        DevComponents.DotNetBar.MessageBoxEx.Show(LocalizationRecourceManager.GetString(m_strSectionName, "MsgEditMatch2"));
                        bResult = false;
                        break;

                    default:    //其余的需要为修改成功!
                        bResult = true;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
            }

            return(bResult);
        }
        void ImportMatchInfo(String strImprotFile)
        {
            if (!File.Exists(strImprotFile))
            {
                MessageBox.Show(LocalizationRecourceManager.GetString(strSectionName, "msgFilePath"));
                return;
            }

            String       strInPut = "";
            StreamReader sr       = new StreamReader(strImprotFile);
            String       strLine;

            while ((strLine = sr.ReadLine()) != null)
            {
                strInPut = strInPut + strLine;
            }

            sr.Close();

            Int32 nMatchID;
            Int32 nStatusID;

            // Output Prompt

            if (SQCommon.g_ManageDB.ImportMatchInfoXml(strInPut, out nMatchID, out nStatusID))
            {
                String strMsg = LocalizationRecourceManager.GetString(strSectionName, "msgImportMatchInfoSuc") + nMatchID.ToString() + "\r\n";
                SetTextBoxText(strMsg);
            }
            else
            {
                String strMsg = LocalizationRecourceManager.GetString(strSectionName, "msgImportMatchInfo") + "\r\n";
                SetTextBoxText(strMsg);
            }

            if (nMatchID > 0)
            {
                if (nStatusID == SQCommon.STATUS_UNOFFICIAL || nStatusID == SQCommon.STATUS_FINISHED)
                {
                    SQCommon.g_ManageDB.UpdateMatchRankSets(nMatchID);
                    SQCommon.g_ManageDB.CreateGroupResult(nMatchID);

                    Int32 iPhaseID = SQCommon.g_ManageDB.GetPhaseID(nMatchID);
                    SQCommon.g_SQPlugin.DataChangedNotify(OVRDataChangedType.emPhaseResult, -1, -1, iPhaseID, -1, iPhaseID, null);
                }

                SqlConnection sqlConnection = new SqlConnection(SQCommon.g_adoDataBase.m_strConnection);

                if (sqlConnection.State == System.Data.ConnectionState.Closed)
                {
                    sqlConnection.Open();
                }

                OVRDataBaseUtils.ChangeMatchStatus(nMatchID, nStatusID, sqlConnection, SQCommon.g_SQPlugin);
                OVRDataBaseUtils.AutoProgressMatch(nMatchID, sqlConnection, SQCommon.g_SQPlugin);

                if (sqlConnection != null)
                {
                    sqlConnection.Close();
                }

                SQCommon.g_SQPlugin.DataChangedNotify(OVRDataChangedType.emMatchResult, -1, -1, -1, nMatchID, nMatchID, null);
                SQCommon.g_SQPlugin.DataChangedNotify(OVRDataChangedType.emSplitInfo, -1, -1, -1, nMatchID, nMatchID, null);
            }
        }
示例#11
0
        private void BtnStatus_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Controls.Button btn = sender as System.Windows.Controls.Button;
            int newStatus = Convert.ToInt32(btn.Tag);

            if (newStatus == m_curMatchStatus)
            {
                return;
            }

            if (m_curMatchStatus != (int)MatchStatus.Scheduled && newStatus == (int)MatchStatus.StartList)
            {
                if (System.Windows.Forms.DialogResult.Cancel == GVAR.MsgBox("Are you confirm to change status to \"STARTLIST\"? To do this,all the match data will be cleared!",
                                                                            "Warning", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Warning))
                {
                    return;
                }
            }

            if (newStatus == (int)MatchStatus.Unofficial || newStatus == (int)MatchStatus.Official)
            {
                if (m_homeTeamScore.ScoreTotal > m_awayTeamScore.ScoreTotal)
                {
                    m_homeTeamScore.ResultID = GVAR.RESULT_TYPE_WIN;
                    m_homeTeamScore.RankID   = GVAR.RANK_TYPE_1ST;
                    m_awayTeamScore.ResultID = GVAR.RESULT_TYPE_LOSE;
                    m_awayTeamScore.RankID   = GVAR.RANK_TYPE_2ND;
                }
                else if (m_homeTeamScore.ScoreTotal == m_awayTeamScore.ScoreTotal)
                {
                    m_homeTeamScore.ResultID = GVAR.RESULT_TYPE_TIE;
                    m_homeTeamScore.RankID   = GVAR.RANK_TYPE_TIE;
                    m_awayTeamScore.ResultID = GVAR.RESULT_TYPE_TIE;
                    m_awayTeamScore.RankID   = GVAR.RANK_TYPE_TIE;
                }
                else if (m_homeTeamScore.ScoreTotal < m_awayTeamScore.ScoreTotal)
                {
                    m_homeTeamScore.ResultID = GVAR.RESULT_TYPE_LOSE;
                    m_homeTeamScore.RankID   = GVAR.RANK_TYPE_2ND;
                    m_awayTeamScore.ResultID = GVAR.RESULT_TYPE_WIN;
                    m_awayTeamScore.RankID   = GVAR.RANK_TYPE_1ST;
                }

                GVAR.g_ManageDB.UpdateMatchRank(m_curMatchID, m_homeTeamScore.RankID, m_homeTeamScore.ResultID, 1);
                GVAR.g_ManageDB.UpdateMatchRank(m_curMatchID, m_awayTeamScore.RankID, m_awayTeamScore.ResultID, 2);
            }

            if (OVRDataBaseUtils.ChangeMatchStatus(m_curMatchID, newStatus, GVAR.g_adoDataBase.DBConnect, GVAR.g_RUPlugin) != 1)
            {
                Log.WriteLog("RU_Error", "调用OVRDataBaseUtils.ChangeMatchStatus改变状态失败!");
                GVAR.MsgBox("Change match status failed!");
                return;
            }
            else
            {
                if (newStatus == (int)MatchStatus.Unofficial || newStatus == (int)MatchStatus.Official)
                {
                    GVAR.g_ManageDB.AutoProgressMatch(m_curMatchID);
                }

                GVAR.g_RUPlugin.DataChangedNotify(AutoSports.OVRCommon.OVRDataChangedType.emMatchStatus, -1, -1, -1, GVAR.g_matchID, GVAR.g_matchID, null);
            }

            CurMatchStatus = newStatus;
            GVAR.g_RUPlugin.UpdateMatchList();
            CloseStatusWindow();
        }