Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string s      = (Session["BulkAction_DefaultCategoryId"] == null) ? "0" : Session["BulkAction_DefaultCategoryId"].ToString();
                bool   delete = (Session["BulkAction_DeleteCategory"] == null) ? false : Convert.ToBoolean(Session["BulkAction_DeleteCategory"]);

                Session.Remove("BulkAction_DefaultCategoryId");
                Session.Remove("BulkAction_DeleteCategory");

                int defaultCategoryId = NumericUtils.ParseInt32(s, 0);

                if (defaultCategoryId > 0)
                {
                    Category category = CategoryCache.Instance.GetById(defaultCategoryId);

                    BrandDropDownList1.SafeSelectValue(category.BrandId);
                    SourceCategoryDropDownList.RefreshFromBrandAndSelect(BrandDropDownList1.SelectedId, defaultCategoryId);
                    TargetCategoryDropDownList.RefreshFromBrand(BrandDropDownList1.SelectedId);

                    if (delete)
                    {
                        DeleteSourceCategoryCheckBox.Checked = true;
                        CancelButton.RedirectUrl             = ResolveUrl("~/Admin/Content/ManageCategories.aspx?BrandId=" + category.BrandId);
                    }
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int brandId = WebUtils.GetIntRequestParam("BrandId", 0);
                BrandDropDownList1.SafeSelectValue(brandId);

                BindGrid();
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteUtils.TieButton(KeywordsTextBox, SearchButton1);

            if (SavedUserAssetSearch == null || SavedUserAssetSearch.AssetFinder == null)
            {
                SavedUserAssetSearch = new SavedUserAssetSearch();
            }

            AssetFinder finder = SavedUserAssetSearch.AssetFinder;

            if (!Page.IsPostBack)
            {
                string path = VirtualPathUtility.ToAppRelative(Request.Url.AbsolutePath).ToLower();

                if (path.StartsWith("~/searchresults.aspx"))
                {
                    // If browse option is selected
                    if (Request.QueryString["showCategories"] != null)
                    {
                        SavedUserAssetSearch.CategoriesOpen = true;
                        SavedUserAssetSearch.FilterOpen     = false;
                    }

                    // Setup UI
                    KeywordsTextBox.Text = finder.GeneralKeyword;
                    BrandDropDownList1.SafeSelectValue(finder.BrandId);
                    AssetTypeDropDownList1.SafeSelectValue(finder.AssetTypeId);

                    // Only open the filter and populate the dropdowns if the filter is open
                    if (SavedUserAssetSearch.CategoriesOpen || SavedUserAssetSearch.FilterOpen || WebUtils.GetIntRequestParam("openfilter", 0) == 1)
                    {
                        ToggleSearchVisibility(SavedUserAssetSearch.FilterOpen, SavedUserAssetSearch.CategoriesOpen);
                    }
                }

                CategoryId = SavedUserAssetSearch.CurrentCategoryId;
            }

            SetupCategories();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            // Reload the category cache
            CacheManager.InvalidateCache("Category", CacheType.Local);

            // First ensure brand has a root category
            CategoryManager.CheckRootCategory(BrandId);

            // Get list of categories in selected brand
            IList <Category> categories = GetParentCategories(BrandId);

            // Create root category if none exists
            if (categories.Count == 0)
            {
                CategoryManager.CreateCategory(-1, BrandId, "Assets", string.Empty, string.Empty, string.Empty, CurrentUser);
            }

            if (!Page.IsPostBack)
            {
                int brandId = WebUtils.GetIntRequestParam("BrandId", 0);
                BrandDropDownList1.SafeSelectValue(brandId);
            }
        }