|
|
@ -13,23 +13,23 @@ namespace EasyAbp.EShop.Products.Products.Dtos |
|
|
{ |
|
|
{ |
|
|
[DisplayName("ProductStoreId")] |
|
|
[DisplayName("ProductStoreId")] |
|
|
public Guid StoreId { get; set; } |
|
|
public Guid StoreId { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductProductGroupName")] |
|
|
[DisplayName("ProductProductGroupName")] |
|
|
public string ProductGroupName { get; set; } |
|
|
public string ProductGroupName { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductDetailId")] |
|
|
[DisplayName("ProductDetailId")] |
|
|
public Guid? ProductDetailId { get; set; } |
|
|
public Guid? ProductDetailId { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductCategory")] |
|
|
[DisplayName("ProductCategory")] |
|
|
public ICollection<Guid> CategoryIds { get; set; } |
|
|
public ICollection<Guid> CategoryIds { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductUniqueName")] |
|
|
[DisplayName("ProductUniqueName")] |
|
|
public string UniqueName { get; set; } |
|
|
public string UniqueName { get; set; } |
|
|
|
|
|
|
|
|
[Required] |
|
|
[Required] |
|
|
[DisplayName("ProductDisplayName")] |
|
|
[DisplayName("ProductDisplayName")] |
|
|
public string DisplayName { get; set; } |
|
|
public string DisplayName { get; set; } |
|
|
|
|
|
|
|
|
public ICollection<CreateUpdateProductAttributeDto> ProductAttributes { get; set; } |
|
|
public ICollection<CreateUpdateProductAttributeDto> ProductAttributes { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductInventoryStrategy")] |
|
|
[DisplayName("ProductInventoryStrategy")] |
|
|
@ -46,10 +46,10 @@ namespace EasyAbp.EShop.Products.Products.Dtos |
|
|
|
|
|
|
|
|
[DisplayName("ProductIsPublished")] |
|
|
[DisplayName("ProductIsPublished")] |
|
|
public bool IsPublished { get; set; } |
|
|
public bool IsPublished { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductIsHidden")] |
|
|
[DisplayName("ProductIsHidden")] |
|
|
public bool IsHidden { get; set; } |
|
|
public bool IsHidden { get; set; } |
|
|
|
|
|
|
|
|
[DisplayName("ProductPaymentExpireIn")] |
|
|
[DisplayName("ProductPaymentExpireIn")] |
|
|
public TimeSpan? PaymentExpireIn { get; set; } |
|
|
public TimeSpan? PaymentExpireIn { get; set; } |
|
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos |
|
|
new[] { "PaymentExpireIn" } |
|
|
new[] { "PaymentExpireIn" } |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ProductAttributes.Select(a => a.DisplayName.Trim()).Distinct().Count() != ProductAttributes.Count) |
|
|
if (ProductAttributes.Select(a => a.DisplayName.Trim()).Distinct().Count() != ProductAttributes.Count) |
|
|
{ |
|
|
{ |
|
|
yield return new ValidationResult( |
|
|
yield return new ValidationResult( |
|
|
@ -73,15 +73,17 @@ namespace EasyAbp.EShop.Products.Products.Dtos |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var optionNameList = ProductAttributes.SelectMany(a => a.ProductAttributeOptions) |
|
|
foreach (var productAttribute in ProductAttributes) |
|
|
.Select(o => o.DisplayName.Trim()).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
if (optionNameList.Distinct().Count() != optionNameList.Count) |
|
|
|
|
|
{ |
|
|
{ |
|
|
yield return new ValidationResult( |
|
|
var options = productAttribute.ProductAttributeOptions; |
|
|
"DisplayNames of ProductAttributeOptions should be unique!", |
|
|
|
|
|
new[] { "ProductAttributeOptions" } |
|
|
if (options.Select(o => o.DisplayName.Trim()).Distinct().Count() != options.Count) |
|
|
); |
|
|
{ |
|
|
|
|
|
yield return new ValidationResult( |
|
|
|
|
|
"DisplayNames of ProductAttributeOptions should be unique!", |
|
|
|
|
|
new[] { "ProductAttributeOptions" } |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|