Esempio n. 1
0
        private void FillOuterMatchList()
        {
            try
            {
                SqlCommand oneSqlCommand = new SqlCommand();
                oneSqlCommand.Connection = _OuterDBConnection;

                string strSQL;
                strSQL = ConfigurationManager.GetPluginSettingString("DV", "SQL_MatchList");
                if (strSQL.Length == 0)
                {
                    strSQL = @"SELECT EventNameI, EventID FROM dvEvent";
                    ConfigurationManager.SetPluginSettingString("DV", "SQL_MatchList", strSQL);
                }
                oneSqlCommand.CommandText = strSQL;
                oneSqlCommand.CommandType = CommandType.Text;

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

                SqlDataReader sdr = oneSqlCommand.ExecuteReader();

                OVRDataBaseUtils.FillDataGridView(dgvOuterMatchList, sdr);
                sdr.Close();

                dgvOuterMatchList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            }
            catch (Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
            }
        }
Esempio n. 2
0
        private void ResetAllVenuesGrid(String strLanguageCode)
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get All Venues

                String strSQL;
                strSQL = String.Format(@"SELECt F_VenueLongName AS [Venue LongName], F_VenueShortName AS [Venue ShortName], F_VenueID AS [ID] FROM TC_Venue_Des  
                               WHERE F_LanguageCode = '{0}'", strLanguageCode);

                SqlCommand cmd = new SqlCommand(strSQL, sqlConnection);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvAllVenues, dr, null, null);
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 3
0
        private void UpdateUIFromOtherThread(TransmitStatus status, TSMatchInfo matchInfo)
        {
            if (status == TransmitStatus.StartList || status == TransmitStatus.RankList)
            {
                lbHeight.Text        = matchInfo.StartInfo.Height;
                lbStartBib.Text      = matchInfo.StartInfo.BibNumber;
                lbStartDiff.Text     = matchInfo.StartInfo.Difficulty;
                lbStartDiveCode.Text = matchInfo.StartInfo.DiveCode;
                lbStartName.Text     = matchInfo.StartInfo.PlayerName;
                lbStartRound.Text    = matchInfo.StartInfo.RoundNumber;
                lbStartNO.Text       = matchInfo.StartInfo.StartNumber;
                lbStartNOC.Text      = matchInfo.StartInfo.NOC;
                lbStartPoints.Text   = matchInfo.StartInfo.Points;
                lbStartRank.Text     = matchInfo.StartInfo.Rank;
            }
            else if (status == TransmitStatus.Score)
            {
                OVRDataBaseUtils.FillDataGridView(dgJudgeScore, matchInfo.ScoreInfo);
                dgJudgeScore.ClearSelection();
            }
            if (status == TransmitStatus.RankList)
            {
                OVRDataBaseUtils.FillDataGridView(dgRankList, matchInfo.RankInfo);
                dgRankList.ClearSelection();
            }

            TSDlg_OnTSUpdateDB();
        }
Esempio n. 4
0
        private void ResetDisciplineVenueGrid(int iDisciplineID, String strLanguageCode)
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get Discipline Venues

                String strSQL;
                strSQL = String.Format(@"SELECT B.F_VenueLongName AS [Venue LongName], B.F_VenueShortName AS [Venue ShortName], A.F_VenueID, A.F_DisciplineID 
					                       FROM  TD_Discipline_Venue AS A LEFT JOIN TC_Venue_Des AS B ON A.F_VenueID = B.F_VenueID 
					                        WHERE B.F_LanguageCode = '{0}' AND A.F_DisciplineID = {1}"                    , strLanguageCode, iDisciplineID);

                SqlCommand cmd = new SqlCommand(strSQL, sqlConnection);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvDisciplineVenue, dr, null, null);
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
        private void GetHorses()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get AvailbleMember
                SqlCommand cmd = new SqlCommand("Proc_EQ_GetRegisterAvailableHorses", sqlConnection);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter("@RegisterID", SqlDbType.Int);
                SqlParameter cmdParameter1 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);

                cmdParameter0.Value = m_iRegisterID;
                cmdParameter1.Value = m_strLanguageCode;

                cmd.Parameters.Add(cmdParameter0);
                cmd.Parameters.Add(cmdParameter1);

                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvAvailableHorses, dr, null, null);
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 6
0
        private void UpdateGridView(DataGridView dgv, SqlDataReader sdr)
        {
            m_bUpdatingUI = true;
            Int32 iCurSel = -1;

            if (dgv.SelectedRows.Count != 0)
            {
                iCurSel = dgv.SelectedRows[0].Index;
            }
            OVRDataBaseUtils.FillDataGridView(dgv, sdr, null, null);
            if (dgv.Columns["ID"] != null)
            {
                dgv.Columns["ID"].Visible = false;
            }

            while (iCurSel >= dgv.Rows.Count)
            {
                iCurSel--;
            }

            if (iCurSel != -1)
            {
                dgv.Rows[iCurSel].Selected          = true;
                dgv.FirstDisplayedScrollingRowIndex = iCurSel;
            }
            m_bUpdatingUI = false;
        }
        private void UpdateGridView()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get Discipline Venues

                String strSQL;
                strSQL = String.Format(@"SELECT F_NewsID AS [ID], F_NewsItem AS [Item], F_SubTitle AS [SubTitle], F_Heading AS [Heading], F_Issued_by AS [IssuedBy], F_Date AS [Date]
					                       FROM  TS_Offical_Communication 
					                        WHERE F_DisciplineID = {0}"                    , m_nDisciplineID);

                SqlCommand cmd = new SqlCommand(strSQL, sqlConnection);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvCommunication, dr, null, null);
                dr.Close();

                dgvCommunication.Columns["ID"].Visible = false;
            }
            catch (System.Exception e)
            {
                UIMessageDialog.ShowMessageDialog(e.Message, "Information", false, this.Style);
            }
        }
