public static ShowcaseItemsModel Mapper(ShowcaseItemsEntity sce)
        {
            ShowcaseItemsModel scm = new ShowcaseItemsModel
            {
                Id       = sce.Id,
                Sku      = SkuMapper.Mapper(sce.Sku),
                ShowCase = ShowcaseMapper.Mapper(sce.ShowCase)
            };

            return(scm);
        }
Esempio n. 2
0
 public static SkuStocksModel Mapper(SkuStocksEntity sEntity)
 {
     if (sEntity != null)
     {
         SkuStocksModel sModel = new SkuStocksModel
         {
             Id = sEntity.Id,
             AvailableQuantity = sEntity.AvailableQuantity,
             LastUpdate        = sEntity.LastUpdate,
             Sku    = SkuMapper.Mapper(sEntity.Sku),
             Seller = UserMapper.Mapper(sEntity.Seller)
         };
         return(sModel);
     }
     return(null);
 }
Esempio n. 3
0
        public static ProductModel Mapper(ProductEntity pEntity)
        {
            ProductModel pModel = new ProductModel
            {
                Id          = pEntity.Id,
                Code        = pEntity.Code,
                Description = pEntity.Description,
                ImageUrl    = pEntity.ImageUrl,
                Name        = pEntity.Name
            };

            foreach (var item in pEntity.Skus)
            {
                pModel.Skus.Add(SkuMapper.Mapper(item));
            }
            return(pModel);
        }
        public static OrderItemsModel Mapper(OrderItemsEntity oie)
        {
            if (oie != null)
            {
                OrderItemsModel oim = new OrderItemsModel
                {
                    Id       = oie.Id,
                    Quantity = oie.Quantity,
                    Seller   = UserMapper.Mapper(oie.Seller),
                    Sku      = SkuMapper.Mapper(oie.Sku),
                    Order    = OrderMapper.Mapper(oie.Order)
                };

                return(oim);
            }
            return(null);
        }
        public static List <ShowcaseItemsModel> Mapper(List <ShowcaseItemsEntity> sceList)
        {
            List <ShowcaseItemsModel> scmList = new List <ShowcaseItemsModel>();

            foreach (var sce in sceList)
            {
                ShowcaseItemsModel scm = new ShowcaseItemsModel
                {
                    Id       = sce.Id,
                    Sku      = SkuMapper.Mapper(sce.Sku),
                    ShowCase = ShowcaseMapper.Mapper(sce.ShowCase)
                };

                scmList.Add(scm);
            }

            return(scmList);
        }
Esempio n. 6
0
        public static List <ProductModel> Mapper(List <ProductEntity> peList)
        {
            List <ProductModel> pmList = new List <ProductModel>();

            foreach (var pe in peList)
            {
                ProductModel pModel = new ProductModel
                {
                    Id          = pe.Id,
                    Code        = pe.Code,
                    Description = pe.Description,
                    ImageUrl    = pe.ImageUrl,
                    Name        = pe.Name,
                    Skus        = SkuMapper.Mapper(pe.Skus)
                };

                pmList.Add(pModel);
            }

            return(pmList);
        }
Esempio n. 7
0
        public static List <ProductEntity> Mapper(List <ProductModel> pmList)
        {
            List <ProductEntity> peList = new List <ProductEntity>();

            foreach (var pm in pmList)
            {
                ProductEntity pEntity = new ProductEntity
                {
                    Id          = pm.Id,
                    Code        = pm.Code,
                    Description = pm.Description,
                    ImageUrl    = pm.ImageUrl,
                    Name        = pm.Name,
                    Skus        = SkuMapper.Mapper(pm.Skus)
                };

                peList.Add(pEntity);
            }

            return(peList);
        }
Esempio n. 8
0
        public static List <SkuStocksModel> Mapper(List <SkuStocksEntity> seList)
        {
            if (seList != null)
            {
                List <SkuStocksModel> smList = new List <SkuStocksModel>();
                foreach (var se in seList)
                {
                    SkuStocksModel sModel = new SkuStocksModel
                    {
                        Id = se.Id,
                        AvailableQuantity = se.AvailableQuantity,
                        LastUpdate        = se.LastUpdate,
                        Sku    = SkuMapper.Mapper(se.Sku),
                        Seller = UserMapper.Mapper(se.Seller)
                    };

                    smList.Add(sModel);
                }
                return(smList);
            }
            return(null);
        }
        public static List <OrderItemsModel> Mapper(List <OrderItemsEntity> oieList)
        {
            if (oieList != null)
            {
                List <OrderItemsModel> oimList = new List <OrderItemsModel>();
                foreach (var oie in oieList)
                {
                    OrderItemsModel oim = new OrderItemsModel
                    {
                        Id       = oie.Id,
                        Quantity = oie.Quantity,
                        Seller   = UserMapper.Mapper(oie.Seller),
                        Sku      = SkuMapper.Mapper(oie.Sku),
                        Order    = OrderMapper.Mapper(oie.Order)
                    };

                    oimList.Add(oim);
                }
                ;

                return(oimList);
            }
            return(null);
        }