Example #1
0
        public FollowedStatTypesCollection Copy()
        {
            FollowedStatTypesCollection newfollowStatTypes = new FollowedStatTypesCollection();

            foreach (FollowedStatTypes i_Obj in this)
            {
                newfollowStatTypes.Add(i_Obj.Copy());
            }

            return(newfollowStatTypes);
        }
Example #2
0
        public StatInfo(StatInfo info)
        {
            this._Filter            = info.Filter.Copy();
            this._DenominatorFilter = info.DenominatorFilter.Copy();
            this._StatTypes         = info.StatTypes.Copy();
            this._ClickEvent        = info.ClickEvent;
            this._FieldName         = info.StatField;
            this._Title             = info.Title;
            this._Result            = new ArrayList();

            this._FollowedStatTypes = info._FollowedStatTypes.Copy();
        }
Example #3
0
        //End

        public StatInfo()
        {
            this._Filter            = new DBFilter();
            this._DenominatorFilter = new DBFilter();
            this._StatTypes         = new StatTypesCollection();
            this._StatTypes.Add(Data.StatTypes.Frequence);
            this._ClickEvent = ClickEvents.PlayVideo;
            this._FieldName  = string.Empty;
            this._Result     = new ArrayList();
            this._Title      = "New Stat";

            this._FollowedStatTypes = new FollowedStatTypesCollection(this._StatTypes);   //Added this code at 2009-1-4 11:26:59@Simon
        }
Example #4
0
        //		private void CalculateResultEx(System.Data.DataTable i_Table,Webb.Collections.Int32Collection i_FilteredRows/*outer filter*/, Webb.Collections.Int32Collection i_Rows/*inner filter*/)
        //		{
        //			foreach(Data.StatTypes type in this.StatTypes)
        //			{
        //				switch(type)
        //				{
        //					case Data.StatTypes.Average:
        //					case Data.StatTypes.AveragePlus:
        //					case Data.StatTypes.AverageMinus:
        //						this.CalculateAverage(i_Table, i_Rows, type);
        //						break;
        //
        //					case Data.StatTypes.Frequence:
        //						this._Result.Add(i_Rows.Count);
        //						break;
        //
        //					case Data.StatTypes.Max:
        //						this.CalculateMax(i_Table,i_Rows);
        //						break;
        //
        //					case Data.StatTypes.Min:
        //						this.CalculateMin(i_Table,i_Rows);
        //						break;
        //
        //					case Data.StatTypes.Percent:
        //						Webb.Collections.Int32Collection denominatorRows = this.GetFilteredRows(i_Table, i_FilteredRows, this._DenominatorFilter);
        //						if(denominatorRows.Count > 0)
        //						{
        //							this._Result.Add(1.0 * i_Rows.Count / denominatorRows.Count);
        //						}
        //						else
        //						{
        //							this._Result.Add(0);
        //						}
        //						break;
        //
        //					case Data.StatTypes.DistFrequence:
        //						this.CalculateDistFrequence(i_Table,i_Rows);	//Modified at 2008-11-20 13:36:28@Scott
        //						break;
        //
        //					case Data.StatTypes.DistPercent:
        //						this.CalculateDistPercent(i_Table,i_FilteredRows,i_Rows);	//Modified at 2008-11-20 13:36:31@Scott
        //						break;
        //
        //					case Data.StatTypes.Total:
        //					case Data.StatTypes.TotalPlus:
        //					case Data.StatTypes.TotalMinus:
        //						this.CalculateTotal(i_Table, i_Rows, type);
        //						break;
        //					case Data.StatTypes.OneValuePercent:	//Modified at 2008-11-11 16:10:57@Scott
        //						this.CalculateOneValuePercent(i_Table,i_FilteredRows,i_Rows);
        //						break;
        //					default:
        //						this._Result.Add(string.Empty);
        //						break;
        //				}
        //			}
        //		}

        #endregion
        private void CalculateResultEx(System.Data.DataTable i_Table, Webb.Collections.Int32Collection i_FilteredRows /*outer filter*/, Webb.Collections.Int32Collection i_Rows /*inner filter*/)
        {
            FollowedStatTypesCollection statTypesFollow = this._FollowedStatTypes;

            this.StatTypes.Clear();
            foreach (FollowedStatTypes followtype in statTypesFollow)
            {
                StatTypes type = followtype.StatTypes;
                this.StatTypes.Add(type);
                switch (type)
                {
                case Data.StatTypes.Average:
                case Data.StatTypes.AveragePlus:
                case Data.StatTypes.AverageMinus:
                    this.CalculateAverage(i_Table, i_FilteredRows, i_Rows, type);
                    break;

                case Data.StatTypes.Frequence:
                    this._Result.Add(i_Rows.Count);
                    break;

                case Data.StatTypes.Max:
                    this.CalculateMax(i_Table, i_Rows);
                    break;

                case Data.StatTypes.Min:
                    this.CalculateMin(i_Table, i_Rows);
                    break;

                case Data.StatTypes.Percent:
                    Webb.Collections.Int32Collection denominatorRows = this.GetFilteredRows(i_Table, i_FilteredRows, this._DenominatorFilter);
                    if (denominatorRows.Count > 0)
                    {
                        this._Result.Add(1.0 * i_Rows.Count / denominatorRows.Count);
                    }
                    else
                    {
                        this._Result.Add(0);
                    }
                    break;

                case Data.StatTypes.DistFrequence:
                    this.CalculateDistFrequence(i_Table, i_Rows);       //Modified at 2008-11-20 13:36:28@Scott
                    break;

                case Data.StatTypes.DistPercent:
                    this.CalculateDistPercent(i_Table, i_FilteredRows, i_Rows);         //Modified at 2008-11-20 13:36:31@Scott
                    break;

                case Data.StatTypes.Total:
                case Data.StatTypes.TotalPlus:
                case Data.StatTypes.TotalMinus:
                    this.CalculateTotal(i_Table, i_FilteredRows, i_Rows, type);
                    break;

                case Data.StatTypes.OneValuePercent:            //Modified at 2008-11-11 16:10:57@Scott
                    this.CalculateOneValuePercent(i_Table, i_FilteredRows, i_Rows);
                    break;

                default:
                    this._Result.Add(string.Empty);
                    break;
                }
            }
        }
Example #5
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);
            }
        }