private void AddToDict(Product product, BegemotProduct bproduct, Style specialStyle, Sale activeSale) { valueDict.Add(StyleTag.Title, bproduct.GetClearTitle()); valueDict.Add(StyleTag.TitleShort, bproduct.GetTitleShort()); valueDict.Add(StyleTag.TitleClear, bproduct.GetClearTitle()); valueDict.Add(StyleTag.TitleClearShort, bproduct.GetClearShortTitle()); valueDict.Add(StyleTag.Description, bproduct.GetClearDescrption()); valueDict.Add(StyleTag.Price, product.Price.ToString("f2")); valueDict.Add(StyleTag.PriceOld, product.PriceOld.ToString("f2")); var codeProduct = product.GetCode(); valueDict.Add(StyleTag.CodeProduct, codeProduct); if (specialStyle != null) { var codeStyle = specialStyle.GetCode(true); //codeStyle = HttpUtility.UrlEncode(codeStyle); valueDict.Add(StyleTag.CodeStyle, codeStyle); } if (activeSale != null) { var codeSale = activeSale.GetCode(true); // codeSale = HttpUtility.UrlEncode(codeSale); valueDict.Add(StyleTag.CodeSale, codeSale); } var salesLinks = SalesLinks(); valueDict.Add(StyleTag.Sales, salesLinks); var menuLinks = MenuLinks(); valueDict.Add(StyleTag.Menu, menuLinks); }
public static Product FromBegemotProduct(BegemotProduct begemotProduct) { var product = new Product(); product.Article = begemotProduct.Article; product.Title = begemotProduct.GetClearTitle(); product.Description = begemotProduct.GetDescription(); product.Price = begemotProduct.RetailPrice; begemotProduct.GetImagePath(); product.Category = ProductCategory.FromBegemotProduct(begemotProduct); product.Active = true; return product; }