public bool GetAllSizesFromUS(Sneaker sneaker, string sizeUS) { try { if (String.IsNullOrEmpty(sneaker.category)) { throw new Exception("Не указана категория размерной сетки. Артикул: " + sneaker.sku); } var converter = new SizeConverter(sizeUS, sneaker.category); this.sizeUS = sizeUS; this.sizeEU = converter.sizeEUR; this.sizeUK = converter.sizeUK; this.sizeRU = converter.sizeRUS; this.sizeCM = converter.sizeCM; this.allSize = converter.allSize; return(true); } catch (Exception e) { string message = "Размер и категория не совпадают. sku:" + sneaker.sku + " size:" + sizeUS + " категория: " + sneaker.category; Program.Logger.Warn(message); return(false); //Console.WriteLine(message); } }
public SneakerSize(Sneaker sneaker, string sizeUS) { sizeUS = sizeUS.Replace(',', '.'); stock = new List <SneakerSizeStock>(); this.sku = sneaker.sku + "-" + sizeUS; this.sizeUS = sizeUS; //GetAllSizesFromUS(stockSneaker, sizeUS); }
public Sneaker ReadSneakerFromCatalogRecord() { Sneaker sneaker = new Sneaker(); sneaker.style = this.style; sneaker.colorcode = this.colorcode; sneaker.sku = this.sku; sneaker.title = this.title; sneaker.color = this.color; sneaker.brand = this.brand; sneaker.collection = this.collection; sneaker.type = this.type; sneaker.height = this.height; sneaker.destination = this.destination; sneaker.description = this.description; sneaker.category = this.category; sneaker.sex = this.sex; sneaker.images = this.images.Split('|').ToList(); sneaker.link = this.link; sneaker.price = Double.Parse(this.price); sneaker.oldPrice = Double.Parse(this.oldPrice); return(sneaker); }
public CatalogRecord(Sneaker sneaker) { this.style = sneaker.style; this.colorcode = sneaker.colorcode; this.sku = sneaker.sku; this.title = sneaker.title; this.color = sneaker.color; this.brand = sneaker.brand; this.collection = sneaker.collection; this.type = sneaker.type; this.height = sneaker.height; this.destination = sneaker.destination; if (sneaker.description != null) { this.description = sneaker.description.Replace("\n", ""); } this.category = sneaker.category; this.sex = sneaker.sex; this.images = String.Join("|", sneaker.images); this.link = sneaker.link; this.price = sneaker.price.ToString(); this.oldPrice = sneaker.oldPrice.ToString(); }