示例#1
0
        private void UpdateSectionInfo(PageGroupInfo groupInfo)
        {
            PageSectionInfo newpageSections = groupInfo as PageSectionInfo;

            if (newpageSections != null)
            {
                SectionFilterCollectionWrapper scFilterWrapper = new SectionFilterCollectionWrapper();

                scFilterWrapper.ReportScType = newpageSections.SectionFilterWrapper.ReportScType;

                foreach (SectionFilter scFilter in   newpageSections.SectionFilterWrapper.SectionFilters)
                {
                    if (scFilter == null)
                    {
                        scFilterWrapper.SectionFilters.Add(scFilter);
                    }
                    else
                    {
                        SectionFilter newScFilter = new SectionFilter();

                        newScFilter.Apply(scFilter);

                        scFilterWrapper.SectionFilters.Add(newScFilter);
                    }
                }

                (groupInfo as PageSectionInfo).SectionFilterWrapper = scFilterWrapper;
            }
        }
示例#2
0
        public SectionFilter GetReportFilter(ScAFilter scFilter)
        {
            SectionFilter sectionFilter = new SectionFilter();

            if (scFilter == null)
            {
                return(sectionFilter);                                  //Modified at 2008-11-24 15:54:17@Scott
            }
            sectionFilter.FilterName = scFilter.Name;

            foreach (ScFilterElement element in scFilter.Elements)
            {
                Webb.Data.DBCondition condition = new Webb.Data.DBCondition();

                condition.ColumnName = element.Field;

                condition.Value = element.Value;

                condition.FilterType = this.GetFilterOper(element.Oper);

                condition.FollowedOperand = this.GetFilterOpr(element.Opr);

                condition.IgnoreCase = true;

                sectionFilter.Filter.PlayAfter = scFilter.PlayAfter == 1;

                sectionFilter.Filter.Add(condition);
            }

            sectionFilter.Filter.IsCustomFilter = false;   //2010-11-1 12:11:46@Simon Add this Code

            sectionFilter.Filter.Name = scFilter.Name;     //2009-4-29 12:11:46@Simon Add this Code

            return(sectionFilter);
        }
示例#3
0
        public void Apply(SectionFilterCollection secFilterCollection)
        {
            this.Clear();

            foreach (SectionFilter filter in secFilterCollection)
            {
                SectionFilter secFilter = new SectionFilter();

                secFilter.Apply(filter);

                this.Add(secFilter);
            }
        }
        private void EditValue()
        {
            if (this.nSelectedRow >= this.conditionTable.Rows.Count ||
                this.nSelectedCol >= this.conditionTable.Columns.Count)
            {
                System.Diagnostics.Debug.WriteLine("Cell was not exsit");
                return;
            }

            object value = this.C_ComboValue.Text;

            bool bFind = false;

            Type type = this.conditionTable.Columns[this.nSelectedCol].DataType;

            if (type.BaseType == typeof(Enum))
            {
                foreach (object name in Enum.GetNames(type))
                {
                    if (name.ToString() == this.C_ComboValue.Text)
                    {
                        value = Enum.Parse(type, this.C_ComboValue.Text, true);

                        bFind = true;

                        break;
                    }
                }

                if (!bFind)
                {
                    value = this.conditionTable.Columns[this.nSelectedCol].DefaultValue;
                }
            }
            else if (this.nSelectedCol >= 0 && this.nSelectedCol < this.conditionTable.Columns.Count)
            {
                string strTableColumnName = this.conditionTable.Columns[this.nSelectedCol].ColumnName;

                if (strTableColumnName == "BracketS" || strTableColumnName == "BracketE")
                {
                    if (!this.C_ComboValue.Items.Contains(value))
                    {
                        Webb.Utilities.MessageBoxEx.ShowError("Invalid Bracket Symbol!");
                        return;
                    }
                }
            }

            this.conditionTable.Rows[this.nSelectedRow][this.nSelectedCol] = value;
        }
示例#5
0
        public static SectionFilterCollection GetCustomFilters(ScFilterList scFilterList, SectionFilterCollection scFilters)
        {
            //2009-5-1 13:33:26@Simon Add this Code

            if (scFilters == null)
            {
                return(scFilters);
            }

            if (scFilterList == null || scFilterList.ScFilters.Count == 0)
            {
                return(scFilters);
            }

            AdvFilterConvertor convert = new AdvFilterConvertor();

            SectionFilterCollection newscfFilters = new SectionFilterCollection();

            foreach (SectionFilter scFilter in scFilters)
            {
                if (scFilter == null)
                {
                    return(scFilters);
                }

                ScAFilter scAfilter = scFilterList.GetFilter(scFilter.FilterName);

                SectionFilter secFilter = new SectionFilter();

                if (scAfilter != null && scFilter.Filter.Name != string.Empty)
                {
                    if (!scFilter.Filter.IsCustomFilter)
                    {
                        secFilter = convert.GetReportFilter(scAfilter);
                    }
                    else
                    {
                        secFilter.Apply(scFilter);
                    }
                }
                else
                {
                    secFilter.Apply(scFilter);
                }

                newscfFilters.Add(secFilter);
            }

            return(newscfFilters);
        }
示例#6
0
        public bool Load(string strFileName)
        {
            try
            {
                SectionFilter filter = Webb.Utilities.Serializer.Deserialize(strFileName) as SectionFilter;

                this.Apply(filter);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);

                return(false);
            }
            return(true);
        }
示例#7
0
        public SectionFilterCollection Copy()
        {
            SectionFilterCollection secFilterCollection = new SectionFilterCollection();

            foreach (SectionFilter filter in this)
            {
                if (filter != null)
                {
                    SectionFilter secFilter = new SectionFilter();

                    secFilter.Apply(filter);

                    secFilterCollection.Add(secFilter);
                }
            }

            return(secFilterCollection);
        }
        public EditSecFilterForm(SectionFilter scFilter, WebbDBTypes webbDBTypes)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this._WebbDBTypes = webbDBTypes;

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            //Create table style
            DataGridTableStyle style = new DataGridTableStyle();

            style.MappingName = strTableName;

            this.C_DataGrid.TableStyles.Add(style);
            //
            this.Value = new SectionFilter();

            this.value.Apply(scFilter);

            this.CreateConditionTable();

            this.C_CheckPlayAfter.Checked = this.value.Filter.PlayAfter;

            this.txtFilterName.Text = this.value.FilterName;   //2009-5-19 10:15:19@Simon Add this Code

            //
            selector = new Webb.Reports.DataProvider.UI.AdvReportFilterSelector();

            selector.Visible = false;

            selector.Dock = DockStyle.Fill;

            this.Controls.Add(selector);

            selector.BringToFront();

            selector.VisibleChanged += new EventHandler(selector_VisibleChanged);
        }
示例#9
0
        public static DBFilter GetAdvFilter(ScFilterList scFilterList, DBFilter Oldfilter)
        {
            AdvFilterConvertor convert = new AdvFilterConvertor();

            if (Oldfilter == null || Oldfilter.Name == string.Empty)
            {
                return(Oldfilter);
            }

            if (scFilterList == null || scFilterList.ScFilters.Count == 0)
            {
                return(Oldfilter);
            }

            if (Oldfilter.IsCustomFilter)
            {
                return(convert.UpdateEffFilter(scFilterList, Oldfilter));
            }

            ScAFilter scAfilter = scFilterList.GetFilter(Oldfilter.Name);

            if (scAfilter == null)
            {
                return(Oldfilter);
            }


            SectionFilter scFilter = convert.GetReportFilter(scAfilter);

            if (scFilter.Filter != null)
            {
                return(scFilter.Filter.Copy());
            }



            return(Oldfilter);
        }
示例#10
0
 public void Remove(SectionFilter i_Obj)
 {
     this.InnerList.Remove(i_Obj);
 }
示例#11
0
 //Methods
 public int Add(SectionFilter i_Object)
 {
     return(this.InnerList.Add(i_Object));
 }
示例#12
0
        public void Apply(SectionFilter i_SecFilter)
        {
            this._FilterName = i_SecFilter.FilterName;

            this._DBFilter = i_SecFilter.Filter.Copy();
        }