public void CalculateSummaryResult(System.Data.DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_InnerRows)
        {
            if (this._Summaries == null)
            {
                return;
            }
            // TODO: implement
            foreach (GroupSummary m_Summary in this._Summaries)
            {
                m_Summary.ParentGroupInfo = this.ParentGroupInfo;

                if (m_Summary.SummaryType == SummaryTypes.ParentRelatedPercent)
                {
                    GroupInfo groupInfo = this.ParentGroupInfo;

                    #region Modify codes at 2009-4-8 13:22:22@Simon
                    GroupResult m_Result = groupInfo.ParentGroupResult;
                    while (m_Result != null)
                    {
                        if (m_Result.ParentGroupInfo.IsParentGroup)
                        {
                            break;
                        }

                        m_Result = m_Result.ParentGroupInfo.ParentGroupResult;
                    }

                    if (m_Result != null)
                    {
                        m_Summary.CalculateResult(i_Table, i_OuterRows, m_Result.RowIndicators, this._RowIndicators);

                        continue;
                    }
                    else if (groupInfo.ParentGroupResult != null)
                    {
                        GroupResult parentGroupResult = groupInfo.ParentGroupResult;

                        GroupInfo parentGroupInfo = parentGroupResult.ParentGroupInfo;

                        if (parentGroupInfo.ParentGroupResult != null)
                        {
                            m_Summary.CalculateResult(i_Table, i_OuterRows, parentGroupInfo.ParentGroupResult.RowIndicators /*08-27-2008@Scott*/, this._RowIndicators);

                            continue;
                        }
                    }
                    #endregion            //End Modify

                    m_Summary.CalculateResult(i_Table, i_OuterRows, i_InnerRows /*08-27-2008@Scott*/, this._RowIndicators);
                }
                else if (m_Summary.SummaryType == SummaryTypes.GroupPercent)
                {
                    #region GroupPercent

                    GroupInfo groupInfo = this.ParentGroupInfo;

                    if (groupInfo.ParentGroupResult != null)
                    {
                        GroupResult parentGroupResult = groupInfo.ParentGroupResult;

                        if (parentGroupResult != null)
                        {
                            m_Summary.CalculateResult(i_Table, i_OuterRows, parentGroupResult.RowIndicators, this._RowIndicators);

                            continue;
                        }
                    }


                    m_Summary.CalculateResult(i_Table, i_OuterRows, i_InnerRows /*08-27-2008@Scott*/, this._RowIndicators);

                    #endregion
                }
                else if (m_Summary.SummaryType == SummaryTypes.FrequenceAllData || m_Summary.SummaryType == SummaryTypes.PercentAllData)
                {
                    Int32Collection allResultRows = this.Filter.GetFilteredRows(i_Table, i_OuterRows);

                    m_Summary.CalculateResult(i_Table, i_OuterRows, allResultRows, allResultRows);
                }
                else
                {
                    m_Summary.CalculateResult(i_Table, i_OuterRows, i_InnerRows /*08-27-2008@Scott*/, this._RowIndicators);
                }
            }
        }
        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);
        }
示例#3
0
//        public override void CalculateGroupResult(DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_FilterRows, Webb.Collections.Int32Collection i_InnerRows, GroupInfo i_GroupInfo)
//        {
//            i_GroupInfo.UpdateSectionSummaries();	//Modified at 2009-1-21 15:08:49@Scott

//            this._Filter=AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters,this._Filter);    //2009-4-29 11:37:37@Simon Add UpdateAdvFilter

//            //Added this code at 2008-12-22 8:29:27@Simon
//            #region Modified Area
//            if(this._GroupResults == null) this._GroupResults = new GroupResultCollection();
//            this._GroupResults.Clear();

//            i_InnerRows=this.Filter.GetFilteredRows(i_Table,i_InnerRows);   //Added this code at 2008-12-24 8:26:50@Simon

//            i_FilterRows=this.Filter.GetFilteredRows(i_Table,i_FilterRows);   //Added this code at 2008-12-24 8:26:50@Simon

//            if(this.SectionFilters.Count>0)
//            {
//                if (this.AddTotal)
//                {
//                    GroupResult m_GroupResult = new GroupResult();

//                    m_GroupResult.Filter = new Webb.Data.DBFilter();

//                    m_GroupResult.GroupValue = this.TotalTitle;

//                    m_GroupResult.ParentGroupInfo = this;  //Add at 2009-2-19 14:23:47@Simon

//                    m_GroupResult.ClickEvent = i_GroupInfo.ClickEvent;

//                    this._GroupResults.Add(m_GroupResult);
//                }

//                int LimitCount=0;

//                foreach(SectionFilter m_Section in this.SectionFilters)
//                {
//                   if(this.TopCount>0&&LimitCount>=this.TopCount)break;   //Added this code at 2009-2-9 9:36:32@Simon

//                    GroupResult m_Result = new GroupResult();

//                    m_Result.GroupValue = m_Section.FilterName;

//                    m_Result.Filter = m_Section.Filter;

//                    m_Result.ParentGroupInfo = this;

//                    m_Result.ClickEvent = i_GroupInfo.ClickEvent;

//                    this._GroupResults.Add(m_Result);

//                    LimitCount++;
//                }

//                foreach(GroupResult m_GroupResult in this.GroupResults)
//                {
//                    m_GroupResult.ClickEvent = this.ClickEvent;	//12-28-2007@Scott

//                    m_GroupResult.CalculateRowIndicators(i_Table,i_InnerRows);

//                    if(this.Summaries != null)
//                    {
//                        m_GroupResult.Summaries = this.Summaries.CopyStructure();
//                        m_GroupResult.CalculateSummaryResult(i_Table,i_OuterRows,i_InnerRows);
//                    }
//                }
//            }
//            else
//            {
//                GroupResult m_GroupResult = new GroupResult();
//                m_GroupResult.GroupValue = string.Empty;

//                m_GroupResult.ParentGroupInfo = this;

//                m_GroupResult.RowIndicators = new Int32Collection();
//                i_InnerRows.CopyTo(m_GroupResult.RowIndicators);
//                m_GroupResult.ClickEvent = i_GroupInfo.ClickEvent;
//                this._GroupResults.Add(m_GroupResult);

//                if(this.Summaries != null)
//                {
//                    m_GroupResult.Summaries = this.Summaries.CopyStructure();
//                    m_GroupResult.CalculateSummaryResult(i_Table,i_OuterRows,i_InnerRows);
//                }
//            }

//            if(i_GroupInfo.SubGroupInfos.Count > 0)
//            {
//                foreach(GroupResult m_GroupResult in this._GroupResults)
//                {
////					if(m_GroupResult.RowIndicators==null)continue;
////					m_GroupResult.SubGroupInfos = i_GroupInfo.SubGroupInfos.Copy();
////					foreach(GroupInfo subGroupinfo in m_GroupResult.SubGroupInfos)
////					{
////						subGroupinfo.CalculateGroupResult(i_Table, i_OuterRows,i_FilterRows, m_GroupResult.RowIndicators,subGroupinfo);
////					}

//                    if(m_GroupResult.RowIndicators==null)continue;

//                    m_GroupResult.SubGroupInfos = i_GroupInfo.SubGroupInfos.Copy();

//                    for(int i = 0; i < m_GroupResult.SubGroupInfos.Count; i++)
//                    {
//                        GroupInfo resultGroupInfo = m_GroupResult.SubGroupInfos[i];

//                        GroupInfo subGroupInfo = i_GroupInfo.SubGroupInfos[i];

//                        resultGroupInfo.IsSectionOutSide = false;
//                        subGroupInfo.IsSectionOutSide = false;

//                        System.Diagnostics.Trace.Assert(resultGroupInfo != null && subGroupInfo != null,"Calculate Section Group Error");
//                        resultGroupInfo.CalculateGroupResult(i_Table,i_OuterRows,i_FilterRows,m_GroupResult.RowIndicators,subGroupInfo);
//                    }
//                    //End Edit

