Ejemplo n.º 1
0
        public static Domain.Return MapFromDAL(DAL.App.DTO.DomainLikeDTO.Return returnWithProductCount)
        {
            var res = returnWithProductCount == null ? null : new Domain.Return
            {
                Id          = returnWithProductCount.Id,
                Description = new MultiLangString(returnWithProductCount.Description),
                ShopId      = returnWithProductCount.ShopId,
                Shop        = ShopMapper.MapFromDAL(returnWithProductCount.Shop)
            };

            return(res);
        }
Ejemplo n.º 2
0
        public static Domain.Category MapFromDAL(DAL.App.DTO.DomainLikeDTO.Category category)
        {
            var res = category == null ? null : new Domain.Category
            {
                Id           = category.Id,
                CategoryName = new MultiLangString(category.CategoryName),
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromDAL(category.Shop)
            };

            return(res);
        }
Ejemplo n.º 3
0
        public static Domain.Inventory MapFromDAL(DAL.App.DTO.DomainLikeDTO.Inventory inventoryWithProductCount)
        {
            var res = inventoryWithProductCount == null ? null : new Domain.Inventory
            {
                Id                    = inventoryWithProductCount.Id,
                Description           = new MultiLangString(inventoryWithProductCount.Description),
                InventoryCreationTime = inventoryWithProductCount.InventoryCreationTime,
                ShopId                = inventoryWithProductCount.ShopId,
                Shop                  = ShopMapper.MapFromDAL(inventoryWithProductCount.Shop)
            };

            return(res);
        }
Ejemplo n.º 4
0
        public static DAL.App.DTO.DomainLikeDTO.Inventory MapFromDomain(Domain.Inventory inventory)
        {
            var res = inventory == null ? null : new DAL.App.DTO.DomainLikeDTO.Inventory
            {
                Id                    = inventory.Id,
                Description           = inventory.Description?.Translate(),
                InventoryCreationTime = inventory.InventoryCreationTime,
                ShopId                = inventory.ShopId,
                Shop                  = ShopMapper.MapFromDomain(inventory.Shop)
            };

            return(res);
        }
