public List<Bicycles> getAllBike() { BicycleBL bicyclBL = new BicycleBL(); List<Bicycles> list = new List<Bicycles>(); list = bicyclBL.getAllBike(); return list; }
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 createProdTable() { //newClientDiv.Style.Add("display", "none"); //allClientDiv.Style.Add("display", "none"); Table table1 = new Table(); table1 = allProductTable; List<Bicycles> BicyclesList = new List<Bicycles>(); BicycleBL bike = new BicycleBL(); CategoryBL category = new CategoryBL(); SubCategoryBL subCategory = new SubCategoryBL(); ProducerBL producer = new ProducerBL(); ColorBL color = new ColorBL(); SizeBL size = new SizeBL(); BicyclesList = bike.getAllBike(); for (int i = 0; i < BicyclesList.Count; i++) { TableRow dr = new TableRow(); TableCell cell = new TableCell(); //שם יצרן cell.Text = producer.GetProducer(BicyclesList[i]._Name).ToString(); dr.Cells.Add(cell); //cell = new TableCell(); //cell.Text = "דגם"; //dr.Cells.Add(cell); //קטגוריה ראשית cell = new TableCell(); cell.Text = category.getCategoryById(BicyclesList[i]._MainCategoryId).ToString(); dr.Cells.Add(cell); //קטגוריה משנית cell = new TableCell(); cell.Text = subCategory.GetSubCategory(BicyclesList[i]._SubCategoryId).ToString(); dr.Cells.Add(cell); //מידה cell = new TableCell(); cell.Text = size.getSize(BicyclesList[i]._size).ToString(); dr.Cells.Add(cell); //צבע cell = new TableCell(); cell.Text = color.getColorById(BicyclesList[i]._colorId).ToString(); dr.Cells.Add(cell); //כמות cell = new TableCell(); cell.Text = BicyclesList[i]._Quantity.ToString(); dr.Cells.Add(cell); //מחיר cell = new TableCell(); cell.Text = BicyclesList[i]._RegularPrice.ToString(); dr.Cells.Add(cell); table1.Rows.Add(dr); } }
protected void addToList_Click(object sender, EventArgs e) { int Id = Convert.ToInt32(bikeId.Value); int quantity=0; try { quantity = Convert.ToInt32(selectQuantity.Value); } catch (Exception ex) { return; } Bicycles bike = new etgarPlus.Classes.Bicycles(); bicycleBL = new etgarPlus.Logic.BicycleBL(); bike = bicycleBL.getBicycleById(Id); listBikeToOrder.Add(bike); listCountToOrder.Add(quantity); addTOBasket.Style.Add("display", "block"); fade2.Style.Add("display", "block"); }