Esempio n. 8
0
        private void ShowEventToGrid()
        {
            if (m_RecordModule.DatabaseConnection.State == System.Data.ConnectionState.Closed)
            {
                m_RecordModule.DatabaseConnection.Open();
            }

            #region DML Command Setup for daEvent

            SqlCommand cmd = new SqlCommand("Proc_GetDisciplineEvents", m_RecordModule.DatabaseConnection);
            cmd.CommandType      = CommandType.StoredProcedure;
            cmd.UpdatedRowSource = UpdateRowSource.None;

            SqlParameter cmdParameter1 = new SqlParameter(
                "@DisciplineID", SqlDbType.Int, 0,
                ParameterDirection.Input, false, 0, 0, "@DisciplineID",
                DataRowVersion.Current, m_iActiveDiscipline);

            SqlParameter cmdParameter2 = new SqlParameter(
                "@LanguageCode", SqlDbType.Char, 3,
                ParameterDirection.Input, false, 0, 0, "@LanguageCode",
                DataRowVersion.Current, m_strActiveLanguage);

            cmd.Parameters.Add(cmdParameter1);
            cmd.Parameters.Add(cmdParameter2);
            #endregion

            SqlDataReader dr = cmd.ExecuteReader();
            DataTable     dt = new DataTable();
            dt.Load(dr);
            dr.Close();

            OVRDataBaseUtils.FillDataGridView(dgv_Events, dt);
        }
Esempio n. 9
0
        private void Update_UnScheduledGrid()
        {
            int iFirstDisplayedScrollingRowIndex    = dgv_UnScheduled.FirstDisplayedScrollingRowIndex;
            int iFirstDisplayedScrollingColumnIndex = dgv_UnScheduled.FirstDisplayedScrollingColumnIndex;

            if (iFirstDisplayedScrollingRowIndex < 0)
            {
                iFirstDisplayedScrollingRowIndex = 0;
            }
            if (iFirstDisplayedScrollingColumnIndex < 0)
            {
                iFirstDisplayedScrollingColumnIndex = 0;
            }

            System.Data.DataTable dt = GetUnScheduledDataTable();

            OVRDataBaseUtils.FillDataGridView(this.dgv_UnScheduled, dt, null, null);

            if (this.dgv_UnScheduled.Columns["F_EventID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_EventID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_MatchID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_MatchID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_SessionID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_SessionID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_VenueID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_VenueID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_CourtID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_CourtID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_MatchStatusID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_MatchStatusID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_RoundID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_RoundID"].Visible = false;
            }

            this.dgv_UnScheduled.ClearSelection();

            if (iFirstDisplayedScrollingRowIndex < dgv_UnScheduled.Rows.Count)
            {
                dgv_UnScheduled.FirstDisplayedScrollingRowIndex = iFirstDisplayedScrollingRowIndex;
            }
            if (iFirstDisplayedScrollingColumnIndex < dgv_UnScheduled.Columns.Count)
            {
                dgv_UnScheduled.FirstDisplayedScrollingColumnIndex = iFirstDisplayedScrollingColumnIndex;
            }
        }
Esempio n. 10
0
        public void ResetAvailableGrid(int iMatchID, int iTeamID, int iTeamPos, ref DataGridView dgv)
        {
            if (Common.g_DataBaseCon.State == System.Data.ConnectionState.Closed)
            {
                Common.g_DataBaseCon.Open();
            }

            try
            {
                #region DML Command Setup for Get AvailbleTeamMember
                SqlCommand cmd = new SqlCommand("Proc_VB_EXT_GetTeamAvailable", Common.g_DataBaseCon);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter("@RegisterID", SqlDbType.Int);
                SqlParameter cmdParameter1 = new SqlParameter("@MatchID", SqlDbType.Int);
                SqlParameter cmdParameter2 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);
                SqlParameter cmdParameter3 = new SqlParameter("@TeamPos", SqlDbType.Int);

                cmdParameter0.Value = iTeamID;
                cmdParameter1.Value = iMatchID;
                cmdParameter2.Value = Common.g_strLanguage;
                cmdParameter3.Value = iTeamPos;

                cmd.Parameters.Add(cmdParameter0);
                cmd.Parameters.Add(cmdParameter1);
                cmd.Parameters.Add(cmdParameter2);
                cmd.Parameters.Add(cmdParameter3);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgv, dr, null, null);

                if (dgv.RowCount >= 0)
                {
                    dgv.Columns["F_MemberID"].Visible   = false;
                    dgv.Columns["F_FunctionID"].Visible = false;


                    for (int i = 0; i < dgv.RowCount; i++)
                    {
                        int iDSQ = Common.Str2Int(dgv.Rows[i].Cells["DSQ"].Value);
                        if (iDSQ == 1)
                        {
                            dgv.Rows[i].ReadOnly = true;
                            dgv.Rows[i].DefaultCellStyle.BackColor = System.Drawing.Color.DarkGray;
                        }
                    }
                }
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 11
0
        private void ResetRegisterGrid()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get AvailbleMember
                SqlCommand cmd = new SqlCommand("proc_GetAvailbleMember_With_Language", sqlConnection);
                cmd.CommandType      = CommandType.StoredProcedure;
                cmd.UpdatedRowSource = UpdateRowSource.None;

                SqlParameter cmdParameter0 = new SqlParameter("@DisciplineID", SqlDbType.Int);
                SqlParameter cmdParameter1 = new SqlParameter("@GroupID", SqlDbType.NVarChar, 9);
                SqlParameter cmdParameter2 = new SqlParameter("@RegisterID", SqlDbType.Int);
                SqlParameter cmdParameter3 = new SqlParameter("@SexCode", SqlDbType.Int);
                SqlParameter cmdParameter4 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);
                SqlParameter cmdParameter5 = new SqlParameter("@GroupType", SqlDbType.Int);


                m_strGroupID = cmbGroup.SelectedValue.ToString();
                m_strSexCode = cmbSex.SelectedValue.ToString();

                cmdParameter0.Value = Convert.ToInt32(m_strDisciplineID);
                cmdParameter1.Value = Convert.ToInt32(m_strGroupID);
                cmdParameter2.Value = Convert.ToInt32(m_strRegisterID);
                cmdParameter3.Value = Convert.ToInt32(m_strSexCode);
                cmdParameter4.Value = m_strLanguageCode;
                cmdParameter5.Value = m_iGroupType;

                cmd.Parameters.Add(cmdParameter0);
                cmd.Parameters.Add(cmdParameter1);
                cmd.Parameters.Add(cmdParameter2);
                cmd.Parameters.Add(cmdParameter3);
                cmd.Parameters.Add(cmdParameter4);
                cmd.Parameters.Add(cmdParameter5);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvAllRegister, dr, null, null);
                dr.Close();

                SetGridStyle(dgvAllRegister);
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 12
0
        private void FillInfoGrid()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for NOC Info
                SqlCommand cmd = new SqlCommand("Proc_EQ_GetDesInfoList", sqlConnection);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter("@DesTableName", SqlDbType.NVarChar, 50);
                SqlParameter cmdParameter1 = new SqlParameter("@DesName", SqlDbType.NVarChar, 50);
                SqlParameter cmdParameter2 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);
                cmdParameter0.Value = m_strDesTableName;
                cmd.Parameters.Add(cmdParameter0);
                cmdParameter1.Value = m_strDesName;
                cmd.Parameters.Add(cmdParameter1);
                cmdParameter2.Value = m_strLanguageCode;
                cmd.Parameters.Add(cmdParameter2);
                SqlDataReader dr = cmd.ExecuteReader();
                #endregion

                OVRDataBaseUtils.FillDataGridView(dgvInfo, dr, null, null);
                dr.Close();
                //隐藏ID列
                dgvInfo.Columns[0].Visible = false;
                if (dgvInfo.Rows.Count > 0)
                {
                    if (m_iSelRowIdx < 0)
                    {
                        return;
                    }
                    else if (m_iSelRowIdx > dgvInfo.RowCount - 1)
                    {
                        m_iSelRowIdx = dgvInfo.RowCount - 1;
                    }
                    dgvInfo.Rows[m_iSelRowIdx].Selected     = true;
                    dgvInfo.FirstDisplayedScrollingRowIndex = m_iSelRowIdx;
                }
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 13
0
        public bool UpdateUI(int matchID)
        {
            DataTable dt = BDCommon.g_ManageDB.GetViewScore(matchID);

            if (dt == null)
            {
                return(false);
            }
            OVRDataBaseUtils.FillDataGridView(dgViewScore, dt);
            dgViewScore.Columns[0].Width = 50;
            foreach (DataGridViewColumn col in dgViewScore.Columns)
            {
                col.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            lbMatchID.Text    = matchID.ToString();
            lbMatchCourt.Text = BDCommon.g_ManageDB.GetMatchCourtName(matchID);
            lbMatchRSC.Text   = BDCommon.g_ManageDB.GetRscStringFromMatchID(matchID);
            String strSportDes, strPhaseDes, strDateDes, strVenueDes, strPlayNameA, strPlayNameB, strHomeScore, strAwayScore;
            int    m_nCurPlayIDA, m_nCurPlayIDB, m_nCurStatusID, m_nRegAPos, m_nRegBPos;

            BDCommon.g_ManageDB.GetOneMatchDes(matchID, out m_nCurPlayIDA, out m_nCurPlayIDB, out strPlayNameA, out strPlayNameB, out m_nCurStatusID,
                                               out strSportDes, out strPhaseDes, out strDateDes, out strVenueDes, out strHomeScore, out strAwayScore, out m_nRegAPos, out m_nRegBPos);

            //lb_SportDes.Text = strSportDes;
            lbMatchTime.Text  = strDateDes;
            this.Text         = strPhaseDes;
            lbPlayerA.Text    = strPlayNameA;
            lbPlayerB.Text    = strPlayNameB;
            lbMatchScore.Text = BDCommon.g_ManageDB.GetMatchScoreString(matchID);

            bool bFound = false;

            for (int i = 0; i < lsbMatchID.Items.Count; i++)
            {
                if ((string)lsbMatchID.Items[i] == matchID.ToString())
                {
                    lsbMatchID.SelectedIndex = i;
                    bFound = true;
                    break;
                }
            }
            if (!bFound)
            {
                lsbMatchID.SelectedIndex = -1;
            }

            return(true);
        }
Esempio n. 14
0
        private void btnShowMatchResult_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand oneSqlCommand = new SqlCommand();
                oneSqlCommand.Connection = _OuterDBConnection;


                string strSQL;
                strSQL = ConfigurationManager.GetPluginSettingString("DV", "SQL_MatchResult");

                if (strSQL.Length == 0)
                {
                    strSQL = @"SELECT EventID, A.OrderNo, A.EventPoint, A.EventPlace, A.Qualified, A.Nonuser FROM dvOrder AS A  WHERE A.EventID = '@MatchCode' ORDER BY EventPlace";

                    ConfigurationManager.SetPluginSettingString("DV", "SQL_MatchResult", strSQL);
                }
                strSQL = strSQL.Replace("@MatchCode", m_strOutMatchCode);

                oneSqlCommand.CommandText = strSQL;
                oneSqlCommand.CommandType = CommandType.Text;

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


                SqlDataReader sdr = oneSqlCommand.ExecuteReader();

                OVRDataBaseUtils.FillDataGridView(dgvImportInfo, sdr);
                sdr.Close();

                for (int i = 0; i < dgvImportInfo.Rows.Count; i++)
                {
                    for (int j = 0; j < dgvImportInfo.Columns.Count; j++)
                    {
                        dgvImportInfo.Rows[i].Cells[j].ReadOnly = false;
                    }
                }
            }
            catch (Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
            }
        }
