コード例 #1
0
ファイル: CategoryMapper.cs プロジェクト: NikitaKums/TalTech
        public static DAL.App.DTO.DomainLikeDTO.Category MapFromBLL(BLL.App.DTO.DomainLikeDTO.Category category)
        {
            var res = category == null ? null : new DAL.App.DTO.DomainLikeDTO.Category
            {
                Id           = category.Id,
                CategoryName = category.CategoryName,
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromBLL(category.Shop)
            };

            return(res);
        }
コード例 #2
0
ファイル: ReturnMapper.cs プロジェクト: NikitaKums/TalTech
        public static internalDTO.Return MapFromBLL(externalDTO.Return returnWithProductCount)
        {
            var res = returnWithProductCount == null ? null : new internalDTO.Return
            {
                Id          = returnWithProductCount.Id,
                Description = returnWithProductCount.Description,
                ShopId      = returnWithProductCount.ShopId,
                Shop        = ShopMapper.MapFromBLL(returnWithProductCount.Shop)
            };

            return(res);
        }
コード例 #3
0
ファイル: DefectMapper.cs プロジェクト: NikitaKums/TalTech
        public static internalDTO.Defect MapFromBLL(externalDTO.Defect defectWithProductCount)
        {
            var res = defectWithProductCount == null ? null : new internalDTO.Defect
            {
                Id          = defectWithProductCount.Id,
                Description = defectWithProductCount.Description,
                ShopId      = defectWithProductCount.ShopId,
                Shop        = ShopMapper.MapFromBLL(defectWithProductCount.Shop)
            };

            return(res);
        }
コード例 #4
0
        public static internalDTO.Inventory MapFromBLL(externalDTO.Inventory inventoryWithProductCount)
        {
            var res = inventoryWithProductCount == null ? null : new internalDTO.Inventory
            {
                Id                    = inventoryWithProductCount.Id,
                Description           = inventoryWithProductCount.Description,
                InventoryCreationTime = inventoryWithProductCount.InventoryCreationTime,
                ShopId                = inventoryWithProductCount.ShopId,
                Shop                  = ShopMapper.MapFromBLL(inventoryWithProductCount.Shop)
            };

            return(res);
        }
コード例 #5
0
        public static externalDTO.Inventory MapFromDAL(internalDTO.Inventory inventory)
        {
            var res = inventory == null ? null : new externalDTO.Inventory
            {
                Id                    = inventory.Id,
                Description           = inventory.Description,
                InventoryCreationTime = inventory.InventoryCreationTime,
                ShopId                = inventory.ShopId,
                Shop                  = ShopMapper.MapFromDAL(inventory.Shop)
            };

            return(res);
        }
コード例 #6
0
        public static internalDTO.Order MapFromBLL(externalDTO.Order order)
        {
            var res = order == null ? null : new internalDTO.Order
            {
                Id                = order.Id,
                Description       = order.Description,
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromBLL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromBLL(order.Shop),
            };

            return(res);
        }
コード例 #7
0
        public static DAL.App.DTO.DomainLikeDTO.Identity.AppUser MapFromBLL(BLL.App.DTO.DomainLikeDTO.Identity.AppUser appUser)
        {
            var res = appUser == null ? null : new DAL.App.DTO.DomainLikeDTO.Identity.AppUser
            {
                Id        = appUser.Id,
                FirstName = appUser.FirstName,
                LastName  = appUser.LastName,
                Aadress   = appUser.Aadress,
                Email     = appUser.Email,
                ShopId    = appUser.ShopId,
                Shop      = ShopMapper.MapFromBLL(appUser.Shop)
            };

            return(res);
        }
コード例 #8
0
ファイル: CommentMapper.cs プロジェクト: NikitaKums/TalTech
        public static internalDTO.DomainLikeDTO.Comment MapFromBLL(externalDTO.DomainLikeDTO.Comment comment)
        {
            var res = comment == null ? null : new internalDTO.DomainLikeDTO.Comment
            {
                Id           = comment.Id,
                CommentTitle = comment.CommentTitle,
                CommentBody  = comment.CommentBody,
                ProductId    = comment.ProductId,
                Product      = ProductMapper.MapFromBLL(comment.Product),
                ShopId       = comment.ShopId,
                Shop         = ShopMapper.MapFromBLL(comment.Shop)
            };

            return(res);
        }
コード例 #9
0
ファイル: CategoryMapper.cs プロジェクト: NikitaKums/TalTech
        public static BLL.App.DTO.DomainLikeDTO.Category MapFromDAL(DAL.App.DTO.DomainLikeDTO.Category category)
        {
            var res = category == null ? null : new BLL.App.DTO.DomainLikeDTO.Category
            {
                Id           = category.Id,
                CategoryName = category.CategoryName,
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromDAL(category.Shop)
            };

            if (category?.ProductsInCategory != null)
            {
                res.ProductsInCategory = category.ProductsInCategory.Select(e => ProductInCategoryMapper.MapFromDAL(e)).ToList();
            }
            return(res);
        }
