/// <summary> /// Populates the sizes. /// </summary> /// <param name="productID">The product ID.</param> /// <param name="color">The color.</param> /// <param name="gridView">The grid view.</param> /// <param name="repeaterItemIndex">Index of the repeater item.</param> private void populateSizes(int productID, string color) { DAL.DBML.MoscotDataClassesDataContext ctx = new DAL.DBML.MoscotDataClassesDataContext(); var productSizes = from pacd in ctx.mss_ProductAttributeCombinationDetails join pa in ctx.mss_ProductAttributes on pacd.AttributeId equals pa.AttributeId join pac in ctx.mss_ProductAttributeCombinations on pacd.CombinationId equals pac.CombinationId join pacd2 in ctx.mss_ProductAttributeCombinationDetails on pac.CombinationId equals pacd2.CombinationId join pa2 in ctx.mss_ProductAttributes on pacd2.AttributeId equals pa2.AttributeId join pac2 in ctx.mss_ProductAttributeCombinations on pacd2.CombinationId equals pac2.CombinationId where pa.ClassId == 2 && pa.ProductId == productID && pa2.ClassId == 1 && pa2.AttributeValue == color select new { CombinationID = pac.CombinationId, Size = pa.AttributeValue }; SizeDropDownList.Items.Clear(); SizeDropDownList.Items.Add(new ListItem() { Text = "Size", Value = "0" }); SizeDropDownList.DataSource = productSizes; SizeDropDownList.DataTextField = "Size"; SizeDropDownList.DataValueField = "CombinationID"; SizeDropDownList.DataBind(); }
public void GetSizeByCategories() { int Id = Convert.ToInt32(CategoriesDropDownList.SelectedValue); SizeDropDownList.DataSource = _ItemRepository.GetSizeByCategories(Id); SizeDropDownList.DataTextField = "Size"; SizeDropDownList.DataValueField = "Id"; SizeDropDownList.DataBind(); SizeDropDownList.Items.Insert(0, new ListItem("Chose Size", "0")); }
protected void CategoriesDropDownList_SelectedIndexChanged(object sender, EventArgs e) { try { int Id = Convert.ToInt32(CategoriesDropDownList.SelectedValue); SizeDropDownList.DataSource = _StocksInRepository.GetSizeByCategories(Id); SizeDropDownList.DataTextField = "Size"; SizeDropDownList.DataValueField = "Id"; SizeDropDownList.DataBind(); SizeDropDownList.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select Size", "0")); txtCode.Text = ""; } catch { } }