Commit 2f709752 authored by gdlcf88's avatar gdlcf88

Make the OriginalPrice an optional property of ProductSku, close #10

Fix sku updating feature
parent e266cf93
......@@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public string Currency { get; set; }
[DisplayName("ProductSkuOriginalPrice")]
public decimal OriginalPrice { get; set; }
public decimal? OriginalPrice { get; set; }
[DisplayName("ProductSkuPrice")]
public decimal Price { get; set; }
......
......@@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public string Currency { get; set; }
public decimal OriginalPrice { get; set; }
public decimal? OriginalPrice { get; set; }
public decimal Price { get; set; }
......
......@@ -12,7 +12,7 @@ namespace EasyAbp.EShop.Products.Products
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal OriginalPrice { get; protected set; }
public virtual decimal? OriginalPrice { get; protected set; }
public virtual decimal Price { get; protected set; }
......@@ -30,7 +30,7 @@ namespace EasyAbp.EShop.Products.Products
Guid id,
[NotNull] string serializedAttributeOptionIds,
[NotNull] string currency,
decimal originalPrice,
decimal? originalPrice,
decimal price,
int inventory,
int sold,
......
......@@ -9,9 +9,9 @@
<abp-modal>
<abp-modal-header title="@L["EditProductSku"].Value"></abp-modal-header>
<abp-modal-body>
<abp-input asp-for="Id" />
<abp-input asp-for="StoreId" />
<abp-input asp-for="ProductId" />
<abp-input asp-for="ProductSkuId" />
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
......
......@@ -12,10 +12,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku
{
public class EditModalModel : ProductsPageModel
{
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid Id { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid StoreId { get; set; }
......@@ -24,6 +20,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku
[BindProperty(SupportsGet = true)]
public Guid ProductId { get; set; }
[HiddenInput]
[BindProperty(SupportsGet = true)]
public Guid ProductSkuId { get; set; }
......
......@@ -15,7 +15,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.ProductSku.Vi
public decimal Price { get; set; }
[Display(Name = "ProductSkuOriginalPrice")]
public decimal OriginalPrice { get; set; }
public decimal? OriginalPrice { get; set; }
[Required]
[Display(Name = "ProductSkuInventory")]
......
using Microsoft.EntityFrameworkCore.Migrations;
namespace EasyMall.Migrations
{
public partial class MakeOriginalPriceNullable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPrice",
table: "ProductsProductSkus",
type: "decimal(18,6)",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<decimal>(
name: "OriginalPrice",
table: "ProductsProductSkus",
type: "decimal(18,6)",
nullable: false,
oldClrType: typeof(decimal),
oldType: "decimal(18,6)",
oldNullable: true);
}
}
}
......@@ -547,7 +547,7 @@ namespace EasyMall.Migrations
b.Property<int>("OrderMinQuantity")
.HasColumnType("int");
b.Property<decimal>("OriginalPrice")
b.Property<decimal?>("OriginalPrice")
.HasColumnType("decimal(18,6)");
b.Property<decimal>("Price")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment