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

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

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

            return(res);
        }
예제 #4
0
        public static externalDTO.Return MapFromBLL(internalDTO.ReturnWithProductCount @return)
        {
            var res = @return == null ? null : new externalDTO.Return()
            {
                Id                    = @return.Id,
                Description           = @return.Description,
                ProductsReturnedCount = @return.ProductsReturnedCount,
                ShopId                = @return.ShopId,
                ShopName              = @return.ShopName
            };

            if (@return?.ProductIdNameDtos != null)
            {
                res.ProductIdNameDtos = @return.ProductIdNameDtos.Select(e => ProductMapper.MapFromBLL(e)).ToList();
            }
            return(res);
        }