Beispiel #1
0
        public static internalDTO.ProductDosage MapFromBLL(externalDTO.ProductDosage productDosage)
        {
            var res = productDosage == null ? null : new internalDTO.ProductDosage()
            {
                Id        = productDosage.Id,
                DosageId  = productDosage.DosageId,
                Dosage    = DosageMapper.MapFromBLL(productDosage.Dosage),
                ProductId = productDosage.ProductId,
                Product   = ProductMapper.MapFromBLL(productDosage.Product)
            };

            return(res);
        }
Beispiel #2
0
        public static internalDTO.ProductCompany MapFromBLL(externalDTO.ProductCompany productCompany)
        {
            var res = productCompany == null ? null : new internalDTO.ProductCompany
            {
                Id        = productCompany.Id,
                ProductId = productCompany.ProductId,
                Product   = ProductMapper.MapFromBLL(productCompany.Product),
                CompanyId = productCompany.CompanyId,
                Company   = CompanyMapper.MapFromBLL(productCompany.Company)
            };

            return(res);
        }
        public static internalDTO.ProductDescription MapFromBLL(externalDTO.ProductDescription productDescription)
        {
            var res = productDescription == null ? null : new internalDTO.ProductDescription()
            {
                Id            = productDescription.Id,
                DescriptionId = productDescription.DescriptionId,
                Description   = DescriptionMapper.MapFromBLL(productDescription.Description),
                ProductId     = productDescription.ProductId,
                Product       = ProductMapper.MapFromBLL(productDescription.Product)
            };

            return(res);
        }
Beispiel #4
0
        public static internalDTO.ProductInCategory MapFromBLL(externalDTO.ProductInCategory productInCategory)
        {
            var res = productInCategory == null ? null : new internalDTO.ProductInCategory
            {
                Id         = productInCategory.Id,
                ProductId  = productInCategory.ProductId,
                Product    = ProductMapper.MapFromBLL(productInCategory.Product),
                CategoryId = productInCategory.CategoryId,
                Category   = CategoryMapper.MapFromBLL(productInCategory.Category)
            };

            return(res);
        }
        public static internalDTO.ProductInOrder MapFromBLL(externalDTO.ProductInOrder productInOrder)
        {
            var res = productInOrder == null ? null : new internalDTO.ProductInOrder
            {
                Id        = productInOrder.Id,
                ProductId = productInOrder.ProductId,
                OrderId   = productInOrder.OrderId,
                Product   = ProductMapper.MapFromBLL(productInOrder.Product),
                ProductInOrderPlacingTime = productInOrder.ProductInOrderPlacingTime,
                Quantity = productInOrder.Quantity
            };

            return(res);
        }
        public static internalDTO.ProductReturned MapFromBLL(externalDTO.ProductReturned productReturned)
        {
            var res = productReturned == null ? null : new internalDTO.ProductReturned
            {
                Id                  = productReturned.Id,
                ProductId           = productReturned.ProductId,
                Product             = ProductMapper.MapFromBLL(productReturned.Product),
                ProductReturnedTime = productReturned.ProductReturnedTime,
                Quantity            = productReturned.Quantity,
                ReturnId            = productReturned.ReturnId
            };

            return(res);
        }
Beispiel #7
0
        public static DAL.App.DTO.ProductForClient MapFromBLL(BLL.App.DTO.ProductForClient productForClient)
        {
            var res = productForClient == null ? null : new DAL.App.DTO.ProductForClient
            {
                Id        = productForClient.Id,
                Client    = ClientMapper.MapFromBLL(productForClient.Client),
                ClientId  = productForClient.ClientId,
                Product   = ProductMapper.MapFromBLL(productForClient.Product),
                ProductId = productForClient.ProductId,
                Count     = 1,
//                    ProductServices = productForClient.ProductServices.Select(e => ProductServiceMapper.MapFromBLL(e)).ToList(),
            };

            return(res);
        }
Beispiel #8
0
        public static internalDTO.ProductWithDefect MapFromBLL(externalDTO.ProductWithDefect productWithDefect)
        {
            var res = productWithDefect == null ? null : new internalDTO.ProductWithDefect
            {
                Id                  = productWithDefect.Id,
                ProductId           = productWithDefect.ProductId,
                Product             = ProductMapper.MapFromBLL(productWithDefect.Product),
                DefectRecordingTime = productWithDefect.DefectRecordingTime,
                Quantity            = productWithDefect.Quantity,
                DefectId            = productWithDefect.DefectId,
                Defect              = DefectMapper.MapFromBLL(productWithDefect.Defect)
            };

            return(res);
        }
        public static internalDTO.ProductSold MapFromBLL(externalDTO.ProductSold productSold)
        {
            var res = productSold == null ? null : new internalDTO.ProductSold
            {
                Id              = productSold.Id,
                ProductId       = productSold.ProductId,
                Product         = ProductMapper.MapFromBLL(productSold.Product),
                ProductSoldTime = productSold.ProductSoldTime,
                Quantity        = productSold.Quantity,
                SaleId          = productSold.SaleId,
                Sale            = SaleMapper.MapFromBLL(productSold.Sale)
            };

            return(res);
        }
Beispiel #10
0
        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);
        }
Beispiel #11
0
        public static externalDTO.ProductSold MapFromDAL(internalDTO.ProductSold productSold)
        {
            var res = productSold == null ? null : new externalDTO.ProductSold
            {
                Id              = productSold.Id,
                ProductId       = productSold.ProductId,
                Product         = ProductMapper.MapFromDAL(productSold.Product),
                ProductSoldTime = productSold.ProductSoldTime,
                Quantity        = productSold.Quantity,
                SaleId          = productSold.SaleId,
                //Sale = SaleMapper.MapFromDAL(productSold.Sale)
                SaleAmount = productSold.Quantity * productSold.Product?.SellPrice
            };

            return(res);
        }
        public static externalDTO.ProductInOrder MapFromDAL(internalDTO.ProductInOrder productInOrder)
        {
            var res = productInOrder == null ? null : new externalDTO.ProductInOrder
            {
                Id        = productInOrder.Id,
                ProductId = productInOrder.ProductId,
                OrderId   = productInOrder.OrderId,
                Product   = ProductMapper.MapFromDAL(productInOrder.Product),
                ProductInOrderPlacingTime = productInOrder.ProductInOrderPlacingTime,
                Quantity = productInOrder.Quantity
            };

            if (productInOrder?.Order != null)
            {
                res.Order = new BLL.App.DTO.DomainLikeDTO.Order()
                {
                    Description = productInOrder.Order.Description
                };
            }

            return(res);
        }
        public static externalDTO.ProductReturned MapFromDAL(internalDTO.ProductReturned productReturned)
        {
            var res = productReturned == null ? null : new externalDTO.ProductReturned
            {
                Id                  = productReturned.Id,
                ProductId           = productReturned.ProductId,
                Product             = ProductMapper.MapFromDAL(productReturned.Product),
                ProductReturnedTime = productReturned.ProductReturnedTime,
                Quantity            = productReturned.Quantity,
                ReturnId            = productReturned.ReturnId,
            };

            if (productReturned?.Return != null)
            {
                res.Return = new BLL.App.DTO.DomainLikeDTO.Return()
                {
                    Description = productReturned.Return.Description
                };
            }

            return(res);
        }