public static AbbigliamentoECommerce.Models.Product ConvertoProdyctEntityTOProductModel(AbbigliamentoECommerceEntity.Product pProduct) { AbbigliamentoECommerce.Models.Product wProduct = new AbbigliamentoECommerce.Models.Product(); wProduct.Id = pProduct.UId; wProduct.Category = pProduct.categoria; wProduct.Color = pProduct.colore; wProduct.Brand = pProduct.marca; wProduct.ProductName = pProduct.nome; wProduct.Price = pProduct.prezzo; wProduct.Headmoney = pProduct.taglia; wProduct.Image = pProduct.UrlDownloadWeb; return(wProduct); }
public static AbbigliamentoECommerce.Models.Product ConvertoProdyctModelTOProductEntity(AbbigliamentoECommerceEntity.Product pProduct) { AbbigliamentoECommerce.Models.Product wProduct = new AbbigliamentoECommerce.Models.Product(); wProduct.Id = pProduct.UId; wProduct.Category = pProduct.categoria; wProduct.Color = pProduct.colore; wProduct.Brand = pProduct.marca; wProduct.ProductName = pProduct.nome; wProduct.Price = pProduct.prezzo; wProduct.Quantity = pProduct.Quantity; wProduct.Headmoney = pProduct.taglia; wProduct.Image = pProduct.UrlDownloadWeb; wProduct.ListQuantity = new Dictionary <int, int>(); for (int i = 0; i < wProduct.Quantity; i++) { wProduct.ListQuantity.Add(i, i + 1); } return(wProduct); }
public static List <AbbigliamentoECommerce.Models.Product> ConvertoListProdyctEntityTOListProductModel(List <AbbigliamentoECommerceEntity.Product> pListpProduct) { List <AbbigliamentoECommerce.Models.Product> wListProduct = new List <AbbigliamentoECommerce.Models.Product>(); foreach (AbbigliamentoECommerceEntity.Product pProduct in pListpProduct) { AbbigliamentoECommerce.Models.Product wProduct = new AbbigliamentoECommerce.Models.Product(); wProduct.Id = pProduct.UId; wProduct.Category = pProduct.categoria; wProduct.Color = pProduct.colore; wProduct.Brand = pProduct.marca; wProduct.ProductName = pProduct.nome; wProduct.Price = pProduct.prezzo; wProduct.Model = pProduct.modello; wProduct.Quantity = pProduct.Quantity; wProduct.Headmoney = pProduct.taglia; wProduct.Image = pProduct.UrlDownloadWeb; wListProduct.Add(wProduct); } return(wListProduct); }