Пример #1
0
        public SectionFiltersEditorForm(object value)
        {
            if (DataProvider == null)
            {
                this.DataProvider = new Webb.Reports.DataProvider.WebbDataProvider();
            }
            InitializeComponent();
            this.cmbAttribute.SelectedIndex = 0;
            if (value != null)
            {
                SectionFilterCollection i_SectionFilters = null;

                if (value is SectionFilterCollectionWrapper)
                {
                    i_SectionFilters = (value as SectionFilterCollectionWrapper).SectionFilters;                        //Modified at 2009-1-15 10:27:08@Scott
                    int index = (int)((value as SectionFilterCollectionWrapper).ReportScType);                          //Modified at 2009-1-15 11:26:10@Scott

                    if (index < 5)
                    {
                        this.cmbAttribute.SelectedIndex = index;
                    }
                    else
                    {
                        this.cmbAttribute.SelectedIndex = this.cmbAttribute.Items.Count - 1;
                    }

                    if ((value as SectionFilterCollectionWrapper).ReportScType != ReportScType.Custom)
                    {
                        this.LoadAdvSectionFilters(string.Empty, (value as SectionFilterCollectionWrapper).ReportScType);
                        this.AddFilters(this.SectionFilters);
                        return;
                    }
                }
                else if (value is SectionFilterCollection)
                {
                    i_SectionFilters = value as SectionFilterCollection;
                }
                else
                {
                    i_SectionFilters = new SectionFilterCollection();
                }
                this.AddFilters(i_SectionFilters);
                this.SectionFilters = i_SectionFilters;
                this.SectionFiltersWrapper.SectionFilters = this.SectionFilters;                        //Modified at 2009-1-15 10:43:11@Scott
            }
        }
Пример #2
0
        private void SetALLList(GridInfo gridInfo)
        {
            this.C_LBFields.Items.Clear();

            Webb.Reports.DataProvider.WebbDataProvider PublicDataProvider = Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider;

            if (PublicDataProvider != null && PublicDataProvider.DBSourceConfig != null && PublicDataProvider.DBSourceConfig.WebbDBType == Webb.Reports.DataProvider.WebbDBTypes.CoachCRM)
            {
                #region  CoachCRM List
                DataSet ds = Webb.Reports.DataProvider.VideoPlayBackManager.DataSource;

                if (ds != null && ds.Tables.Count > 1)
                {
                    #region Have Structure

                    this.cmbAllFieldCategories.Visible = true;

                    this.lblSelectedColumns.Visible = true;

                    this.TBXEdit.Visible = false;

                    this.TBXEdit.Location = this.C_LBFields.Location;

                    HashCategories.Clear();

                    List <string> categories = new List <string>();

                    string strCategoriesName = ds.Tables[0].TableName;

                    categories.Add(strCategoriesName);

                    GridColumnCollection colfieldsInAllcategories = new GridColumnCollection();

                    HashCategories.Add(strCategoriesName, colfieldsInAllcategories);

                    foreach (DataRow dr in ds.Tables[1].Rows)
                    {
                        string strValue = string.Empty;

                        if (dr["CurrentField"] == null || (dr["CurrentField"] is System.DBNull))
                        {
                            continue;
                        }

                        string strTableName = dr["Category"].ToString();

                        strValue = dr["CurrentField"].ToString();

                        string strDefaultHeader = dr["DefaultHeader"].ToString();

                        GridColumnCollection colfieldList;

                        GridColumn column = new GridColumn(strValue, strDefaultHeader);

                        column.Description = strDefaultHeader;

                        if (HashCategories.Contains(strTableName))
                        {
                            colfieldList = (GridColumnCollection)HashCategories[strTableName];

                            if (!colfieldList.Contains(strValue))
                            {
                                colfieldList.Add(column);
                            }
                        }
                        else
                        {
                            colfieldList = new GridColumnCollection();

                            colfieldList.Add(column);

                            categories.Add(strTableName);

                            HashCategories.Add(strTableName, colfieldList);
                        }

                        if (!colfieldsInAllcategories.Contains(strValue))
                        {
                            colfieldsInAllcategories.Add(column);
                        }
                    }

                    this.cmbAllFieldCategories.Items.Clear();

                    this.cmbAllFieldCategories.Text = string.Empty;

                    foreach (string strKey in categories)
                    {
                        this.cmbAllFieldCategories.Items.Add(strKey);
                    }

                    this.cmbAllFieldCategories.SelectedIndex = 0;

                    #endregion
                }
                else
                {
                    this.cmbAllFieldCategories.Visible = false;

                    this.lblSelectedColumns.Visible = false;

                    this.TBXEdit.Visible = false;

                    this.TBXEdit.Location = this.C_LBFields.Location;

                    foreach (string strField in Webb.Data.PublicDBFieldConverter.AvialableFields)
                    {
                        if (gridInfo.Columns.Contains(strField))
                        {
                            continue;
                        }

                        GridColumn column = new GridColumn(strField);

                        this.C_LBFields.Items.Add(column);
                    }
                }
                #endregion
            }
            else
            {
                this.cmbAllFieldCategories.Visible = false;

                this.lblSelectedColumns.Visible = false;

                this.TBXEdit.Visible = false;

                this.TBXEdit.Location = this.C_LBFields.Location;

                foreach (string strField in Webb.Data.PublicDBFieldConverter.AvialableFields)
                {
                    if (gridInfo.Columns.Contains(strField))
                    {
                        continue;
                    }

                    GridColumn column = new GridColumn(strField);

                    this.C_LBFields.Items.Add(column);
                }
            }
        }
