Ejemplo n.º 1
0
        public HitChartField(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            try
            {
                name = (string)info.GetValue("name", typeof(string));
            }
            catch
            {
                name = string.Empty;
            }
            try
            {
                text = (string)info.GetValue("text", typeof(string));
            }
            catch
            {
                text = string.Empty;
            }
            try
            {
                position = (System.Drawing.PointF)info.GetValue("position", typeof(System.Drawing.PointF));
            }
            catch
            {
                position = PointF.Empty;
            }
            try
            {
                size = (System.Drawing.SizeF)info.GetValue("size", typeof(System.Drawing.SizeF));
            }
            catch
            {
                size = SizeF.Empty;
            }
            try
            {
                filter = (Webb.Data.DBFilter)info.GetValue("filter", typeof(Webb.Data.DBFilter));

                filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this.filter);    //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                filter = new DBFilter();
            }
            try
            {
                tag = (object)info.GetValue("tag", typeof(object));
            }
            catch
            {
            }
            try
            {
                exControlViews = (Webb.Reports.ExControls.Views.ExControlViewCollection)info.GetValue("exControlViews", typeof(Webb.Reports.ExControls.Views.ExControlViewCollection));
            }
            catch
            {
                exControlViews = new ExControlViewCollection();
            }
        }
Ejemplo n.º 2
0
        public HorizontalGridColumn(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
        {
            try
            {
                _Filter = info.GetValue("_Filter", typeof(DBFilter)) as DBFilter;

                this._Filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Filter);
            }
            catch
            {
                _Filter = new DBFilter();
            }

            try
            {
                _TitleField = info.GetString("_TitleField");
            }
            catch
            {
                _TitleField = string.Empty;
            }

            try
            {
                _Title = info.GetString("_Title");
            }
            catch
            {
                _Title = string.Empty;
            }


            _RowIndicator = -1;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Calculate grouped result
        /// </summary>
        /// <param name="i_Table">data source</param>
        public override void CalculateResult(DataTable i_Table)
        {
            //If have no data source ,clear group struct
            if (i_Table == null)
            {
                this.RootGroupInfo.ClearGroupResult(this._RootGroupInfo);

                _HaveData = false;

                return;
            }

            _HaveData = true;

            if (this.RootGroupInfo.Summaries == null)
            {
                this.RootGroupInfo.Summaries = new GroupSummaryCollection();
            }
            if (this.RootGroupInfo.SubGroupInfos == null || this.RootGroupInfo.SubGroupInfos.Count == 0)
            {
                this.RootGroupInfo.SubGroupInfos = new GroupInfoCollection();

                this.RootGroupInfo.SubGroupInfos.Add(new FieldGroupInfo(""));
            }
            if (MatrixInfo == null)
            {
                this.MatrixInfo = new MatrixInfo(RootGroupInfo, RootGroupInfo.SubGroupInfos[0], null, null);
            }
            else
            {
                this.MatrixInfo = MatrixInfo.CopyFrom(RootGroupInfo, MatrixInfo);
            }

            this.MatrixInfo.MatrixDisplay = this.MatrixDisplay;
            this.MatrixInfo.GridInfo.Apply(this.GridInfo);

            //Filter rows
            Webb.Collections.Int32Collection m_Rows = new Int32Collection();

            if (this.ExControl != null && this.ExControl.Report != null)
            {
                m_Rows = this.ExControl.Report.Filter.GetFilteredRows(i_Table);                        //2009-5-25 11:02:57@Simon Add this Code
            }


            m_Rows = this.OneValueScFilter.Filter.GetFilteredRows(i_Table, m_Rows);

            m_Rows = this.RepeatFilter.Filter.GetFilteredRows(i_Table, m_Rows);

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

            m_Rows = this.Filter.GetFilteredRows(i_Table, m_Rows);                                                          //06-04-2008@Scott

            m_Rows.CopyTo(this.FilteredRows);

            MatrixInfo.CalculateMatrixResult(i_Table, m_Rows);
        }
Ejemplo n.º 4
0
        //fuction
        public override void CalculateResult(DataTable i_Table)
        {
            ChangeTypesFor3D();

            if (i_Table != null)
            {
                Webb.Collections.Int32Collection rows = new Int32Collection();

                Webb.Data.DBFilter dbFilter = this.Filter.Copy();

                if (this.ExControl != null && this.ExControl.Report != null)
                {
                    rows = this.ExControl.Report.Filter.GetFilteredRows(i_Table);                    //2009-5-25 11:02:57@Simon Add this Code

                    dbFilter.Add(this.ExControl.Report.Filter);
                }

                if (this.DenominatorFilter == null)
                {
                    if (this.Repeat)
                    {
                        this.DenominatorFilter = dbFilter;
                    }
                    else if (this.ExControl != null && this.ExControl.Report != null && this.ExControl.Report.OneValuePerPage)
                    {
                        this.DenominatorFilter = dbFilter;
                    }
                    else
                    {
                        this.DenominatorFilter = new Webb.Data.DBFilter();
                    }
                }

                rows = this.OneValueScFilter.Filter.GetFilteredRows(i_Table, rows);

                rows = this.RepeatFilter.Filter.GetFilteredRows(i_Table, rows);                                                 //Added this code at 2008-12-26 12:22:40@Simon

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

                rows = this.Filter.GetFilteredRows(i_Table, rows);

                this._Chart = this.Settings.CreateChart(i_Table, rows);
            }
            else
            {
                this._Chart = this.Settings.CreateChart(null, null);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Calculate grouped result
        /// </summary>
        /// <param name="i_Table">data source</param>
        public override void CalculateResult(DataTable i_Table)
        {
            //If have no data source ,clear group struct
            if (i_Table == null)
            {
                this.RootGroupInfo.ClearGroupResult(this._RootGroupInfo);

                return;
            }

            //Filter rows
            Webb.Collections.Int32Collection m_Rows = new Int32Collection();

            if (this.ExControl != null && this.ExControl.Report != null)
            {
                m_Rows = this.ExControl.Report.Filter.GetFilteredRows(i_Table);  //2009-5-25 11:02:57@Simon Add this Code
            }

            m_Rows = this.OneValueScFilter.Filter.GetFilteredRows(i_Table, m_Rows);                                         //06-04-2008@Scott

            m_Rows = this.RepeatFilter.Filter.GetFilteredRows(i_Table, m_Rows);                                             //Added this code at 2008-12-26 12:22:40@Simon

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

            m_Rows = this.Filter.GetFilteredRows(i_Table, m_Rows);                                                          //06-04-2008@Scott

            DataTable table = this.GradingSectionCollection.CalcualteGradeTable(i_Table, m_Rows);

            Webb.Data.DBFilter filter = new Webb.Data.DBFilter();

            Int32Collection rows = filter.GetFilteredRows(table);

            this._RootGroupInfo.CalculateGroupResult(table, rows, rows, this._RootGroupInfo);

            GradingSectionCollection.TruncateRowIdIntoPlayId(table, this._RootGroupInfo);
        }
Ejemplo n.º 6
0
        public WebbChartExView(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            try
            {
                this._Settings = info.GetValue("Settings", typeof(WebbChartSetting)) as WebbChartSetting;
            }
            catch
            {
                this._Settings = new WebbChartSetting();
            }

            try
            {
                this._Filter = info.GetValue("Filter", typeof(Webb.Data.DBFilter)) as Webb.Data.DBFilter;

                this._Filter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Filter);                 //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch { this._Filter = new Webb.Data.DBFilter(); }

            try
            {
                this._ClickAreas = info.GetValue("ClickAreas", typeof(ArrayList)) as ArrayList;
            }
            catch
            {
                this._ClickAreas = new ArrayList();
            }

            #region Modify codes at 2008-11-18 16:49:14@Simon
            this.HaveExisted = true;
            #endregion                    //End Modify


            try
            {
                this.ShowAxesMode = info.GetBoolean("ShowAxesMode");                        //Added this code at 2008-12-17 9:28:25@Simon
            }
            catch
            {
                this.ShowAxesMode = true;
            }
            try
            {
                this.AutoFitSize = info.GetBoolean("AutoFitSize");                        //Added this code at 2008-12-17 9:28:25@Simon
            }
            catch
            {
                this.AutoFitSize = false;
            }
            try
            {
                this.TopCount = info.GetInt32("TopCount");                        //Added this code at 2008-12-17 9:28:25@Simon
            }
            catch
            {
                this.TopCount = 0;
            }
            try
            {
                this.Relative = info.GetBoolean("Relative");                        //2009-6-19 11:01:33@Simon Add this Code
            }
            catch
            {
                this.Relative = this.AutoFitSize;
            }
        }
Ejemplo n.º 7
0
        public SimpleGroupView(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            // TODO:  Add ExControlView.GetObjectData implementation
            //this.MainStyle = info.GetValue("MainStyle",typeof(BasicStyle)) as BasicStyle;
            try
            {
                this._RootGroupInfo = info.GetValue("_RootGroupInfo", typeof(GroupInfo)) as GroupInfo;
            }
            catch
            {
                this._RootGroupInfo = new Webb.Reports.ExControls.Data.FieldGroupInfo(Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString());
                this._RootGroupInfo.ColumnHeading = "New Group";
            }

            try
            {
                this._ShowRowIndicators = info.GetBoolean("_ShowRowIndicators");
            }
            catch
            {
                this.ShowRowIndicators = false;
            }

            try
            {
                this._OneValuePerPage = info.GetBoolean("_OneValuePerPage");
            }
            catch
            {
                this._OneValuePerPage = false;
            }

            try
            {
                this._SizeSelfAdapting = info.GetBoolean("_SizeSelfAdapting");
            }
            catch
            {
                this._SizeSelfAdapting = false;
            }

            try
            {
                this._FootballType = (FootballTypes)info.GetInt32("_FootballType");
            }
            catch
            {
                this._FootballType = FootballTypes.Both;
            }

            try
            {
                this._Fitler = info.GetValue("_Fitler", typeof(Webb.Data.DBFilter)) as Webb.Data.DBFilter;
                this._Fitler = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Fitler);         //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                this._Fitler = new Webb.Data.DBFilter();
            }

            try
            {
                this._ColumnsWidth = info.GetValue("_ColumnsWidth", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._ColumnsWidth = new Int32Collection();
            }

            try
            {
                this._RowsHight = info.GetValue("_RowsHight", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._RowsHight = new Int32Collection();
            }

            try
            {
                this._Styles = info.GetValue("_Styles", typeof(Styles.ExControlStyles)) as Styles.ExControlStyles;
            }
            catch
            {
                this._Styles = new ExControlStyles();
                this._Styles.LoadDefaultStyle();    //08-14-2008@Scott
            }

            try
            {
                this._BreakRows = info.GetValue("_BreakRows", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._BreakRows = new Int32Collection();
            }

            try
            {
                this._HaveHeader = info.GetBoolean("_HaveHeader");
            }
            catch
            {
                this._HaveHeader = true;
            }

            try
            {
                this._CellSizeAutoAdapting = (CellSizeAutoAdaptingTypes)info.GetValue("_CellSizeAutoAdapting", typeof(CellSizeAutoAdaptingTypes));
            }
            catch
            {
                this._CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.WordWrap;
            }

            try
            {
                this._TopCount = info.GetInt32("_TopCount");
            }
            catch
            {
                this._TopCount = 0;
            }

            try
            {
                this._Total = info.GetBoolean("_Total");
            }
            catch
            {
                this._Total = false;
            }

            try
            {
                this._SectionTitle = info.GetString("_SectionTitle");
            }
            catch
            {
                this._SectionTitle = string.Empty;
            }

            try
            {
                this._SectionInOneRow = info.GetBoolean("_SectionInOneRow");
            }
            catch
            {
                this._SectionInOneRow = true;
            }

            try
            {
                this._TotalTitle = info.GetString("_TotalTitle");
            }
            catch
            {
                this._TotalTitle = "Total";
            }

            try
            {
                this._TotalColumns = info.GetValue("_TotalColumns", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._TotalColumns = new Int32Collection();
            }

            try
            {
                this._HeightPerPage = info.GetInt32("_HeightPerPage");
            }
            catch
            {
                this._HeightPerPage = 0;
            }

            try
            {
                this._AcrossPage = info.GetBoolean("_AcrossPage");
            }
            catch
            {
                this._AcrossPage = false;
            }
        }
Ejemplo n.º 8
0
        public StatInfo(SerializationInfo info, StreamingContext context)
        {
            try
            {
                this._ClickEvent = (ClickEvents)(info.GetValue("_ClickEvent", typeof(ClickEvents)));
            }
            catch
            {
                this._ClickEvent = ClickEvents.PlayVideo;
            }

            try
            {
                this._Title = info.GetString("_Title");
            }
            catch
            {
                this._Title = "New Stat";
            }

            try
            {
                this._FieldName = info.GetString("_FieldName");
            }
            catch
            {
                this._FieldName = string.Empty;
            }

            try
            {
                this._StatTypes = info.GetValue("_StatTypes", typeof(StatTypesCollection)) as StatTypesCollection;
            }
            catch
            {
                this._StatTypes = new StatTypesCollection();
            }

            try
            {
                this._Filter = info.GetValue("_Filter", typeof(DBFilter)) as DBFilter;

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

            try
            {
                this._DenominatorFilter = info.GetValue("_DenominatorFilter", typeof(DBFilter)) as DBFilter;

                this._DenominatorFilter = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._DenominatorFilter);    //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                this._DenominatorFilter = new DBFilter();
            }
            try  //Added this code at 2009-1-5 8:21:00@Simon
            {
                this._FollowedStatTypes = info.GetValue("_FollowedStatTypes", typeof(FollowedStatTypesCollection)) as FollowedStatTypesCollection;
            }
            catch
            {
                this._FollowedStatTypes = new FollowedStatTypesCollection(this._StatTypes);
            }
        }
Ejemplo n.º 9
0
        public StatControlView(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            // TODO:  Add ExControlView.GetObjectData implementation
            try
            {
                this._ColumnsWidth = info.GetValue("_ColumnsWidth", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._ColumnsWidth = new Int32Collection();
            }

            try
            {
                this._Fitler = info.GetValue("Filter", typeof(Webb.Data.DBFilter)) as Webb.Data.DBFilter;

                this._Fitler = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Fitler);                 //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                this._Fitler = new Webb.Data.DBFilter();
            }

            try
            {
                this._StatInfos = info.GetValue("StatInfos", typeof(StatInfoCollection)) as StatInfoCollection;
            }
            catch
            {
                this._StatInfos = new StatInfoCollection();

                this._StatInfos.Add(new StatInfo());
            }

            try
            {
                this._Styles = info.GetValue("Styles", typeof(ExControlStyles)) as ExControlStyles;
            }
            catch
            {
                this._Styles = new ExControlStyles();

                this._Styles.RowStyle.Sides = DevExpress.XtraPrinting.BorderSide.None;

                this._Styles.AlternateStyle.Sides = DevExpress.XtraPrinting.BorderSide.None;
            }

            try
            {
                this._Multiline = info.GetBoolean("Multiline");
            }
            catch
            {
                this._Multiline = true;
            }
            try
            {
                this._Multiline = info.GetBoolean("Multiline");
            }
            catch
            {
                this._Multiline = true;
            }

            try
            {
                this._AdjustWidth = info.GetBoolean("_AdjustWidth");
            }
            catch
            {
                this._AdjustWidth = false;
            }
        }
Ejemplo n.º 10
0
        public MatrixGroupView(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            // TODO:  Add ExControlView.GetObjectData implementation
            //this.MainStyle = info.GetValue("MainStyle",typeof(BasicStyle)) as BasicStyle;
            try
            {
                this._RootGroupInfo = info.GetValue("_RootGroupInfo", typeof(GroupInfo)) as GroupInfo;
            }
            catch
            {
                this._RootGroupInfo = new Webb.Reports.ExControls.Data.FieldGroupInfo(Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString());
                this._RootGroupInfo.ColumnHeading = "New Group";
            }

            try
            {
                this._ShowRowIndicators = info.GetBoolean("_ShowRowIndicators");
            }
            catch
            {
                this.ShowRowIndicators = false;
            }



            try
            {
                this._FootballType = (FootballTypes)info.GetInt32("_FootballType");
            }
            catch
            {
                this._FootballType = FootballTypes.Both;
            }

            try
            {
                this._Fitler = info.GetValue("_Fitler", typeof(Webb.Data.DBFilter)) as Webb.Data.DBFilter;

                this._Fitler = AdvFilterConvertor.GetAdvFilter(DataProvider.VideoPlayBackManager.AdvReportFilters, this._Fitler);                 //2009-4-29 11:37:37@Simon Add UpdateAdvFilter
            }
            catch
            {
                this._Fitler = new Webb.Data.DBFilter();
            }

            try
            {
                this._ColumnsWidth = info.GetValue("_ColumnsWidth", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._ColumnsWidth = new Int32Collection();
            }

            try
            {
                this._RowsHight = info.GetValue("_RowsHight", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._RowsHight = new Int32Collection();
            }

            try
            {
                this._Styles = info.GetValue("_Styles", typeof(Styles.ExControlStyles)) as Styles.ExControlStyles;
            }
            catch
            {
                this._Styles = new ExControlStyles();
                this._Styles.LoadDefaultStyle();                     //08-14-2008@Scott
            }

            try
            {
                this._BreakRows = info.GetValue("_BreakRows", typeof(Int32Collection)) as Int32Collection;
            }
            catch
            {
                this._BreakRows = new Int32Collection();
            }

            try
            {
                this._HaveHeader = info.GetBoolean("_HaveHeader");
            }
            catch
            {
                this._HaveHeader = true;
            }

            try
            {
                this._CellSizeAutoAdapting = (CellSizeAutoAdaptingTypes)info.GetValue("_CellSizeAutoAdapting", typeof(CellSizeAutoAdaptingTypes));
            }
            catch
            {
                this._CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.WordWrap;
            }

            try
            {
                this._HeightPerPage = info.GetInt32("_HeightPerPage");
            }
            catch
            {
                this._HeightPerPage = 0;
            }

            try
            {
                this.TableHeaders = info.GetValue("TableHeaders", typeof(HeadersData)) as HeadersData;
            }
            catch
            {
                this.TableHeaders = null;
            }

            //added 2008-09-08@Simon
            try
            {
                this.SectionFilters = info.GetValue("SectionFilters", typeof(SectionFilterCollection)) as SectionFilterCollection;
            }
            catch
            {
            }

            //Modified at 2009-1-14 17:27:16@Scott
            try
            {
                this.SectionFiltersWrapper = info.GetValue("SectionFiltersWrapper", typeof(SectionFilterCollectionWrapper)) as SectionFilterCollectionWrapper;
            }
            catch
            {
                //this.SectionFiltersWrapper = new SectionFilterCollectionWrapper();
            }
            try
            {
                this._SectionRoot = info.GetBoolean("_SectionRoot");
            }
            catch
            {
                this._SectionRoot = false;
            }
            try
            {
                this._MatrixInfo = info.GetValue("_MatrixInfo", typeof(MatrixInfo)) as MatrixInfo;
            }
            catch
            {
            }

            try
            {
                this._WidthEnable = info.GetBoolean("_WidthEnable");
            }
            catch
            {
                this._WidthEnable = false;
            }
            try
            {
                this._MatrixDisplay = (ComputedStyle)info.GetValue("_MatrixDisplay", typeof(ComputedStyle));
            }
            catch
            {
                this._MatrixDisplay = ComputedStyle.Group;
            }
            try
            {
                this._GridInfo = info.GetValue("_GridInfo", typeof(GridInfo)) as GridInfo;
            }
            catch
            {
                this._GridInfo      = null;
                this._MatrixDisplay = ComputedStyle.Group;
            }
        }
Ejemplo n.º 11
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
        }
Ejemplo n.º 12
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
        }