public static DIC_MySecondDictionaryFilter CreateDefault(MainPageUrlBuilder url, DBDataContext db)
        {
            var filter = new DIC_MySecondDictionaryFilter();
            var newUrl = url ?? new MainPageUrlBuilder();

            newUrl.SelectMode = "none";
            newUrl.ViewMode   = "none";
            filter.SetUrl(newUrl);
            filter.SetDB(db);
            return(filter);
        }
        public static DIC_MySecondDictionaryFilter CreateDefault(MainPageUrlBuilder url, DBDataContext db, bool showHistory)
        {
            var filter = new DIC_MySecondDictionaryFilter();
            var newUrl = url != null?url.Clone() : new MainPageUrlBuilder();

            newUrl.ShowHistory = showHistory;
            newUrl.SelectMode  = "none";
            newUrl.ViewMode    = "none";
            filter.SetUrl(newUrl);
            filter.SetDB(db);
            filter.ShowHistory = showHistory;
            return(filter);
        }
Example #3
0
        protected IFilterControl GetFilterControl(DBDataContext db)
        {
            SetFilterText(string.Empty, FilterHidden.Text);
            InitializeSelectedValues();
            var filterControlInternal = (DIC_MySecondDictionaryFilter)FilterControlInternal ?? internalfilterControl;
            MainPageUrlBuilder pageUrlBuilder;

            if (filterControlInternal == null)
            {
                filterControlInternal = (DIC_MySecondDictionaryFilter)BaseMainPage.LoadControl(Page, GetDefaultFilterControl());
                pageUrlBuilder        = Url.Clone();
                filterControlInternal.SetUrl(pageUrlBuilder);
                internalfilterControl = filterControlInternal;
            }
            else
            {
                pageUrlBuilder = Url;
            }
            filterControlInternal.SetDB(db);
            if (!FilterByParentControlIfExistsValue || ParentControlInternal.SelectedValue != null)
            {
                filterControlInternal.FilterByParentControl = FilterByParentControl;
                filterControlInternal.ParentControl         = ParentControlInternal;
            }
            else
            {
                filterControlInternal.FilterByParentControl = null;
                filterControlInternal.ParentControl         = null;
            }
            filterControlInternal.SelectedID     = selectedID;
            filterControlInternal.ShowHistory    = Url.ShowHistory;
            filterControlInternal.SelectedValues = SelectedValues;
            if (Url.GetFilter("DIC_MySecondDictionary") == null && NavigatorControl.Values.DIC_MySecondDictionary == null)
            {
                var defFilter = filterControlInternal.GetDefaultFilter();
                FilterHidden.Text = defFilter;
                Url.SetFilter("DIC_MySecondDictionary", defFilter);
                pageUrlBuilder.SetFilter("DIC_MySecondDictionary", defFilter);
                Url.CreateUrl();
                pageUrlBuilder.CreateUrl();
                filterControlInternal.SetUrl(pageUrlBuilder);
            }
            InitializeFilterControl(filterControlInternal);
            if (filterPlaceHolder.ContentControls.Count == 0 && Url.ShowFilter)
            {
                filterPlaceHolder.Visible = true;
                filterPlaceHolder.ContentControls.Add(filterControlInternal);
            }

            return(filterControlInternal);
        }
        public static DIC_MySecondDictionaryFilter CreateDefault(MainPageUrlBuilder url, DBDataContext db, bool showHistory, List <MainPageUrlBuilder.FilterParameter> controlFilterParameters)
        {
            var filter = new DIC_MySecondDictionaryFilter();
            var newUrl = url != null?url.Clone() : new MainPageUrlBuilder();

            newUrl.ShowHistory = showHistory;
            newUrl.SelectMode  = "none";
            newUrl.ViewMode    = "none";
            foreach (var item in controlFilterParameters)
            {
                newUrl.ControlFilterParameters.Add(item.Clone());
            }
            filter.SetUrl(newUrl);
            filter.SetDB(db);
            filter.ShowHistory = showHistory;
            return(filter);
        }