Exemple #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            bicycleBL = new BicycleBL();
            categoryBL = new CategoryBL();
            subCategoryBL = new SubCategoryBL();
            producerBL = new ProducerBL();
            sizeBL = new SizeBL();
            colorBL = new ColorBL();
            if (Session["listBike"] != null)
            {

                listBike = (List<Bicycles>)Session["listBike"];
                // ColorSelector.SelectedValue = Session["listBike"].ToString();
            }
            else
            {
                listBike = bicycleBL.getAllBike();
            }
            List<Producer> listProducer = producerBL.getAllProducer();
            List<Category> listCategory = categoryBL.getAllCategory();
            List<SubCategory> listSubCategory = subCategoryBL.getAllSubCategory();
            List<Size> listSize = sizeBL.getAllSizes();
            List<Color> listColor = colorBL.getAllColor();
            if (!Page.IsPostBack)
            {

                selected_producer.Items.Clear();
                selected_producer.Items.Add(new ListItem("שם היצרן", "-1"));
                foreach (Producer p in listProducer)
                {
                    selected_producer.Items.Add(new ListItem(p._producer, p._id.ToString()));
                }
                selected_Category_Main.Items.Clear();
                selected_Category_Main.Items.Add(new ListItem("בחר קטגוריה", "-1"));
                foreach (Category c in listCategory)
                {
                    selected_Category_Main.Items.Add(new ListItem(c._category, c._id.ToString()));
                }
                selected_SubCategory_main.Items.Clear();
                selected_SubCategory_main.Items.Add(new ListItem("בחר תת קטגוריה", "-1"));
                foreach (SubCategory s in listSubCategory)
                {
                    selected_SubCategory_main.Items.Add(new ListItem(s._subCategory, s._id.ToString()));
                }
                selected_Size.Items.Clear();
                selected_Size.Items.Add(new ListItem("בחר גודל", "-1"));
                foreach (Size si in listSize)
                {
                    selected_Size.Items.Add(new ListItem(si._size, si._id.ToString()));
                }
                selected_Color.Items.Clear();
                selected_Color.Items.Add(new ListItem("בחר צבע", "-1"));
                foreach (Color c in listColor)
                {
                    selected_Color.Items.Add(new ListItem(c._color, c._id.ToString()));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Manager"] == null)
            {
                Response.Redirect("../Pages/Main");
            }

            List<etgarPlus.Classes.Bicycles> bikeListCheck;
            etgarPlus.Logic.ProducerBL producerBL = new etgarPlus.Logic.ProducerBL();
            List<etgarPlus.Classes.Producer> lisProducer = producerBL.getAllProducer();

            etgarPlus.Logic.CategoryBL categoryBL = new etgarPlus.Logic.CategoryBL();
            List<etgarPlus.Classes.Category> listCategory = categoryBL.getAllCategory();

            etgarPlus.Logic.SubCategoryBL subCategoryBL = new etgarPlus.Logic.SubCategoryBL();
            List<etgarPlus.Classes.SubCategory> listSubCategory = subCategoryBL.getAllSubCategory();

            etgarPlus.Logic.SizeBL sizeBL = new etgarPlus.Logic.SizeBL();
            List<etgarPlus.Classes.Size> lisSize = sizeBL.getAllSizes();

            etgarPlus.Logic.ColorBL bicycleBL = new etgarPlus.Logic.ColorBL();
            List<etgarPlus.Classes.Color> lisColor = bicycleBL.getAllColor();

            foreach (etgarPlus.Classes.Producer p in lisProducer)
            {
                selected_producer.Items.Add(new ListItem(p._producer, p._id.ToString()));
            }
            selected_producer.Items.Add(new ListItem("אחר", "-2"));
            foreach (etgarPlus.Classes.Category c in listCategory)
            {
                selected_Category.Items.Add(new ListItem(c._category, c._id.ToString()));
            }
            selected_Category.Items.Add(new ListItem("אחר", "-2"));
            foreach (etgarPlus.Classes.SubCategory s in listSubCategory)
            {
                selected_SubCategory.Items.Add(new ListItem(s._subCategory, s._id.ToString()));
            }
            selected_SubCategory.Items.Add(new ListItem("אחר", "-2"));

            foreach (etgarPlus.Classes.Size si in lisSize)

            {
                selected_Size.Items.Add(new ListItem(si._size, si._id.ToString()));

            }
            selected_Size.Items.Add(new ListItem("אחר", "-2"));

            foreach (etgarPlus.Classes.Color c in lisColor)
            {
                selected_Color.Items.Add(new ListItem(c._color, c._id.ToString()));

            }
            selected_Color.Items.Add(new ListItem("אחר", "-2"));

            createTable(1);
            createTable(2);
            createProdTable();
        }