Exemple #1
0
        protected void RepeaterGoodsCategories_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int selectedIndex = e.Item.ItemIndex;

            if (ViewState["categoriesGoodsList"] != null)
            {
                List <Categories> categoriesGoodsList =
                    (List <Categories>)ViewState["categoriesGoodsList"];
                int categoryID = categoriesGoodsList[selectedIndex].ID;
                RelationsCategoriesGoodsActions R_C_G_Actions = new RelationsCategoriesGoodsActions();
                R_C_G_Actions.DeleteCategoriesFromGoods(categoryID, SelectedGoodsID);
                categoriesGoodsList.RemoveAt(selectedIndex);
                RepeaterGoodsCategories.DataSource = categoriesGoodsList;
                RepeaterGoodsCategories.DataBind();
                ViewState["categoriesGoodsList"] = categoriesGoodsList;
            }
        }