Пример #3
0
        //04-11-2008@Scott
        private void CalculateTotal(DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_Rows, Data.StatTypes i_Type)
        {
            decimal m_Total = 0, fieldValue = 0m;

            DateTime totalDateTime = new DateTime(0);

            Webb.Reports.DataProvider.WebbDataProvider publicprovider = Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider;

            bool isTimeData = (publicprovider != null && publicprovider.IsCCRMTimeData(this._FieldName));

            bool isFeetInchesData = (publicprovider != null && publicprovider.IsFeetInchesData(this._FieldName));

            if (!i_Table.Columns.Contains(this._FieldName))
            {
                goto EXIT;
            }

            foreach (int i_RowIndex in i_Rows)
            {
                try
                {
                    #region Old
                    //string strValue = i_Table.Rows[i_RowIndex][this._FieldName].ToString();

                    //if (strValue == null || strValue == string.Empty)
                    //{
                    //    continue;
                    //}

                    //decimal fieldValue = Convert.ToDecimal(strValue);

                    //switch (i_Type)
                    //{
                    //    case Data.StatTypes.TotalPlus:
                    //        if (fieldValue > 0) m_Total += fieldValue;
                    //        break;

                    //    case Data.StatTypes.TotalMinus:
                    //        if (fieldValue < 0) m_Total += fieldValue;
                    //        break;

                    //    case Data.StatTypes.Total:
                    //    default:
                    //        m_Total += fieldValue;
                    //        break;
                    //}
                    #endregion

                    #region New
                    object objValue = i_Table.Rows[i_RowIndex][this._FieldName];

                    if (objValue == null || objValue is System.DBNull)
                    {
                        continue;
                    }

                    if (isTimeData)
                    {
                        TimeSpan timeSpan = Webb.Utility.ConvertToTimeTicks(objValue.ToString());

                        totalDateTime = totalDateTime.Add(timeSpan);
                    }
                    if (isFeetInchesData)
                    {
                        fieldValue = Webb.Utility.ConvertFeetInchToNum(objValue.ToString());

                        m_Total += fieldValue;
                    }
                    else
                    {
                        #region calcaulate Numer

                        string strValue = objValue.ToString();

                        if (strValue == null || strValue == string.Empty)
                        {
                            continue;
                        }

                        fieldValue = Convert.ToDecimal(strValue);

                        switch (i_Type)
                        {
                        case Data.StatTypes.AveragePlus:
                            if (fieldValue > 0)
                            {
                                m_Total += fieldValue;
                            }
                            break;

                        case Data.StatTypes.AverageMinus:
                            if (fieldValue < 0)
                            {
                                m_Total += fieldValue;
                            }

                            break;

                        case Data.StatTypes.Average:
                        default:
                            m_Total += fieldValue;
                            break;
                        }
                        #endregion
                    }
                    #endregion
                }
                catch { continue; }
            }
EXIT:
            if (isTimeData)
            {
                object objResultValue = string.Empty;

                #region CCRM Time Description

                bool outputTimeFormat = Webb.Utility.IsTimeFormatForOut(i_Table, i_OuterRows, _FieldName);

                if (outputTimeFormat)
                {
                    if (totalDateTime.Hour > 0)
                    {
                        objResultValue = totalDateTime.ToString("h:m:s.ff");
                    }
                    else
                    {
                        objResultValue = totalDateTime.ToString("m:s.ff");;
                    }
                }
                else
                {
                    objResultValue = totalDateTime.TimeOfDay.TotalSeconds;;
                }

                this._Result.Add(objResultValue);

                #endregion
            }
            else if (isFeetInchesData)
            {
                this._Result.Add(Webb.Utility.FormatFeetInchData(m_Total));
            }
            else
            {
                this._Result.Add(m_Total);
            }
        }
