using AyCode.Interfaces.Entities; using Mango.Nop.Core.Interfaces; using Nop.Core.Domain.Catalog; using Nop.Core.Domain.Discounts; namespace Mango.Nop.Core.Dtos; public class ProductDto : ModelDtoBase, IProductDto//, IDiscountSupported { //public int Id { get; set; } public int ProductTypeId { get; set; } public int ParentGroupedProductId { get; set; } public string Name { get; set; } public string ShortDescription { get; set; } public string FullDescription { get; set; } public int WarehouseId { get; set; } public int StockQuantity { get; set; } public decimal Weight { get; set; } public decimal Length { get; set; } public decimal Width { get; set; } public decimal Height { get; set; } public bool Deleted { get; set; } public ProductDto() :base() { } public ProductDto(int productId) : base(productId) { } public ProductDto(Product product) : base(product) { } public override void CopyDtoValuesToEntity(Product entity) { base.CopyDtoValuesToEntity(entity); entity.ProductTypeId = ProductTypeId; entity.ParentGroupedProductId = ParentGroupedProductId; entity.Name = Name; entity.ShortDescription = ShortDescription; entity.FullDescription = FullDescription; entity.WarehouseId = WarehouseId; entity.StockQuantity = StockQuantity; entity.Weight = Weight; entity.Length = Length; entity.Width = Width; entity.Height = Height; entity.Deleted = Deleted; } public override void CopyEntityValuesToDto(Product entity) { base.CopyEntityValuesToDto(entity); ProductTypeId = entity.ProductTypeId; ParentGroupedProductId = entity.ParentGroupedProductId; Name = entity.Name; ShortDescription = entity.ShortDescription; FullDescription = entity.FullDescription; WarehouseId = entity.WarehouseId; StockQuantity = entity.StockQuantity; Weight = entity.Weight; Length = entity.Length; Width = entity.Width; Height = entity.Height; Deleted = entity.Deleted; } public override Product CreateMainEntity() { //base.CreateMainEntity(); var product = new Product(); CopyDtoValuesToEntity(product); return product; } public bool SubjectToAcl { get; set; } public bool LimitedToStores { get; set; } }