Esempio n. 1
0
        protected void productOrder_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            string           stringOrderBy = productOrder.SelectedValue;      //get stringOrderBy
            int              orderBy       = TurnOrderByToInt(stringOrderBy); //turn to int
            int              shopId        = int.Parse(Shops.SelectedValue);  //get shop id
            string           condition     = BLProduct.setOrderBy(orderBy);   //get condition by order by int
            List <BLProduct> products      = null;

            if (shopId == -1)
            {
                //set data source if no shop selected
                products = BLProduct.GetAllProducts(condition);
                Products.ProductsCollections = products;
            }
            else
            {
                //set data source
                products = BLProduct.GetAllProductsByShopId(shopId, condition);
                Products.ProductsCollections = products;
            }
        }
Esempio n. 2
0
        protected void productOrder_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            string           stringOrderBy = productOrder.SelectedValue;              //get stringOrderBy
            int              orderBy       = TurnOrderByToInt(stringOrderBy);         //turn to int
            int              shopId        = ((BlShopManager)Session["user"]).ShopId; //get shop id
            string           condition     = BLProduct.setOrderBy(orderBy);           //get condition by order by int
            List <BLProduct> products      = null;

            if (shopId == -1)
            {
                //set data source if no shop selected
                products = BLProduct.GetAllProducts(condition);
                UpdateData(products);
            }
            else
            {
                //set data source
                products = BLProduct.GetAllProductsByShopId(shopId, condition);
                UpdateData(products);
            }
        }