//                }
//            }
//            #endregion        //Modify at 2008-12-19 11:29:27@Simon
//        }

        public override void CalculateGroupResult(DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_FilterRows, Webb.Collections.Int32Collection i_InnerRows, GroupInfo i_GroupInfo)
        {
            i_GroupInfo.UpdateSectionSummaries();                                                                             //Modified at 2009-1-21 15:08:49@Scott

            this._Filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Filter); //2009-4-29 11:37:37@Simon Add UpdateAdvFilter

            //Added this code at 2008-12-22 8:29:27@Simon
            #region Modified Area

            if (this._GroupResults == null)
            {
                this._GroupResults = new GroupResultCollection();
            }
            this._GroupResults.Clear();

            i_InnerRows = this.Filter.GetFilteredRows(i_Table, i_InnerRows);   //Added this code at 2008-12-24 8:26:50@Simon

            i_FilterRows = this.Filter.GetFilteredRows(i_Table, i_FilterRows); //Added this code at 2008-12-24 8:26:50@Simon

            if (this.SectionFilters.Count > 0)
            {
                if (this.AddTotal)
                {
                    #region Add total
                    GroupResult m_GroupResult = new GroupResult();

                    m_GroupResult.Filter = new Webb.Data.DBFilter();

                    m_GroupResult.GroupValue = this.TotalTitle;

                    m_GroupResult.ParentGroupInfo = this;  //Add at 2009-2-19 14:23:47@Simon

                    m_GroupResult.ClickEvent = i_GroupInfo.ClickEvent;

                    i_InnerRows.CopyTo(m_GroupResult.RowIndicators);

                    this._GroupResults.Add(m_GroupResult);
                    #endregion
                }

                int LimitCount = 0;

                foreach (SectionFilter m_Section in this.SectionFilters)
                {
                    #region Add group Result

                    if (this.TopCount > 0 && LimitCount >= this.TopCount)
                    {
                        break;                                                     //Added this code at 2009-2-9 9:36:32@Simon
                    }
                    GroupResult m_Result = new GroupResult();

                    m_Result.GroupValue = m_Section.FilterName;

                    m_Result.Filter = m_Section.Filter;

                    m_Result.ParentGroupInfo = this;

                    m_Result.ClickEvent = i_GroupInfo.ClickEvent;

                    m_Result.RowIndicators = new Int32Collection();

                    m_Result.ClickEvent = this.ClickEvent;      //12-28-2007@Scott

                    this._GroupResults.Add(m_Result);

                    LimitCount++;
                    #endregion
                }
                #region Calculate result Rows

                foreach (int row in i_InnerRows)
                {
                    if (row < 0 || row >= i_Table.Rows.Count)
                    {
                        continue;
                    }

                    DataRow dataRow = i_Table.Rows[row];

                    foreach (GroupResult m_GroupResult in this.GroupResults)
                    {
                        if (m_GroupResult.Filter.CheckResultWithBracket(dataRow))        //Modified at 2009-2-16 16:38:31@Scott
                        {
                            if (m_GroupResult.Filter.PlayAfter && i_Table.Rows.Count > row + 1)
                            {
                                m_GroupResult.RowIndicators.Add(row + 1);
                            }
                            else
                            {
                                m_GroupResult.RowIndicators.Add(row);
                            }
                        }
                    }
                }
                #endregion
            }
            else
            {
                GroupResult m_GroupResult = new GroupResult();
                m_GroupResult.GroupValue = string.Empty;

                m_GroupResult.ParentGroupInfo = this;

                m_GroupResult.RowIndicators = new Int32Collection();

                i_InnerRows.CopyTo(m_GroupResult.RowIndicators);

                m_GroupResult.ClickEvent = i_GroupInfo.ClickEvent;

                this._GroupResults.Add(m_GroupResult);
            }

            foreach (GroupResult m_GroupResult in this.GroupResults)
            {
                if (this.Summaries != null)
                {
                    m_GroupResult.Summaries = this.Summaries.CopyStructure();
                    m_GroupResult.CalculateSummaryResult(i_Table, i_OuterRows, i_InnerRows);
                }
            }

            if (i_GroupInfo.SubGroupInfos.Count > 0)
            {
                foreach (GroupResult m_GroupResult in this._GroupResults)
                {
                    if (m_GroupResult.RowIndicators == null)
                    {
                        continue;
                    }

                    m_GroupResult.SubGroupInfos = i_GroupInfo.SubGroupInfos.Copy();

                    for (int i = 0; i < m_GroupResult.SubGroupInfos.Count; i++)
                    {
                        GroupInfo resultGroupInfo = m_GroupResult.SubGroupInfos[i];

                        GroupInfo subGroupInfo = i_GroupInfo.SubGroupInfos[i];

                        resultGroupInfo.IsSectionOutSide = false;
                        subGroupInfo.IsSectionOutSide    = false;

                        System.Diagnostics.Trace.Assert(resultGroupInfo != null && subGroupInfo != null, "Calculate Section Group Error");

                        resultGroupInfo.CalculateGroupResult(i_Table, i_OuterRows, i_FilterRows, m_GroupResult.RowIndicators, subGroupInfo);
                    }
                    //End Edit
                }
            }
            #endregion        //Modify at 2008-12-19 11:29:27@Simon
        }
 public int Add(GroupResult i_Result)
 {
     return(this.InnerList.Add(i_Result));
 }