Ejemplo n.º 5
0
        public static Domain.Order MapFromDAL(DAL.App.DTO.DomainLikeDTO.Order order)
        {
            var res = order == null ? null : new Domain.Order
            {
                Id                = order.Id,
                Description       = new MultiLangString(order.Description),
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromDAL(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromDAL(order.Shop)
            };

            return(res);
        }
Ejemplo n.º 6
0
        public static Domain.Identity.AppUser MapFromDAL(DAL.App.DTO.DomainLikeDTO.Identity.AppUser appUser)
        {
            var res = appUser == null ? null : new Domain.Identity.AppUser
            {
                Id        = appUser.Id,
                FirstName = appUser.FirstName,
                LastName  = appUser.LastName,
                Aadress   = appUser.Aadress,
                Email     = appUser.Email,
                ShopId    = appUser.ShopId,
                Shop      = ShopMapper.MapFromDAL(appUser.Shop)
            };

            return(res);
        }
Ejemplo n.º 7
0
        public static Domain.Comment MapFromDAL(DAL.App.DTO.DomainLikeDTO.Comment comment)
        {
            var res = comment == null ? null : new Domain.Comment
            {
                Id           = comment.Id,
                CommentTitle = new MultiLangString(comment.CommentTitle),
                CommentBody  = new MultiLangString(comment.CommentBody),
                ProductId    = comment.ProductId,
                Product      = ProductMapper.MapFromDAL(comment.Product),
                ShopId       = comment.ShopId,
                Shop         = ShopMapper.MapFromDAL(comment.Shop)
            };

            return(res);
        }
Ejemplo n.º 8
0
        public static DAL.App.DTO.DomainLikeDTO.Comment MapFromDomain(Domain.Comment comment)
        {
            var res = comment == null ? null : new DAL.App.DTO.DomainLikeDTO.Comment
            {
                Id           = comment.Id,
                CommentTitle = comment.CommentTitle.Translate(),
                CommentBody  = comment.CommentBody.Translate(),
                ProductId    = comment.ProductId,
                Product      = ProductMapper.MapFromDomain(comment.Product),
                ShopId       = comment.ShopId,
                Shop         = ShopMapper.MapFromDomain(comment.Shop)
            };

            return(res);
        }
Ejemplo n.º 9
0
        public static DAL.App.DTO.DomainLikeDTO.Return MapFromDomain(Domain.Return @return)
        {
            var res = @return == null ? null : new DAL.App.DTO.DomainLikeDTO.Return
            {
                Id          = @return.Id,
                Description = @return.Description.Translate(),
                ShopId      = @return.ShopId,
                Shop        = ShopMapper.MapFromDomain(@return.Shop)
            };

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

            return(res);
        }
Ejemplo n.º 10
0
        public static DAL.App.DTO.DomainLikeDTO.Category MapFromDomain(Domain.Category category)
        {
            var res = category == null ? null : new DAL.App.DTO.DomainLikeDTO.Category
            {
                Id           = category.Id,
                CategoryName = category.CategoryName.Translate(),
                ShopId       = category.ShopId,
                Shop         = ShopMapper.MapFromDomain(category.Shop)
            };

            if (category?.ProductsInCategory != null)
            {
                res.ProductsInCategory = category.ProductsInCategory.Select(e => ProductInCategoryMapper.MapFromDomain(e)).ToList();
            }

            return(res);
        }
Ejemplo n.º 11
0
        public static DAL.App.DTO.DomainLikeDTO.Defect MapFromDomain(Domain.Defect defect)
        {
            var res = defect == null ? null : new DAL.App.DTO.DomainLikeDTO.Defect
            {
                Id          = defect.Id,
                Description = defect.Description.Translate(),
                ShopId      = defect.ShopId,
                Shop        = ShopMapper.MapFromDomain(defect.Shop)
            };

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

            return(res);
        }
Ejemplo n.º 12
0
        public static DAL.App.DTO.DomainLikeDTO.Order MapFromDomain(Domain.Order order)
        {
            var res = order == null ? null : new DAL.App.DTO.DomainLikeDTO.Order
            {
                Id                = order.Id,
                Description       = order.Description.Translate(),
                OrderCreationTime = order.OrderCreationTime,
                ShipperId         = order.ShipperId,
                Shipper           = ShipperMapper.MapFromDomain(order.Shipper),
                ShopId            = order.ShopId,
                Shop              = ShopMapper.MapFromDomain(order.Shop)
            };

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

            return(res);
        }
Ejemplo n.º 13
0
        public static DAL.App.DTO.DomainLikeDTO.Product MapFromDomain(Domain.Product product)
        {
            var res = product == null ? null : new DAL.App.DTO.DomainLikeDTO.Product
            {
                Id = product.Id,
                ManuFacturerItemCode      = product.ManuFacturerItemCode?.Translate(),
                ShopCode                  = product.ShopCode?.Translate(),
                ProductName               = product.ProductName?.Translate(),
                BuyPrice                  = product.BuyPrice,
                PercentageAddedToBuyPrice = product.PercentageAddedToBuyPrice,
                SellPrice                 = product.SellPrice,
                Quantity                  = product.Quantity,
                Weight = product.Weight?.Translate(),
                Length = product.Length?.Translate()
            };

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

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

            return(res);
        }
Ejemplo n.º 14
0
        public static Domain.Product MapFromDAL(DAL.App.DTO.DomainLikeDTO.Product product)
        {
            var res = product == null ? null : new Domain.Product
            {
                Id = product.Id,
                ManuFacturerItemCode      = new MultiLangString(product.ManuFacturerItemCode),
                ShopCode                  = new MultiLangString(product.ShopCode),
                ProductName               = new MultiLangString(product.ProductName),
                BuyPrice                  = product.BuyPrice,
                PercentageAddedToBuyPrice = product.PercentageAddedToBuyPrice,
                SellPrice                 = product.SellPrice,
                Quantity                  = product.Quantity,
                Weight         = new MultiLangString(product.Weight),
                Length         = new MultiLangString(product.Length),
                ManuFacturerId = product.ManuFacturerId,
                Manufacturer   = ManuFacturerMapper.MapFromDAL(product.Manufacturer),
                InventoryId    = product.InventoryId,
                Inventory      = InventoryMapper.MapFromDAL(product.Inventory),
                ShopId         = product.ShopId,
                Shop           = ShopMapper.MapFromDAL(product.Shop)
            };

            return(res);
        }