Esempio n. 15
0
        private void btnShowActionCode_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand oneSqlCommand = new SqlCommand();
                oneSqlCommand.Connection = _OuterDBConnection;

                string strSQL;
                strSQL = ConfigurationManager.GetPluginSettingString("DV", "SQL_ActionCode");
                if (strSQL.Length == 0)
                {
                    strSQL = @"SELECT A.EventID, A.RoundNo, B.OrderNo, A.DiveCode1,A.DiveDiff, A.DiveHeight,c.DiverNameI, d.DiverNameI
	                  FROM dvRound AS  A LEFT JOIN dvOrder AS B ON A.DiverID1 = B.DiverID1 AND (A.DiverID2 IS NULL OR A.DiverID2 = '' OR A.DiverID2 = B.DiverID2) AND A.EventID = B.EventID 
	                  Left join dvDiver as c on a.DiverID1 = c.DiverID
	                  Left join dvDiver as d on a.DiverID2 = d.DiverID
	                  WHERE A.EventID = '@MatchCode' ORDER BY B.OrderNo, A.RoundNo"    ;

                    ConfigurationManager.SetPluginSettingString("DV", "SQL_ActionCode", strSQL);
                }
                strSQL = strSQL.Replace("@MatchCode", m_strOutMatchCode);
                oneSqlCommand.CommandText = strSQL;
                oneSqlCommand.CommandType = CommandType.Text;

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

                SqlDataReader sdr = oneSqlCommand.ExecuteReader();

                OVRDataBaseUtils.FillDataGridView(dgvImportInfo, sdr);
                sdr.Close();

                for (int i = 0; i < dgvImportInfo.Rows.Count; i++)
                {
                    for (int j = 0; j < dgvImportInfo.Columns.Count; j++)
                    {
                        dgvImportInfo.Rows[i].Cells[j].ReadOnly = false;
                    }
                }
            }
            catch (Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
            }
        }
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (dgvCommunication.SelectedRows.Count <= 0)
            {
                return;
            }

            string strSectionName = "OfficialCommunication";
            string strPromotion   = LocalizationRecourceManager.GetString(strSectionName, "PromotionDelete");

            if (DevComponents.DotNetBar.MessageBoxEx.Show(strPromotion, "", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }

            int iSelRowsID = dgvCommunication.SelectedRows[0].Index;
            int iNewsID    = Convert.ToInt32(dgvCommunication.Rows[iSelRowsID].Cells["ID"].Value);

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

            try
            {
                #region DML Command Setup for Get Discipline Venues

                String strSQL;
                strSQL = String.Format(@"Delete TS_Offical_Communication 
					                        WHERE F_NewsID = {0}"                    , iNewsID);

                SqlCommand cmd = new SqlCommand(strSQL, sqlConnection);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvCommunication, dr, null, null);
                dr.Close();
            }
            catch (System.Exception ex)
            {
                UIMessageDialog.ShowMessageDialog(ex.Message, "Information", false, this.Style);
            }
            UpdateGridView();

            DataChangedNotify(OVRDataChangedType.emOfficialComDel, m_nDisciplineID, -1, -1, -1, iNewsID, null);
        }
Esempio n. 17
0
        private void ShowRecordValuesToGrid(int nRecordID)
        {
            m_bUpdatingUI = true;
            int iFirstDisplayedScrollingRowIndex    = dgvRecordValue.FirstDisplayedScrollingRowIndex;
            int iFirstDisplayedScrollingColumnIndex = dgvRecordValue.FirstDisplayedScrollingColumnIndex;

            if (iFirstDisplayedScrollingRowIndex < 0)
            {
                iFirstDisplayedScrollingRowIndex = 0;
            }
            if (iFirstDisplayedScrollingColumnIndex < 0)
            {
                iFirstDisplayedScrollingColumnIndex = 0;
            }

            SqlDataReader dbReader = GetRecordValues(nRecordID, m_RecordModule.DatabaseConnection);

            if (dbReader == null)
            {
                return;
            }

            OVRDataBaseUtils.FillDataGridView(dgvRecordValue, dbReader, null, null);
            dbReader.Close();

            // Edit Enable
            foreach (DataGridViewColumn Col in dgvRecordValue.Columns)
            {
                if (Col.Name != "F_RecordID" && Col.Name != "F_ValueNum")
                {
                    Col.ReadOnly = false;
                }
            }

            if (iFirstDisplayedScrollingRowIndex < dgvRecordValue.Rows.Count)
            {
                dgvRecordValue.FirstDisplayedScrollingRowIndex = iFirstDisplayedScrollingRowIndex;
            }
            if (dgvRecordValue.FirstDisplayedScrollingColumnIndex < iFirstDisplayedScrollingColumnIndex &&
                iFirstDisplayedScrollingColumnIndex < dgvEventRecords.Columns.Count)
            {
                dgvRecordValue.FirstDisplayedScrollingColumnIndex = iFirstDisplayedScrollingColumnIndex;
            }

            m_bUpdatingUI = false;
        }
Esempio n. 18
0
        private int RefreshUI()
        {
            string strXml = GetMatchCodeXml();

            if (strXml == "")
            {
                return(-1);
            }
            DataTable dt = BDCommon.g_ManageDB.GetMatchInfoFromRscXml(strXml);

            if (dt == null)
            {
                return(-2);
            }
            OVRDataBaseUtils.FillDataGridView(dgMatchInfo, dt);
            return(1);
        }
Esempio n. 19
0
        public void ResetAvailableOfficial(int iMatchID, DataGridView dgv)
        {
            System.Data.SqlClient.SqlConnection con = GVAR.g_adoDataBase.DBConnect;
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }

            try
            {
                #region DML Command Setup for Get AvailbleOfficial
                SqlCommand cmd = new SqlCommand("Proc_AR_GetAvailableOfficial", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter("@DisciplineID", SqlDbType.Int);
                SqlParameter cmdParameter1 = new SqlParameter("@MatchID", SqlDbType.Int);
                SqlParameter cmdParameter2 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);

                cmdParameter0.Value = m_iDisciplineID;
                cmdParameter1.Value = iMatchID;
                cmdParameter2.Value = m_strLanguageCode;

                cmd.Parameters.Add(cmdParameter0);
                cmd.Parameters.Add(cmdParameter1);
                cmd.Parameters.Add(cmdParameter2);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgv, dr, null, null);

                if (dgv.RowCount >= 0)
                {
                    dgv.Columns["F_RegisterID"].Visible      = false;
                    dgv.Columns["F_FunctionID"].Visible      = false;
                    dgv.Columns["F_OfficialGroupID"].Visible = false;
                    dgv.Columns["F_PositionID"].Visible      = false;
                    dgv.Columns["Group"].Visible             = false;
                }
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 20
0
        private void OVRVenueListForm_Load(object sender, EventArgs e)
        {
            Localization();

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

            int    iActiveSport, iActiveDiscipline;
            string strLanguageCode;

            OVRDataBaseUtils.GetActiveInfo(sqlConnection, out iActiveDiscipline, out iActiveDiscipline, out strLanguageCode);

            #region DML Command Setup for Get Discipline Venues

            String strSQL;
            strSQL = String.Format(@" SELECT 'NONE' AS [Venue]
                                       UNION
                                      SELECT  C.F_VenueCode + '('+ B.F_VenueLongName + ')' AS [Venue]
				                       FROM  TD_Discipline_Venue  AS  A 
                                        LEFT JOIN TC_Venue_Des  AS  B  ON  A.F_VenueID = B.F_VenueID 
                                        LEFT JOIN TC_Venue  AS  C  ON  A.F_VenueID = C.F_VenueID 
				                       WHERE B.F_LanguageCode = '{0}' AND A.F_DisciplineID = {1}"                , strLanguageCode, iActiveDiscipline);

            SqlCommand cmd = new SqlCommand(strSQL, sqlConnection);
            #endregion

            SqlDataReader dr = null;
            try
            {
                dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvVenueList, dr, null, null);
                dr.Close();
            }
            catch (System.Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);

                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
            }
        }
Esempio n. 21
0
        private void btnStartCheck_Click(object sender, EventArgs e)
        {
            if (dgvToCheckErr.Rows.Count == 0)
            {
                MessageBoxEx.Show("Please select items which you want to check.");
                return;
            }
            foreach (DataGridViewRow dgvr in dgvToCheckErr.Rows)
            {
                dgvr.Cells[1].Value = "Not Checked";
            }
            string lang = cmbLang.SelectedIndex == 0 ? "ENG" : "CHN";

            dgvToCheckErr.ClearSelection();
            for (int i = 0; i < dgvToCheckErr.Rows.Count; i++)
            {
                string strItem = dgvToCheckErr.Rows[i].Cells[0].Value.ToString();
                string status  = dgvToCheckErr.Rows[i].Cells[1].Value.ToString();
                dgvToCheckErr.Rows[i].Selected = true;
                dgvToCheckErr.CurrentCell      = dgvToCheckErr.Rows[i].Cells[0];

                DataTable dtRes = BDCommon.g_ManageDB.GetSelfCheckError(strItem, lang);
                if (dtRes != null)
                {
                    dgvToCheckErr.Rows[i].Cells[1].Value = "Checked Error";
                    OVRDataBaseUtils.FillDataGridView(dgvCheckResult, dtRes);
                    dgvToCheckErr.ClearSelection();
                    dgvCheckResult.ClearSelection();
                    MessageBoxEx.Show("Find an error!If you want to continue,fix it first.");
                    return;
                }
                else
                {
                    dgvToCheckErr.Rows[i].Cells[1].Value = "Checked Succeed";
                }
                System.Windows.Forms.Application.DoEvents();
                System.Threading.Thread.Sleep(50);
                dgvToCheckErr.ClearSelection();
            }

            dgvCheckResult.Rows.Clear();
            MessageBoxEx.Show("All check succeed!");
        }
Esempio n. 22
0
        private void frmImportTempData_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable("Sets");

            dt.Columns.Add("FileName", typeof(string));
            dt.Columns.Add("Set", typeof(string));
            string strMatchID = m_iMatchID.ToString();

            strMatchID = strMatchID.PadLeft(5, '0');
            string[] strFiles = Directory.GetFiles(BDCommon.GetTempMatchDir(), string.Format("9?{0}_Result.xml", strMatchID));
            foreach (string strFilePath in strFiles)
            {
                string  strName = Path.GetFileName(strFilePath);
                DataRow drNew   = dt.NewRow();
                drNew["FileName"] = strName;
                drNew["Set"]      = strName.Substring(1, 1);
                dt.Rows.Add(drNew);
            }
            OVRDataBaseUtils.FillDataGridView(dgvTempSetData, dt);
        }