Пример #4
0
        private void CalculateAverage(DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_Rows, Data.StatTypes i_Type)
        {
            decimal m_Sum = 0, fieldValue = 0m;

            DateTime totalDateTime = new DateTime(0);

            long timeTicks = 0;

            Type type = null;

            Webb.Reports.DataProvider.WebbDataProvider publicprovider = Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider;

            bool isTimeData = (publicprovider != null && publicprovider.IsCCRMTimeData(this._FieldName));

            bool isFeetInchesData = (publicprovider != null && publicprovider.IsFeetInchesData(this._FieldName));

            if (!i_Table.Columns.Contains(this._FieldName))
            {
                goto EXIT;
            }

            type = i_Table.Columns[_FieldName].DataType;

            foreach (int i_RowIndex in i_Rows)
            {
                try
                {
                    #region Old
                    //string strValue = i_Table.Rows[i_RowIndex][this._FieldName].ToString();

                    //if (strValue == null || strValue == string.Empty)
                    //{
                    //    continue;
                    //}

                    //double fieldValue = Convert.ToDouble(strValue);

                    //switch (i_Type)
                    //{
                    //    case Data.StatTypes.AveragePlus:
                    //        if (fieldValue > 0) m_Sum += fieldValue;
                    //        break;

                    //    case Data.StatTypes.AverageMinus:
                    //        if (fieldValue < 0) m_Sum += fieldValue;
                    //        break;

                    //    case Data.StatTypes.Average:
                    //    default:
                    //        m_Sum += fieldValue;
                    //        break;
                    //}
                    #endregion

                    object objValue = i_Table.Rows[i_RowIndex][this._FieldName];

                    if (objValue == null || objValue is System.DBNull)
                    {
                        continue;
                    }

                    if (isTimeData)
                    {
                        TimeSpan timeSpan = Webb.Utility.ConvertToTimeTicks(objValue.ToString());

                        totalDateTime = totalDateTime.Add(timeSpan);
                    }
                    if (isFeetInchesData)
                    {
                        fieldValue = Webb.Utility.ConvertFeetInchToNum(objValue.ToString());

                        m_Sum += fieldValue;
                    }
                    else if (type == typeof(DateTime))
                    {
                        timeTicks += Convert.ToDateTime(objValue).Ticks;
                    }
                    else
                    {
                        #region calcaulate Numer

                        string strValue = objValue.ToString();

                        if (strValue == null || strValue == string.Empty)
                        {
                            continue;
                        }

                        fieldValue = Convert.ToDecimal(strValue);

                        switch (i_Type)
                        {
                        case Data.StatTypes.AveragePlus:
                            if (fieldValue > 0)
                            {
                                m_Sum += fieldValue;
                            }
                            break;

                        case Data.StatTypes.AverageMinus:
                            if (fieldValue < 0)
                            {
                                m_Sum += fieldValue;
                            }

                            break;

                        case Data.StatTypes.Average:
                        default:
                            m_Sum += fieldValue;
                            break;
                        }
                        #endregion
                    }
                }
                catch { continue; }
            }

EXIT:
            if (i_Rows.Count > 0)
            {
                #region Old
                //this._Result.Add(m_Sum / i_Rows.Count);
                #endregion

                object objResultValue = string.Empty;

                #region New
                if (type == typeof(DateTime))
                {
                    objResultValue = new DateTime(timeTicks / i_Rows.Count);

                    objResultValue = CResolveFieldValue.GetResolveValue(this._FieldName, @"M/d/yy", objResultValue);
                }
                if (isTimeData)
                {
                    timeTicks = totalDateTime.Ticks / i_Rows.Count;

                    DateTime dateTime = new DateTime(timeTicks);

                    bool outputTimeFormat = Webb.Utility.IsTimeFormatForOut(i_Table, i_OuterRows, _FieldName);

                    if (outputTimeFormat)
                    {
                        if (dateTime.Hour > 0)
                        {
                            objResultValue = dateTime.ToString("h:m:s.ff");
                        }
                        else
                        {
                            objResultValue = dateTime.ToString("m:s.ff");;
                        }
                    }
                    else
                    {
                        objResultValue = dateTime.TimeOfDay.TotalSeconds;
                    }
                }
                else if (isFeetInchesData)
                {
                    m_Sum = m_Sum / i_Rows.Count;

                    objResultValue = Webb.Utility.FormatFeetInchData(m_Sum);
                }
                else
                {
                    objResultValue = m_Sum / i_Rows.Count;
                }
                #endregion

                this._Result.Add(objResultValue);
            }
            else
            {
                this._Result.Add(0);
            }
        }