コード例 #10
0
ファイル: ReturnMapper.cs プロジェクト: NikitaKums/TalTech
        public static externalDTO.Return MapFromDAL(internalDTO.Return @return)
        {
            var res = @return == null ? null : new externalDTO.Return
            {
                Id          = @return.Id,
                Description = @return.Description,
                ShopId      = @return.ShopId,
                Shop        = ShopMapper.MapFromDAL(@return.Shop)
            };

            if (@return?.ProductsReturned != null)
            {
                res.ProductsReturned = @return.ProductsReturned.Select(e => ProductReturnedMapper.MapFromDAL(e)).ToList();
            }

            return(res);
        }
コード例 #11
0
ファイル: DefectMapper.cs プロジェクト: NikitaKums/TalTech
        public static externalDTO.Defect MapFromDAL(internalDTO.Defect defect)
        {
            var res = defect == null ? null : new externalDTO.Defect
            {
                Id          = defect.Id,
                Description = defect.Description,
                ShopId      = defect.ShopId,
                Shop        = ShopMapper.MapFromDAL(defect.Shop)
            };

            if (defect?.ProductsWithDefect != null)
            {
                res.ProductsWithDefect = defect.ProductsWithDefect.Select(e => ProductWithDefectMapper.MapFromDAL(e)).ToList();
            }

            return(res);
        }
コード例 #12
0
        public static externalDTO.Order MapFromDAL(internalDTO.Order order)
        {
            var res = order == null ? null : new externalDTO.Order
            {
                Id                = order.Id,
                Description       = order.Description,
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromDAL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromDAL(order.Shop),
            };

            if (order?.ProductsInOrder != null)
            {
                res.ProductsInOrder = order.ProductsInOrder.Select(e => ProductInOrderMapper.MapFromDAL(e)).ToList();
            }

            return(res);
        }
コード例 #13
0
ファイル: ProductMapper.cs プロジェクト: NikitaKums/TalTech
        public static externalDTO.Product MapFromDAL(internalDTO.Product product)
        {
            var res = product == null ? null : new externalDTO.Product
            {
                Id = product.Id,
                ManuFacturerItemCode      = product.ManuFacturerItemCode,
                ShopCode                  = product.ShopCode,
                ProductName               = product.ProductName,
                BuyPrice                  = product.BuyPrice,
                PercentageAddedToBuyPrice = product.PercentageAddedToBuyPrice,
                SellPrice                 = product.SellPrice,
                Quantity                  = product.Quantity,
                Weight = product.Weight,
                Length = product.Length,
            };

            if (product?.Manufacturer != null)
            {
                res.ManuFacturerId = product.ManuFacturerId;
                res.Manufacturer   = ManuFacturerMapper.MapFromDAL(product.Manufacturer);
                res.InventoryId    = product.InventoryId;
                res.Inventory      = InventoryMapper.MapFromDAL(product.Inventory);
                res.ShopId         = product.ShopId;
                res.Shop           = ShopMapper.MapFromDAL(product.Shop);
            }

            if (product?.Comments != null)
            {
                res.Comments = product.Comments.Select(e => new BLL.App.DTO.DomainLikeDTO.Comment()
                {
                    CommentTitle = e.CommentTitle,
                    CommentBody  = e.CommentBody,
                    Id           = e.Id
                }).ToList();
            }

            return(res);
        }
コード例 #14
0
ファイル: ProductMapper.cs プロジェクト: NikitaKums/TalTech
        public static internalDTO.Product MapFromBLL(externalDTO.Product product)
        {
            var res = product == null ? null : new internalDTO.Product
            {
                Id = product.Id,
                ManuFacturerItemCode      = product.ManuFacturerItemCode,
                ShopCode                  = product.ShopCode,
                ProductName               = product.ProductName,
                BuyPrice                  = product.BuyPrice,
                PercentageAddedToBuyPrice = product.PercentageAddedToBuyPrice,
                SellPrice                 = product.SellPrice,
                Quantity                  = product.Quantity,
                Weight         = product.Weight,
                Length         = product.Length,
                ManuFacturerId = product.ManuFacturerId,
                Manufacturer   = ManuFacturerMapper.MapFromBLL(product.Manufacturer),
                InventoryId    = product.InventoryId,
                Inventory      = InventoryMapper.MapFromBLL(product.Inventory),
                ShopId         = product.ShopId,
                Shop           = ShopMapper.MapFromBLL(product.Shop)
            };

            return(res);
        }