mirror of https://github.com/EasyAbp/EShop.git
39 changed files with 5156 additions and 63 deletions
@ -0,0 +1,21 @@ |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class CreateUpdateProductAttributeDto |
|||
{ |
|||
[Required] |
|||
[DisplayName("ProductAttributeDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[DisplayName("ProductAttributeDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[DisplayName("ProductAttributeDisplayOrder")] |
|||
public int DisplayOrder { get; set; } |
|||
|
|||
public ICollection<CreateUpdateProductAttributeOptionDto> ProductAttributeOptions { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class CreateUpdateProductAttributeOptionDto |
|||
{ |
|||
[Required] |
|||
[DisplayName("ProductAttributeOptionDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[DisplayName("ProductAttributeOptionDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[DisplayName("ProductAttributeOptionDisplayOrder")] |
|||
public int DisplayOrder { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels |
|||
{ |
|||
public class CreateUpdateProductAttributeOptionViewModel |
|||
{ |
|||
[Required] |
|||
[Display(Name = "ProductAttributeOptionDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[Display(Name = "ProductAttributeOptionDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[Display(Name = "ProductAttributeOptionDisplayOrder")] |
|||
public int DisplayOrder { get; set; } = 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels |
|||
{ |
|||
public class CreateUpdateProductAttributeViewModel |
|||
{ |
|||
[Required] |
|||
[Display(Name = "ProductAttributeDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[Display(Name = "ProductAttributeDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[Display(Name = "ProductAttributeDisplayOrder")] |
|||
public int DisplayOrder { get; set; } = 0; |
|||
|
|||
public List<CreateUpdateProductAttributeOptionViewModel> ProductAttributeOptions { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels |
|||
{ |
|||
public class CreateUpdateProductDetailViewModel |
|||
{ |
|||
[TextArea(Rows = 4)] |
|||
[Display(Name = "ProductDetailDescription")] |
|||
public string Description { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels |
|||
{ |
|||
public class CreateUpdateProductViewModel |
|||
{ |
|||
[HiddenInput] |
|||
[Display(Name = "ProductStore")] |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
[Required] |
|||
[SelectItems("ProductTypes")] |
|||
[Display(Name = "ProductType")] |
|||
public Guid ProductTypeId { get; set; } |
|||
|
|||
[SelectItems("Categories")] |
|||
[Display(Name = "ProductCategory")] |
|||
public List<Guid> CategoryIds { get; set; } |
|||
|
|||
[Required] |
|||
[Display(Name = "ProductDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
public CreateUpdateProductDetailViewModel ProductDetail { get; set; } |
|||
|
|||
[Required] |
|||
[Placeholder("ProductAttributeNamesPlaceholder")] |
|||
[Display(Name = "ProductAttributeNames")] |
|||
public string ProductAttributeNames { get; set; } |
|||
|
|||
[Required] |
|||
[TextArea(Rows = 4)] |
|||
[Placeholder("ProductAttributeOptionNamesPlaceholder")] |
|||
[Display(Name = "ProductAttributeOptionNames")] |
|||
public string ProductAttributeOptionNames { get; set; } |
|||
|
|||
[Display(Name = "ProductInventoryStrategy")] |
|||
public InventoryStrategy InventoryStrategy { get; set; } |
|||
|
|||
[Display(Name = "ProductDisplayOrder")] |
|||
public int DisplayOrder { get; set; } = 0; |
|||
|
|||
[Display(Name = "ProductMediaResources")] |
|||
public string MediaResources { get; set; } |
|||
|
|||
[Display(Name = "ProductIsPublished")] |
|||
public bool IsPublished { get; set; } |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,43 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EasyMall.Migrations |
|||
{ |
|||
public partial class AddedDisplayOrder : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<int>( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProducts", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
|
|||
migrationBuilder.AddColumn<int>( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProductAttributes", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
|
|||
migrationBuilder.AddColumn<int>( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProductAttributeOptions", |
|||
nullable: false, |
|||
defaultValue: 0); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProducts"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProductAttributes"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "DisplayOrder", |
|||
table: "ProductsProductAttributeOptions"); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,45 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EasyMall.Migrations |
|||
{ |
|||
public partial class SetPricePrecision : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<decimal>( |
|||
name: "Price", |
|||
table: "ProductsProductSkus", |
|||
type: "decimal(18,6)", |
|||
nullable: false, |
|||
oldClrType: typeof(decimal), |
|||
oldType: "decimal(18,2)"); |
|||
|
|||
migrationBuilder.AlterColumn<decimal>( |
|||
name: "OriginalPrice", |
|||
table: "ProductsProductSkus", |
|||
type: "decimal(18,6)", |
|||
nullable: false, |
|||
oldClrType: typeof(decimal), |
|||
oldType: "decimal(18,2)"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<decimal>( |
|||
name: "Price", |
|||
table: "ProductsProductSkus", |
|||
type: "decimal(18,2)", |
|||
nullable: false, |
|||
oldClrType: typeof(decimal), |
|||
oldType: "decimal(18,6)"); |
|||
|
|||
migrationBuilder.AlterColumn<decimal>( |
|||
name: "OriginalPrice", |
|||
table: "ProductsProductSkus", |
|||
type: "decimal(18,2)", |
|||
nullable: false, |
|||
oldClrType: typeof(decimal), |
|||
oldType: "decimal(18,6)"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue