Exemple #1
0
        protected void MoveButton_Click(object sender, EventArgs e)
        {
            int currentCategoryId  = this.CategoryPath.CurrentCategoryId;
            int selectedCategoryId = this.CategoryDropDown.SelectedCategoryId;

            if (this.MoveAction.SelectedValue.Equals("Category"))
            {
                ProductCategory productCategory = new ProductCategory
                {
                    CategoryID       = currentCategoryId,
                    ParentCategoryID = selectedCategoryId
                };
                ProductCategories.MoveProductCategory(productCategory);
                CategoryCache.ClearCategoryCache();
                this.CategoryDropDown.Refresh();
                this.SetCurrentCategory(this.CategoryPath.CurrentParentCategoryId);
            }
            else if (this.MoveAction.SelectedValue.Equals("Ads"))
            {
                Products.MoveProductsToCategory(currentCategoryId, selectedCategoryId);
                this.CategoryDropDown.SelectedIndex = 0;
            }
        }