Пример #5
0
        int IComparer.Compare(object x, object y)
        {
            // TODO:  Add GroupResultCollection.Compare implementation
            if (this._SortByType == SortingByTypes.None)
            {
                return(0);
            }
            int m_Result = 0;

            Webb.Reports.DataProvider.WebbDataProvider publicprovider = Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider;

            if (this._SortByType == SortingByTypes.GroupedVale)
            {
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;

                string strX = string.Empty;

                if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                {
                    strX = m_x.GroupValue.ToString();
                }

                string strY = string.Empty;

                if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                {
                    strY = m_y.GroupValue.ToString();
                }

                m_Result = String.Compare(strX, strY);
            }
            else if (this._SortByType == SortingByTypes.GroupedValueOrNumber)  //2009-12-8 16:22:28@Simon Add this Code
            {
                #region GroupedValueOrNumber
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;

                if (m_x.GroupValue is System.DateTime && m_y.GroupValue is System.DateTime)
                {
                    #region Datetime Dat
                    try
                    {
                        DateTime dt1 = (DateTime)m_x.GroupValue;
                        DateTime dt2 = (DateTime)m_y.GroupValue;
                        m_Result = DateTime.Compare(dt1, dt2);
                    }
                    catch
                    {
                        m_Result = String.Compare(m_x.GroupValue.ToString(), m_y.GroupValue.ToString());
                    }
                    #endregion
                }
                else
                {
                    #region String Or Numeric
                    string strX = string.Empty;

                    if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                    {
                        strX = m_x.GroupValue.ToString();
                    }

                    string strY = string.Empty;

                    if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                    {
                        strY = m_y.GroupValue.ToString();
                    }

                    bool X_isNum = Webb.Utility.IsNumeric(strX);

                    bool Y_isNum = Webb.Utility.IsNumeric(strY);

                    if (X_isNum && Y_isNum)
                    {
                        try
                        {
                            float a = Convert.ToSingle(strX);
                            float b = Convert.ToSingle(strY);

                            if (a > b)
                            {
                                m_Result = 1;
                            }
                            else if (a < b)
                            {
                                m_Result = -1;
                            }

                            else
                            {
                                m_Result = 0;
                            }
                        }
                        catch
                        {
                            m_Result = String.Compare(m_x.GroupValue.ToString(), m_y.GroupValue.ToString());
                        }
                    }
                    else
                    {
                        m_Result = String.Compare(m_x.GroupValue.ToString(), m_y.GroupValue.ToString());
                    }
                    #endregion

                    #region Time/FeetInchesData Field For CCRM
                    if ((m_x.ParentGroupInfo is FieldGroupInfo) && (m_y.ParentGroupInfo is FieldGroupInfo))
                    {
                        string strXField = (m_x.ParentGroupInfo as FieldGroupInfo).GroupByField;
                        string strYField = (m_y.ParentGroupInfo as FieldGroupInfo).GroupByField;

                        if (publicprovider != null)
                        {
                            if (publicprovider.IsCCRMTimeData(strXField) && publicprovider.IsCCRMTimeData(strYField))
                            {
                                TimeSpan timeSpanX = Webb.Utility.ConvertToTimeTicks(strX);

                                TimeSpan timeSpanY = Webb.Utility.ConvertToTimeTicks(strY);

                                m_Result = TimeSpan.Compare(timeSpanX, timeSpanY);
                            }
                            else if (publicprovider.IsFeetInchesData(strXField) && publicprovider.IsFeetInchesData(strYField))
                            {
                                decimal inumX = Webb.Utility.ConvertFeetInchToNum(strX);
                                decimal inumY = Webb.Utility.ConvertFeetInchToNum(strY);

                                m_Result = decimal.Compare(inumX, inumY);
                            }
                        }
                    }
                    #endregion
                }
                #endregion
            }
            else if (this._SortByType == SortingByTypes.Frequence)
            {
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;

                m_Result = m_x.RowIndicators.Count - m_y.RowIndicators.Count;

                if (m_Result == 0)
                {
                    string strX = string.Empty;

                    if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                    {
                        strX = m_x.GroupValue.ToString();
                    }

                    string strY = string.Empty;

                    if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                    {
                        strY = m_y.GroupValue.ToString();
                    }

                    m_Result = String.Compare(strX, strY);
                }
            }
            else if (this._SortByType == SortingByTypes.Number || this._SortByType == SortingByTypes.FootballField)
            {
                #region Number Or FootballField
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;

                if (m_x.GroupValue is System.DateTime && m_y.GroupValue is System.DateTime)
                {
                    #region Datetime
                    try
                    {
                        DateTime dt1 = (DateTime)m_x.GroupValue;
                        DateTime dt2 = (DateTime)m_y.GroupValue;
                        m_Result = DateTime.Compare(dt1, dt2);
                    }
                    catch
                    {
                        m_Result = String.Compare(m_x.GroupValue.ToString(), m_y.GroupValue.ToString());
                    }
                    goto EXIT;
                    #endregion
                }

                string strX = string.Empty;

                if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                {
                    strX = m_x.GroupValue.ToString();
                }

                string strY = string.Empty;

                if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                {
                    strY = m_y.GroupValue.ToString();
                }

                if (strX == string.Empty && strY != string.Empty)
                {
                    m_Result = -1;
                    goto EXIT;
                }
                if (strY == string.Empty && strX != string.Empty)
                {
                    m_Result = 1;
                    goto EXIT;
                }
                if (strY == string.Empty && strX == string.Empty)
                {
                    m_Result = 0;
                    goto EXIT;
                }
                try
                {
                    if ((m_x.ParentGroupInfo is FieldGroupInfo) && (m_y.ParentGroupInfo is FieldGroupInfo))
                    {
                        #region Time/FeetInchesData Field For CCRM

                        string strXField = (m_x.ParentGroupInfo as FieldGroupInfo).GroupByField;
                        string strYField = (m_y.ParentGroupInfo as FieldGroupInfo).GroupByField;

                        if (publicprovider != null)
                        {
                            if (publicprovider.IsCCRMTimeData(strXField) && publicprovider.IsCCRMTimeData(strYField))
                            {
                                TimeSpan timeSpanX = Webb.Utility.ConvertToTimeTicks(strX);

                                TimeSpan timeSpanY = Webb.Utility.ConvertToTimeTicks(strY);

                                m_Result = TimeSpan.Compare(timeSpanX, timeSpanY);

                                goto EXIT;
                            }
                            else if (publicprovider.IsFeetInchesData(strXField) && publicprovider.IsFeetInchesData(strYField))
                            {
                                decimal inumX = Webb.Utility.ConvertFeetInchToNum(strX);
                                decimal inumY = Webb.Utility.ConvertFeetInchToNum(strY);

                                m_Result = decimal.Compare(inumX, inumY);

                                goto EXIT;
                            }
                        }

                        #endregion
                    }

                    #region Number Or FootballField

                    int i = Convert.ToInt32(strX);
                    int j = Convert.ToInt32(strY);
                    if (this._SortByType == SortingByTypes.FootballField)
                    {//by football field
                        #region Old Only Yard Field

                        //GroupInfo gi = (x as GroupResult).ParentGroupInfo;
                        //if (gi is FieldGroupInfo)
                        //{
                        //    if ((gi as FieldGroupInfo).GroupByField == "Yard")
                        //    {
                        //        m_Result = CompareByFootballField(i, j);
                        //        goto EXIT;
                        //    }
                        //}
                        //m_Result = 0;

                        #endregion

                        m_Result = CompareByFootballField(i, j);
                    }
                    else
                    {//by number
                        if (i > j)
                        {
                            m_Result = 1;
                        }
                        else if (i < j)
                        {
                            m_Result = -1;
                        }
                        else
                        {
                            m_Result = 0;
                        }
                    }
                    #endregion
                }
                catch
                {
                    m_Result = 0;
                }
                #endregion
            }
            else if (this._SortByType == SortingByTypes.UserDefinedOrder && this._UserDefinedValues != null)
            {
                #region  UserDefinedOrder
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;
                if (this._UserDefinedValues.Contains(m_x.GroupValue) && this._UserDefinedValues.Contains(m_y.GroupValue))
                {
                    m_Result = this._UserDefinedValues.IndexOf(m_x.GroupValue) - this._UserDefinedValues.IndexOf(m_y.GroupValue);
                }
                else if (this._UserDefinedValues.Contains(m_x.GroupValue))
                {
                    m_Result = -1;
                }
                else if (this._UserDefinedValues.Contains(m_y.GroupValue))
                {
                    m_Result = 1;
                }
                #endregion
            }
            else if (this._SortByType == SortingByTypes.DateTime)   // 10-13-2011 Scott
            {
                GroupResult m_x = x as GroupResult;
                GroupResult m_y = y as GroupResult;

                string strX = string.Empty;
                string strY = string.Empty;

                DateTime dateX;
                DateTime dateY;

                if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                {
                    strX = m_x.GroupValue.ToString();
                }

                if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                {
                    strY = m_y.GroupValue.ToString();
                }

                try
                {
                    dateX    = (DateTime)m_x.GroupValue;
                    dateY    = (DateTime)m_y.GroupValue;
                    m_Result = DateTime.Compare(dateX, dateY);
                }
                catch
                {
                    m_Result = string.Compare(strX, strY);
                }
            }
            else if (this._SortByType == SortingByTypes.PlayerPosition) // 09-26-2011 Scott
            {
                GroupResult m_x    = x as GroupResult;
                GroupResult m_y    = y as GroupResult;
                string      strX   = string.Empty;
                string      strY   = string.Empty;
                int         indexX = -1;
                int         indexY = -1;

                if (m_x.GroupValue != null && !(m_x.GroupValue is System.DBNull))
                {
                    strX = m_x.GroupValue.ToString();
                }

                if (m_y.GroupValue != null && !(m_y.GroupValue is System.DBNull))
                {
                    strY = m_y.GroupValue.ToString();
                }

                for (int indexPos = 0; indexPos < PlayerPositions.Length; indexPos++)
                {
                    if (strX.StartsWith(PlayerPositions[indexPos]))
                    {
                        indexX = indexPos;

                        break;
                    }
                }

                for (int indexPos = 0; indexPos < PlayerPositions.Length; indexPos++)
                {
                    if (strY.StartsWith(PlayerPositions[indexPos]))
                    {
                        indexY = indexPos;

                        break;
                    }
                }

                if (indexX != indexY)
                {
                    m_Result = indexX < indexY ? -1 : 1;
                }
                else
                {
                    string strNumX = string.Empty;
                    string strNumY = string.Empty;

                    if (indexX >= 0)
                    {
                        strNumX = strX.Replace(PlayerPositions[indexX], string.Empty);
                    }

                    if (indexY >= 0)
                    {
                        strNumY = strY.Replace(PlayerPositions[indexY], string.Empty);
                    }

                    m_Result = string.Compare(strNumX, strNumY);
                }
            }
EXIT:
            return(_SortingType == SortingTypes.Ascending ? m_Result : -m_Result);
        }