public Variation FetchVariationData(string ID) { Variation v = new Variation(); using (SqlConnection conn = DB.GetConnection()) { v = conn.Query <Variation>("ProductVariationSelect", new { VariationID = ID }, commandType: CommandType.StoredProcedure).FirstOrDefault(); } if (v != null) { List <string> Sizes = ScalablePressUtils.GetProductSizes(v.Type, v.Color); v.Sizes = BasicUtils.GetSizeDictionary(Sizes); } return(v); }
protected void SetVariantInfo(int VariationID) { hdnVariation.Value = VariationID.ToString(); List <SqlParameter> p = new List <SqlParameter>(); p.Add(new SqlParameter("@ProductVariationID", VariationID)); DataTable dtVariants = DB.Get("ShopItemDetailed", p.ToArray()); if (dtVariants != null && dtVariants.Rows.Count > 0) { DataRow drVariant = dtVariants.Rows[0]; lName.Text = drVariant["ImageName"].ToString() + " - " + drVariant["ColorDisplayName"].ToString(); iDesign.ImageUrl = drVariant["ProofURL"].ToString(); iSizeChart.ImageUrl = drVariant["SizeChartURL"].ToString(); hlSizeChart.NavigateUrl = drVariant["SizeChartURL"].ToString(); lPrice.Text = "$" + ((decimal)drVariant["UnitPrice"]).ToString("0.00"); lDescription.Text = drVariant["ImageDescription"].ToString(); blMaterial.Items.Clear(); string materialInfo = drVariant["MaterialInfo"].ToString(); if (!string.IsNullOrWhiteSpace(materialInfo)) { string[] materialBullets = materialInfo.Split(';'); foreach (string bullet in materialBullets) { blMaterial.Items.Add(new ListItem(bullet)); } } List <string> Sizes = ScalablePressUtils.GetProductSizes(drVariant["Type"].ToString(), drVariant["Color"].ToString()); Dictionary <string, string> DicSize = BasicUtils.GetSizeDictionary(Sizes); ddlSize.DataSource = DicSize; ddlSize.DataTextField = "Key"; ddlSize.DataValueField = "Value"; ddlSize.DataBind(); } }