示例#5
0
        public override void CalculateGroupResult(DataTable i_Table, Webb.Collections.Int32Collection i_OuterRows, Webb.Collections.Int32Collection i_InnerRows, GroupInfo i_GroupInfo)
        {
            i_GroupInfo.UpdateSectionSummaries();                                                                             //Modified at 2009-1-21 15:08:49@Scott

            this._Filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Filter); //2009-4-29 11:37:37@Simon Add UpdateAdvFilter

            #region Modified Area
            if (this._GroupResults == null)
            {
                this._GroupResults = new GroupResultCollection();
            }

            this._GroupResults.Clear();

            i_InnerRows = this.Filter.GetFilteredRows(i_Table, i_InnerRows); //Added this code at 2008-12-24 8:26:50@Simon

            if (this.SectionFilters.Count > 0)                               //modify this code at 2009-2-6 10:15:01@Simon
            {
                int LimitCount = 0;

                foreach (SectionFilter m_Section in this.SectionFilters)
                {
                    if (this.TopCount > 0 && LimitCount >= this.TopCount)
                    {
                        break;                                                                  //Added this code at 2009-2-9 9:36:32@Simon
                    }
                    GroupResult m_Result = new GroupResult();
                    m_Result.GroupValue      = m_Section.FilterName;
                    m_Result.Filter          = m_Section.Filter.Copy();
                    m_Result.ParentGroupInfo = this;
                    m_Result.ClickEvent      = i_GroupInfo.ClickEvent;

                    m_Result.CalculateRowIndicators(i_Table, i_InnerRows);

                    if (m_Result.RowIndicators.Count == 0 && !this.ShowZero)
                    {
                        continue;
                    }

                    if (this.Summaries != null)
                    {
                        m_Result.Summaries = this.Summaries.CopyStructure();
                        m_Result.CalculateSummaryResult(i_Table, i_OuterRows, i_InnerRows);
                    }

                    this._GroupResults.Add(m_Result);

                    LimitCount++;
                }
            }
            else
            {
                GroupResult m_GroupResult = new GroupResult();

                m_GroupResult.GroupValue = string.Empty;

                m_GroupResult.ParentGroupInfo = this;

                m_GroupResult.RowIndicators = new Int32Collection();
                i_InnerRows.CopyTo(m_GroupResult.RowIndicators);
                m_GroupResult.ClickEvent = i_GroupInfo.ClickEvent;
                this._GroupResults.Add(m_GroupResult);

                if (this.Summaries != null)
                {
                    m_GroupResult.Summaries = this.Summaries.CopyStructure();

                    m_GroupResult.CalculateSummaryResult(i_Table, i_OuterRows, i_InnerRows);
                }
            }


            if (i_GroupInfo.SubGroupInfos.Count > 0)
            {
                foreach (GroupResult m_GroupResult in this._GroupResults)
                {
                    if (m_GroupResult.RowIndicators == null)
                    {
                        continue;
                    }
                    m_GroupResult.SubGroupInfos = i_GroupInfo.SubGroupInfos.Copy();

                    for (int i = 0; i < m_GroupResult.SubGroupInfos.Count; i++)
                    {
                        GroupInfo resultGroupInfo = m_GroupResult.SubGroupInfos[i];
                        GroupInfo subGroupInfo    = i_GroupInfo.SubGroupInfos[i];

                        resultGroupInfo.IsSectionOutSide = false;
                        subGroupInfo.IsSectionOutSide    = false;

                        System.Diagnostics.Trace.Assert(resultGroupInfo != null && subGroupInfo != null, "Calculate Section Group Error");
                        resultGroupInfo.CalculateGroupResult(i_Table, i_OuterRows, m_GroupResult.RowIndicators, subGroupInfo);
                    }
                }
            }
            #endregion                    //Modify at 2008-11-4 11:29:27@Scott
        }