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

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

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

            return(res);
        }
        public static internalDTO.ProductForClient MapFromExternal(externalDTO.ProductForClient productForClient)
        {
            var res = productForClient == null ? null : new internalDTO.ProductForClient
            {
                Id        = productForClient.Id,
                Client    = ClientMapper.MapFromExternal(productForClient.Client),
                ClientId  = productForClient.ClientId,
                Product   = ProductMapper.MapFromExternal(productForClient.Product),
                ProductId = productForClient.ProductId,
                Count     = productForClient.Count,
//                    ProductServices = productForClient.ProductServices.Select(e => ProductServiceMapper.MapFromExternal(e)).ToList(),
            };

            return(res);
        }
Exemple #5
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);
        }