mirror of https://github.com/EasyAbp/EShop.git
26 changed files with 3912 additions and 194 deletions
@ -1,24 +0,0 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes.Dtos |
|||
{ |
|||
public class CreateUpdateProductTypeDto |
|||
{ |
|||
[Required] |
|||
[DisplayName("ProductTypeName")] |
|||
public string Name { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductTypeDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[DisplayName("ProductTypeDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[DisplayName("ProductTypeMultiTenancySide")] |
|||
public MultiTenancySides MultiTenancySide { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace EasyAbp.EShop.Products |
|||
{ |
|||
public static class ProductsConsts |
|||
{ |
|||
public const string DefaultProductType = "Default"; |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Products.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal |
|||
@inject IHtmlLocalizer<ProductsResource> L |
|||
@model EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType.CreateModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ProductType" data-ajaxForm="true" asp-page="CreateModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["CreateProductType"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-form-content /> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -1,26 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.ProductTypes.Dtos; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType |
|||
{ |
|||
public class CreateModalModel : ProductsPageModel |
|||
{ |
|||
[BindProperty] |
|||
public CreateUpdateProductTypeDto ProductType { get; set; } |
|||
|
|||
private readonly IProductTypeAppService _service; |
|||
|
|||
public CreateModalModel(IProductTypeAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
await _service.CreateAsync(ProductType); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Products.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal |
|||
@inject IHtmlLocalizer<ProductsResource> L |
|||
@model EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType.EditModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ProductType" data-ajaxForm="true" asp-page="EditModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["EditProductType"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-input asp-for="Id" /> |
|||
<abp-form-content /> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -1,37 +0,0 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.ProductTypes.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType |
|||
{ |
|||
public class EditModalModel : ProductsPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid Id { get; set; } |
|||
|
|||
[BindProperty] |
|||
public CreateUpdateProductTypeDto ProductType { get; set; } |
|||
|
|||
private readonly IProductTypeAppService _service; |
|||
|
|||
public EditModalModel(IProductTypeAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public async Task OnGetAsync() |
|||
{ |
|||
var dto = await _service.GetAsync(Id); |
|||
ProductType = ObjectMapper.Map<ProductTypeDto, CreateUpdateProductTypeDto>(dto); |
|||
} |
|||
|
|||
public async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
await _service.UpdateAsync(Id, ProductType); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,22 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace EShopSample.Migrations |
|||
{ |
|||
public partial class AddedProductTypeNameToOrderLine : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ProductTypeName", |
|||
table: "EShopOrdersOrderLines", |
|||
nullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "ProductTypeName", |
|||
table: "EShopOrdersOrderLines"); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue