Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ChangeShop.Visible  = false;
                Products.Visible    = false;
                searchPanel.Visible = false;
                //set data source

                productOrder.DataSource = OrderByArr;
                //// Bind the data to the control.
                productOrder.DataBind();

                // Set the default selected item, if desired.
                productOrder.SelectedIndex = 0;

                //set data source
                List <BlShop> shops = BLFlyPack.BlShop.GetShops();
                shops.Add(new BlShop("-1", "all products"));
                Shops.DataSource     = shops;
                Shops.DataTextField  = "ShopName";
                Shops.DataValueField = "ID";

                // Bind the data to the control.
                Shops.DataBind();
                foreach (System.Web.UI.WebControls.ListItem Item in Shops.Items)
                {
                    Item.Attributes["OnClientClick"] = "ShopDropDownListB_OnClick";
                }
                // Set the default selected item, if desired.
                Shops.SelectedIndex = shops.Count - 1;
                Session["products"] = null;
                //Products.ProductsCollections = products;
                List <BLProduct> productsCart = (List <BLProduct>)Session["productsCart"];
                if (productsCart == null || productsCart.Count == 0)
                {
                    MSG.Text = "";
                    return;
                }
            }
        }