Esempio n. 23
0
        private void Init_UnScheduledGrid()
        {
            OVRDataBaseUtils.SetDataGridViewStyle(this.dgv_UnScheduled);

            System.Data.DataTable dt = GetInitUnScheduledDataTable();

            OVRDataBaseUtils.FillDataGridView(this.dgv_UnScheduled, dt, null, null);

            if (this.dgv_UnScheduled.Columns["F_EventID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_EventID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_MatchID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_MatchID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_SessionID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_SessionID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_VenueID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_VenueID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_CourtID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_CourtID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_MatchStatusID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_MatchStatusID"].Visible = false;
            }
            if (this.dgv_UnScheduled.Columns["F_RoundID"] != null)
            {
                this.dgv_UnScheduled.Columns["F_RoundID"].Visible = false;
            }

            this.dgv_UnScheduled.ClearSelection();
        }
Esempio n. 24
0
        private void ResetCommetGrid()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Reset CommentGrid
                string strSQL = String.Format(@"SELECT F_Comment_Order AS [Order], F_Title AS [Title], F_Comment AS [Comment],F_CommentID AS [ID]
					                         FROM TR_Register_Comment WHERE F_RegisterID = {0}"                    , m_iRegisterID);

                SqlCommand    cmd = new SqlCommand(strSQL, sqlConnection);
                SqlDataReader dr  = cmd.ExecuteReader();
                #endregion

                OVRDataBaseUtils.FillDataGridView(dgvComment, dr, null, null);
                dr.Close();

                if (dgvComment.Rows.Count > 0)
                {
                    if (m_iSelRowIdx < 0)
                    {
                        return;
                    }
                    else if (m_iSelRowIdx > dgvComment.RowCount - 1)
                    {
                        m_iSelRowIdx = dgvComment.RowCount - 1;
                    }
                    dgvComment.Rows[m_iSelRowIdx].Selected     = true;
                    dgvComment.FirstDisplayedScrollingRowIndex = m_iSelRowIdx;
                }
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 25
0
        private void ResetPhaseCompetitors()
        {
            if (sqlConnection.State == System.Data.ConnectionState.Closed)
            {
                sqlConnection.Open();
            }

            try
            {
                #region DML Command Setup for Get AvailbleMember
                SqlCommand cmd = new SqlCommand("proc_GetCompetitorsForPhase", sqlConnection);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter0 = new SqlParameter("@EventID", SqlDbType.Int);
                SqlParameter cmdParameter1 = new SqlParameter("@PhaseID", SqlDbType.Int);
                SqlParameter cmdParameter3 = new SqlParameter("@NodeType", SqlDbType.Int);
                SqlParameter cmdParameter2 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);

                cmdParameter0.Value = m_iEventID;
                cmdParameter1.Value = m_iPhaseID;
                cmdParameter3.Value = m_iNodeType;
                cmdParameter2.Value = m_strLanguageCode;

                cmd.Parameters.Add(cmdParameter0);
                cmd.Parameters.Add(cmdParameter1);
                cmd.Parameters.Add(cmdParameter3);
                cmd.Parameters.Add(cmdParameter2);

                #endregion

                SqlDataReader dr = cmd.ExecuteReader();
                OVRDataBaseUtils.FillDataGridView(dgvPhaseCompetitors, dr, null, null);
                dr.Close();
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 26
0
        private void ShowRecordMembersToGrid(int nRecordID)
        {
            m_bUpdatingUI = true;
            int iFirstDisplayedScrollingRowIndex    = dgvRecordMember.FirstDisplayedScrollingRowIndex;
            int iFirstDisplayedScrollingColumnIndex = dgvRecordMember.FirstDisplayedScrollingColumnIndex;

            if (iFirstDisplayedScrollingRowIndex < 0)
            {
                iFirstDisplayedScrollingRowIndex = 0;
            }
            if (iFirstDisplayedScrollingColumnIndex < 0)
            {
                iFirstDisplayedScrollingColumnIndex = 0;
            }

            SqlDataReader dbReader = GetRecordMember(nRecordID, m_RecordModule.DatabaseConnection);

            if (dbReader == null)
            {
                return;
            }

            OVRDataBaseUtils.FillDataGridView(dgvRecordMember, dbReader, null, null);
            dbReader.Close();

            if (iFirstDisplayedScrollingRowIndex < dgvRecordMember.Rows.Count)
            {
                dgvRecordMember.FirstDisplayedScrollingRowIndex = iFirstDisplayedScrollingRowIndex;
            }
            if (dgvEventRecords.FirstDisplayedScrollingColumnIndex < iFirstDisplayedScrollingColumnIndex &&
                iFirstDisplayedScrollingColumnIndex < dgvRecordMember.Columns.Count)
            {
                dgvRecordMember.FirstDisplayedScrollingColumnIndex = iFirstDisplayedScrollingColumnIndex;
            }

            m_bUpdatingUI = false;
        }
Esempio n. 27
0
        private void ShowEventRecordToGrid()
        {
            m_bUpdatingUI = true;
            int iFirstDisplayedScrollingRowIndex    = dgvEventRecords.FirstDisplayedScrollingRowIndex;
            int iFirstDisplayedScrollingColumnIndex = dgvEventRecords.FirstDisplayedScrollingColumnIndex;

            if (iFirstDisplayedScrollingRowIndex < 0)
            {
                iFirstDisplayedScrollingRowIndex = 0;
            }
            if (iFirstDisplayedScrollingColumnIndex < 0)
            {
                iFirstDisplayedScrollingColumnIndex = 0;
            }

            SqlDataReader dbReader = GetEventRecords(GetCurSelEventID(), m_RecordModule.DatabaseConnection);

            if (dbReader == null)
            {
                return;
            }

            List <OVRCheckBoxColumn> lstChkColumns = new List <OVRCheckBoxColumn>();

            for (int j = 0; j < dbReader.FieldCount; j++)
            {
                if ("F_Active" == dbReader.GetName(j) || "F_Equalled" == dbReader.GetName(j) || "F_IsNewCreated" == dbReader.GetName(j))
                {
                    lstChkColumns.Add(new OVRCheckBoxColumn(j, 1, 0));
                }
            }

            List <int> lstCmbColumns = new List <int>();

            for (int j = 0; j < dbReader.FieldCount; j++)
            {
                if ("F_RecordType" == dbReader.GetName(j))
                {
                    lstCmbColumns.Add(j);
                }
            }

            OVRDataBaseUtils.FillDataGridView(dgvEventRecords, dbReader, lstCmbColumns, lstChkColumns);
            //OVRDataBaseUtils.FillDataGridViewWithCmb(dgvEventRecords, dbReader, "F_Equalled");

            dbReader.Close();

            // Edit Enable
            foreach (DataGridViewColumn Col in dgvEventRecords.Columns)
            {
                if (Col.Name == "F_EventID" || Col.Name == "F_RecordID")
                {
                    Col.Visible = false;
                }
                else
                {
                    Col.ReadOnly = false;
                }
            }

            // Edit Enable
            foreach (DataGridViewColumn Col in dgvEventRecords.Columns)
            {
                if (Col.Name == "F_Active" || Col.Name == "F_RecordType" || Col.Name == "F_Equalled" || Col.Name == "F_IsNewCreated" ||
                    Col.Name == "F_RecordDate" || Col.Name == "F_Order" || Col.Name == "F_Location" || Col.Name == "F_RecordSport" ||
                    Col.Name == "F_RecordComment" || Col.Name == "F_RecordValue")
                {
                    Col.ReadOnly = false;
                }
            }


            if (iFirstDisplayedScrollingRowIndex < dgvEventRecords.Rows.Count)
            {
                dgvEventRecords.FirstDisplayedScrollingRowIndex = iFirstDisplayedScrollingRowIndex;
            }
            if (dgvEventRecords.FirstDisplayedScrollingColumnIndex < iFirstDisplayedScrollingColumnIndex &&
                iFirstDisplayedScrollingColumnIndex < dgvEventRecords.Columns.Count)
            {
                dgvEventRecords.FirstDisplayedScrollingColumnIndex = iFirstDisplayedScrollingColumnIndex;
            }

            m_bUpdatingUI = false;
        }
Esempio n. 28
0
        private void btnShowDetailResult_Click(object sender, EventArgs e)
        {
            try
            {
                SqlCommand oneSqlCommand = new SqlCommand();
                oneSqlCommand.Connection = _OuterDBConnection;
                string strSQL;

                strSQL = ConfigurationManager.GetPluginSettingString("DV", "SQL_DetailMatchResult");
                if (strSQL.Length == 0)
                {
                    strSQL = @"SELECT A.EventID AS EventCode
                                        , CAST(B.RoundNo AS NVARCHAR(20)) AS RoundNo
                                        , A.OrderNo AS OrderNo
                                        , DivePoint AS DivePoints
                                        , DiveRank AS DiveRank
                                        , B.EventPoint AS EventPoint
                                        , B.EventPlace AS EventRank
                                        , 10 AS MatchsplitTypeID
                                        , NULL AS JudgeGroup
                                        , NULL AS JudgePanel
                                        FROM dvOrder AS A LEFT JOIN dvRound AS B ON A.EventID = B.EventID AND A.DiverID1 = B.DiverID1 AND (A.DiverID2 IS NULL OR A.DiverID2 = ''  OR A.DiverID2 = B.DiverID2)
                                         WHERE A.EventID = '@MatchCode' AND (@RoundNo= 0 OR B.RoundNo = @RoundNo )
                                        UNION 
                                        SELECT A.EventID AS EventCode
                                        , CAST(B.RoundNo AS NVARCHAR(20)) + '0'+ CAST(B.JudgeGroup AS NVARCHAR(20)) + '0' + CAST (B.JudgePanelDes AS NVARCHAR(20)) RoundNo
                                        , B.OrderNo AS OrderNo
                                        , B.JudgeAward AS DivePoints
                                        , NULL AS DiveRank 
                                        , NULL AS EventPoint 
                                        , NULL AS EventRank
                                        , 31 AS MatchsplitTypeID
                                        , B.JudgeGroup AS JudgeGroup
                                        , B.JudgePanelDes AS JudgePanel
                                        FROM dvOrder AS A 
                                         LEFT JOIN (SELECT RoundNo, OrderNo, EventID, JudgeAward, JudgeGroup, ROW_NUMBER() OVER(PARTITION BY EventID, RoundNo,OrderNo,JudgeGroup ORDER BY JudgePanel) AS JudgePanelDes FROM dvAward ) AS B ON A.OrderNo = B.OrderNo AND A.EventID = B.EventID
                                        WHERE A.EventID = '@MatchCode' AND (@RoundNo  = 0 OR B.RoundNo = @RoundNo) ORDER BY OrderNo";

                    ConfigurationManager.SetPluginSettingString("DV", "SQL_DetailMatchResult", strSQL);
                }
                strSQL = strSQL.Replace("@MatchCode", m_strOutMatchCode);
                strSQL = strSQL.Replace("@RoundNo", m_strRoundNo);


                oneSqlCommand.CommandText = strSQL;
                oneSqlCommand.CommandType = CommandType.Text;
                if (_OuterDBConnection.State == System.Data.ConnectionState.Closed)
                {
                    _OuterDBConnection.Open();
                }

                SqlDataReader sdr = oneSqlCommand.ExecuteReader();

                OVRDataBaseUtils.FillDataGridView(dgvImportInfo, sdr);
                sdr.Close();

                for (int i = 0; i < dgvImportInfo.Rows.Count; i++)
                {
                    for (int j = 0; j < dgvImportInfo.Columns.Count; j++)
                    {
                        dgvImportInfo.Rows[i].Cells[j].ReadOnly = false;
                    }
                }
            }
            catch (Exception ex)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(ex.Message);
            }
        }
Esempio n. 29
0
        //From LiYan
        public void ResetMemberGrid(int iMatchID, int iTeamID, int iTeamPos, ref DataGridView dgv, ref int iStartupNumber)
        {
            if (Common.g_DataBaseCon.State == System.Data.ConnectionState.Closed)
            {
                Common.g_DataBaseCon.Open();
            }

            try
            {
                #region DML Command Setup for Get MatchMember
                SqlCommand cmd = new SqlCommand("Proc_VB_EXT_MatchMemberGetList", Common.g_DataBaseCon);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlParameter cmdParameter1 = new SqlParameter("@MatchID", SqlDbType.Int);
                SqlParameter cmdParameter2 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3);
                SqlParameter cmdParameter3 = new SqlParameter("@TeamPos", SqlDbType.Int);

                cmdParameter1.Value = iMatchID;
                cmdParameter2.Value = Common.g_strLanguage;
                cmdParameter3.Value = iTeamPos;

                cmd.Parameters.Add(cmdParameter1);
                cmd.Parameters.Add(cmdParameter2);
                cmd.Parameters.Add(cmdParameter3);
                #endregion

                SqlDataReader dr = cmd.ExecuteReader();

                int iSelRowIndex = -1;
                if (dgv.Rows.Count > 0 && dgv.SelectedRows != null)
                {
                    //	iSelRowIndex = dgv.SelectedRows[0].Index;
                }

                List <int> lstCmbColumns = new List <int>();
                lstCmbColumns.Add(3);
                lstCmbColumns.Add(5);
                lstCmbColumns.Add(6);

                List <OVRCheckBoxColumn> lstChkColumns = new List <OVRCheckBoxColumn>();
                lstChkColumns.Add(new OVRCheckBoxColumn(0, 1, 0));
                OVRDataBaseUtils.FillDataGridView(dgv, dr, lstCmbColumns, lstChkColumns);

                dr.Close();

                if (dgv.RowCount > 0)
                {
                    dgv.Columns["F_MemberID"].Visible   = false;
                    dgv.Columns["F_StartupNum"].Visible = false;
                    dgv.Columns["Order"].ReadOnly       = false;
                    dgv.Columns["ShirtNumber"].ReadOnly = false;
                    dgv.Columns["DSQ"].ReadOnly         = false;

                    dgv.Columns["Startup"].Visible        = false;
                    dgv.Columns["MaxServeSpeed"].ReadOnly = false;

                    iStartupNumber = Common.Str2Int(dgv.Rows[0].Cells["F_StartupNum"].Value);

                    dgv.ClearSelection();
                    if (iSelRowIndex > 0 && iSelRowIndex < dgv.Rows.Count)
                    {
                        dgv.Rows[iSelRowIndex].Selected = true;
                    }
                }
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }
Esempio n. 30
0
        private void ResetPictureGrid()
        {
            if (this.DatabaseConnection.State == System.Data.ConnectionState.Closed)
            {
                this.DatabaseConnection.Open();
            }

            try
            {
                int iFirstDisplayedScrollingRowIndex    = dgvPicture.FirstDisplayedScrollingRowIndex;
                int iFirstDisplayedScrollingColumnIndex = dgvPicture.FirstDisplayedScrollingColumnIndex;
                if (iFirstDisplayedScrollingRowIndex < 0)
                {
                    iFirstDisplayedScrollingRowIndex = 0;
                }
                if (iFirstDisplayedScrollingColumnIndex < 0)
                {
                    iFirstDisplayedScrollingColumnIndex = 0;
                }

                #region DML Command Setup for Get Picture List

                SqlCommand cmd = new SqlCommand("Proc_GetPictureInfo", this.DatabaseConnection);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader dr = cmd.ExecuteReader();
                m_bUpdate = true;
                OVRDataBaseUtils.FillDataGridView(dgvPicture, dr, null, null);
                m_bUpdate = false;
                dr.Close();

                #endregion


                if (dgvPicture.Columns.Count <= 0)
                {
                    return;
                }

                dgvPicture.Columns["FileCode"].ReadOnly    = false;
                dgvPicture.Columns["FileComment"].ReadOnly = false;
                dgvPicture.Columns["FileType"].ReadOnly    = false;
                dgvPicture.Columns["ID"].Visible           = false;

                dgvPicture.ClearSelection();
                if (m_iSelPicRowIndex >= 0 && m_iSelPicRowIndex < dgvPicture.Rows.Count)
                {
                    dgvPicture.Rows[m_iSelPicRowIndex].Selected = true;
                }

                if (iFirstDisplayedScrollingRowIndex < dgvPicture.Rows.Count)
                {
                    dgvPicture.FirstDisplayedScrollingRowIndex = iFirstDisplayedScrollingRowIndex;
                }
                if (dgvPicture.FirstDisplayedScrollingColumnIndex < iFirstDisplayedScrollingColumnIndex &&
                    iFirstDisplayedScrollingColumnIndex < dgvPicture.Columns.Count)
                {
                    dgvPicture.FirstDisplayedScrollingColumnIndex = iFirstDisplayedScrollingColumnIndex;
                }
            }
            catch (System.Exception e)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show(e.Message);
            }
        }