コード例 #1
0
        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);
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #9
0
        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);
        }