mirror of https://github.com/EasyAbp/EShop.git
115 changed files with 8254 additions and 42 deletions
@ -1,6 +1,6 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public class BookingRemoteServiceConsts |
|||
public class EShopPluginsBookingRemoteServiceConsts |
|||
{ |
|||
public const string RemoteServiceName = "EasyAbpEShopPluginsBooking"; |
|||
|
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetCategoryDto |
|||
{ |
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetCategoryId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetCategoryPeriodDto |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetCategoryDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetCategoryId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public decimal? Price { get; set; } |
|||
|
|||
public List<ProductAssetCategoryPeriodDto> Periods { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetCategoryPeriodDto : EntityDto<Guid> |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetCategoryDto |
|||
{ |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetCategoryPeriodDto |
|||
{ |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public interface IProductAssetCategoryAppService : |
|||
ICrudAppService< |
|||
ProductAssetCategoryDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateProductAssetCategoryDto, |
|||
UpdateProductAssetCategoryDto> |
|||
{ |
|||
Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId, CreateProductAssetCategoryPeriodDto input); |
|||
|
|||
Task<ProductAssetCategoryDto> UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, UpdateProductAssetCategoryPeriodDto input); |
|||
|
|||
Task<ProductAssetCategoryDto> DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId); |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetDto |
|||
{ |
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetPeriodDto |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public decimal? Price { get; set; } |
|||
|
|||
public List<ProductAssetPeriodDto> Periods { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetPeriodDto : EntityDto<Guid> |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetDto |
|||
{ |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetPeriodDto |
|||
{ |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public interface IProductAssetAppService : |
|||
ICrudAppService< |
|||
ProductAssetDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateProductAssetDto, |
|||
UpdateProductAssetDto> |
|||
{ |
|||
Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId, CreateProductAssetPeriodDto input); |
|||
|
|||
Task<ProductAssetDto> UpdatePeriodAsync(Guid productAssetId, Guid periodId, UpdateProductAssetPeriodDto input); |
|||
|
|||
Task<ProductAssetDto> DeletePeriodAsync(Guid productAssetId, Guid periodId); |
|||
} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryAppService : CrudAppService<ProductAssetCategory, ProductAssetCategoryDto, Guid, PagedAndSortedResultRequestDto, CreateProductAssetCategoryDto, UpdateProductAssetCategoryDto>, |
|||
IProductAssetCategoryAppService |
|||
{ |
|||
protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; |
|||
protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; |
|||
protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Create; |
|||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Update; |
|||
protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Delete; |
|||
|
|||
private readonly IProductAssetCategoryRepository _repository; |
|||
|
|||
public ProductAssetCategoryAppService(IProductAssetCategoryRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId, CreateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
productAsset.AddPeriod(ObjectMapper.Map<CreateProductAssetCategoryPeriodDto, ProductAssetCategoryPeriod>(input)); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, UpdateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
var productAssetCategoryPeriod = productAsset.GetPeriod(periodId); |
|||
|
|||
ObjectMapper.Map(input, productAssetCategoryPeriod); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
productAsset.RemovePeriod(periodId); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public class ProductAssetAppService : CrudAppService<ProductAsset, ProductAssetDto, Guid, PagedAndSortedResultRequestDto, CreateProductAssetDto, UpdateProductAssetDto>, |
|||
IProductAssetAppService |
|||
{ |
|||
protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; |
|||
protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; |
|||
protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAsset.Create; |
|||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAsset.Update; |
|||
protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAsset.Delete; |
|||
|
|||
private readonly IProductAssetRepository _repository; |
|||
|
|||
public ProductAssetAppService(IProductAssetRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId, CreateProductAssetPeriodDto input) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
productAsset.AddPeriod(ObjectMapper.Map<CreateProductAssetPeriodDto, ProductAssetPeriod>(input)); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> UpdatePeriodAsync(Guid productAssetId, Guid periodId, UpdateProductAssetPeriodDto input) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
var productAssetPeriod = productAsset.GetPeriod(periodId); |
|||
|
|||
ObjectMapper.Map(input, productAssetPeriod); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> DeletePeriodAsync(Guid productAssetId, Guid periodId) |
|||
{ |
|||
await CheckUpdatePolicyAsync(); |
|||
|
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
productAsset.RemovePeriod(periodId); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public class BookingConsts |
|||
{ |
|||
public const double MinimumPrice = 0f; |
|||
public const double MaximumPrice = 999999999999.99999999f; |
|||
} |
|||
@ -1,7 +1,54 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"MyAccount": "My account", |
|||
"SamplePageMessage": "A sample page for the Booking module" |
|||
"Menu:Booking": "Booking business", |
|||
"Permission:ProductAsset": "Asset prices", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:ProductAsset": "Asset prices", |
|||
"ProductAsset": "Asset prices", |
|||
"ProductAssetProductId": "Product ID", |
|||
"ProductAssetProductSkuId": "Product SKU ID", |
|||
"ProductAssetAssetId": "Asset ID", |
|||
"ProductAssetPeriodSchemeId": "Period Scheme ID", |
|||
"ProductAssetFromTime": "From time", |
|||
"ProductAssetToTime": "To time", |
|||
"ProductAssetPrice": "Price", |
|||
"ProductAssetPeriods": "Period prices", |
|||
"CreateProductAsset": "New", |
|||
"EditProductAsset": "Edit", |
|||
"ProductAssetDeletionConfirmationMessage": "Are you sure to delete the product asset {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:ProductAssetPeriod": "Asset period prices", |
|||
"ProductAssetPeriod": "Asset period prices", |
|||
"ProductAssetPeriodPeriodId": "Period ID", |
|||
"ProductAssetPeriodPrice": "Price", |
|||
"CreateProductAssetPeriod": "New", |
|||
"EditProductAssetPeriod": "Edit", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "Are you sure to delete the product asset period {0}?", |
|||
"Permission:ProductAssetCategory": "Asset category prices", |
|||
"Menu:ProductAssetCategory": "Asset category prices", |
|||
"ProductAssetCategory": "Asset category prices", |
|||
"ProductAssetCategoryProductId": "Product ID", |
|||
"ProductAssetCategoryProductSkuId": "Product SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "Asset Category ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "Period Scheme ID", |
|||
"ProductAssetCategoryFromTime": "From time", |
|||
"ProductAssetCategoryToTime": "To time", |
|||
"ProductAssetCategoryPrice": "Price", |
|||
"ProductAssetCategoryPeriods": "Period prices", |
|||
"CreateProductAssetCategory": "New", |
|||
"EditProductAssetCategory": "Edit", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "Are you sure to delete the product asset category {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "Asset category period prices", |
|||
"ProductAssetCategoryPeriod": "Asset category period prices", |
|||
"ProductAssetCategoryPeriodPeriodId": "Period ID", |
|||
"ProductAssetCategoryPeriodPrice": "Price", |
|||
"CreateProductAssetCategoryPeriod": "New", |
|||
"EditProductAssetCategoryPeriod": "Edit", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "Are you sure to delete the product asset category period {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "Period {id} not found.", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "Period {id} exists." |
|||
} |
|||
} |
|||
@ -1,7 +1,54 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"MyAccount": "我的账户", |
|||
"SamplePageMessage": "Booking模块的示例页面" |
|||
"Menu:Booking": "预约业务", |
|||
"Permission:ProductAsset": "资产价格", |
|||
"Permission:Create": "新建", |
|||
"Permission:Update": "更新", |
|||
"Permission:Delete": "删除", |
|||
"Menu:ProductAsset": "资产价格", |
|||
"ProductAsset": "资产价格", |
|||
"ProductAssetProductId": "产品 ID", |
|||
"ProductAssetProductSkuId": "产品 SKU ID", |
|||
"ProductAssetAssetId": "资产 ID", |
|||
"ProductAssetPeriodSchemeId": "时段方案 ID", |
|||
"ProductAssetFromTime": "生效时间", |
|||
"ProductAssetToTime": "结束时间", |
|||
"ProductAssetPrice": "价格", |
|||
"ProductAssetPeriods": "时段价格", |
|||
"CreateProductAsset": "新建", |
|||
"EditProductAsset": "编辑", |
|||
"ProductAssetDeletionConfirmationMessage": "确认删除资产价格 {0}?", |
|||
"SuccessfullyDeleted": "删除成功", |
|||
"Menu:ProductAssetPeriod": "资产时段价格", |
|||
"ProductAssetPeriod": "资产时段价格", |
|||
"ProductAssetPeriodPeriodId": "时段 ID", |
|||
"ProductAssetPeriodPrice": "价格", |
|||
"CreateProductAssetPeriod": "新建", |
|||
"EditProductAssetPeriod": "编辑", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "确认删除资产时段价格 {0}?", |
|||
"Permission:ProductAssetCategory": "资产类目价格", |
|||
"Menu:ProductAssetCategory": "资产类目价格", |
|||
"ProductAssetCategory": "资产类目价格", |
|||
"ProductAssetCategoryProductId": "产品 ID", |
|||
"ProductAssetCategoryProductSkuId": "产品 SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "资产目录 ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "时段方案 ID", |
|||
"ProductAssetCategoryFromTime": "生效时间", |
|||
"ProductAssetCategoryToTime": "结束时间", |
|||
"ProductAssetCategoryPrice": "价格", |
|||
"ProductAssetCategoryPeriods": "时段价格", |
|||
"CreateProductAssetCategory": "新建", |
|||
"EditProductAssetCategory": "编辑", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "确认删除资产类目价格 {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "资产类目时段价格", |
|||
"ProductAssetCategoryPeriod": "资产类目时段价格", |
|||
"ProductAssetCategoryPeriodPeriodId": "时段 ID", |
|||
"ProductAssetCategoryPeriodPrice": "价格", |
|||
"CreateProductAssetCategoryPeriod": "新建", |
|||
"EditProductAssetCategoryPeriod": "编辑", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "确认删除资产类目时段价格 {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "时段 {id} 不存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "时段 {id} 已存在。" |
|||
} |
|||
} |
|||
@ -1,7 +1,54 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"MyAccount": "我的賬戶", |
|||
"SamplePageMessage": "Booking 模塊的示例頁面" |
|||
"Menu:Booking": "預約業務", |
|||
"Permission:ProductAsset": "資產價格", |
|||
"Permission:Create": "新建", |
|||
"Permission:Update": "更新", |
|||
"Permission:Delete": "刪除", |
|||
"Menu:ProductAsset": "資產價格", |
|||
"ProductAsset": "資產價格", |
|||
"ProductAssetProductId": "產品 ID", |
|||
"ProductAssetProductSkuId": "產品 SKU ID", |
|||
"ProductAssetAssetId": "資產 ID", |
|||
"ProductAssetPeriodSchemeId": "時段方案 ID", |
|||
"ProductAssetFromTime": "生效時間", |
|||
"ProductAssetToTime": "結束時間", |
|||
"ProductAssetPrice": "價格", |
|||
"ProductAssetPeriods": "時段價格", |
|||
"CreateProductAsset": "新建", |
|||
"EditProductAsset": "編輯", |
|||
"ProductAssetDeletionConfirmationMessage": "確認刪除資產價格 {0}?", |
|||
"SuccessfullyDeleted": "刪除成功", |
|||
"Menu:ProductAssetPeriod": "資產時段價格", |
|||
"ProductAssetPeriod": "資產時段價格", |
|||
"ProductAssetPeriodPeriodId": "時段 ID", |
|||
"ProductAssetPeriodPrice": "價格", |
|||
"CreateProductAssetPeriod": "新建", |
|||
"EditProductAssetPeriod": "編輯", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "確認刪除資產時段價格 {0}?", |
|||
"Permission:ProductAssetCategory": "資產類目價格", |
|||
"Menu:ProductAssetCategory": "資產類目價格", |
|||
"ProductAssetCategory": "資產類目價格", |
|||
"ProductAssetCategoryProductId": "產品 ID", |
|||
"ProductAssetCategoryProductSkuId": "產品 SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "資產目錄 ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "時段方案 ID", |
|||
"ProductAssetCategoryFromTime": "生效時間", |
|||
"ProductAssetCategoryToTime": "結束時間", |
|||
"ProductAssetCategoryPrice": "價格", |
|||
"ProductAssetCategoryPeriods": "時段價格", |
|||
"CreateProductAssetCategory": "新建", |
|||
"EditProductAssetCategory": "編輯", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "確認刪除資產類目價格 {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "資產類目時段價格", |
|||
"ProductAssetCategoryPeriod": "資產類目時段價格", |
|||
"ProductAssetCategoryPeriodPeriodId": "時段 ID", |
|||
"ProductAssetCategoryPeriodPrice": "價格", |
|||
"CreateProductAssetCategoryPeriod": "新建", |
|||
"EditProductAssetCategoryPeriod": "編輯", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "確認刪除資產類目時段價格 {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "時段 {id} 不存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "時段 {id} 已存在。" |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public interface IProductAssetCategoryRepository : IRepository<ProductAssetCategory, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public interface IProductAssetRepository : IRepository<ProductAsset, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Shared; |
|||
|
|||
public class DuplicatePeriodException : BusinessException |
|||
{ |
|||
public DuplicatePeriodException(Guid id) : base(BookingErrorCodes.DuplicatePeriod) |
|||
{ |
|||
WithData(nameof(id), id); |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Shared; |
|||
|
|||
public class PeriodNotFoundException : BusinessException |
|||
{ |
|||
public PeriodNotFoundException(Guid id) : base(BookingErrorCodes.PeriodNotFound) |
|||
{ |
|||
WithData(nameof(id), id); |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System.Linq; |
|||
using Microsoft.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public static class ProductAssetCategoryEfCoreQueryableExtensions |
|||
{ |
|||
public static IQueryable<ProductAssetCategory> IncludeDetails(this IQueryable<ProductAssetCategory> queryable, bool include = true) |
|||
{ |
|||
if (!include) |
|||
{ |
|||
return queryable; |
|||
} |
|||
|
|||
return queryable.Include(x => x.Periods); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryRepository : EfCoreRepository<IBookingDbContext, ProductAssetCategory, Guid>, IProductAssetCategoryRepository |
|||
{ |
|||
public ProductAssetCategoryRepository(IDbContextProvider<IBookingDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public override async Task<IQueryable<ProductAssetCategory>> WithDetailsAsync() |
|||
{ |
|||
return (await GetQueryableAsync()).IncludeDetails(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System.Linq; |
|||
using Microsoft.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public static class ProductAssetEfCoreQueryableExtensions |
|||
{ |
|||
public static IQueryable<ProductAsset> IncludeDetails(this IQueryable<ProductAsset> queryable, bool include = true) |
|||
{ |
|||
if (!include) |
|||
{ |
|||
return queryable; |
|||
} |
|||
|
|||
return queryable.Include(x => x.Periods); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public class ProductAssetRepository : EfCoreRepository<IBookingDbContext, ProductAsset, Guid>, IProductAssetRepository |
|||
{ |
|||
public ProductAssetRepository(IDbContextProvider<IBookingDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public override async Task<IQueryable<ProductAsset>> WithDetailsAsync() |
|||
{ |
|||
return (await GetQueryableAsync()).IncludeDetails(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
[RemoteService(Name = EShopPluginsBookingRemoteServiceConsts.RemoteServiceName)] |
|||
[Route("/api/e-shop/plugins/booking/product-asset-category")] |
|||
public class ProductAssetCategoryController : BookingController, IProductAssetCategoryAppService |
|||
{ |
|||
private readonly IProductAssetCategoryAppService _service; |
|||
|
|||
public ProductAssetCategoryController(IProductAssetCategoryAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("period/{productAssetCategoryId}")] |
|||
public virtual Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId, CreateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
return _service.CreatePeriodAsync(productAssetCategoryId, input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("period")] |
|||
public virtual Task<ProductAssetCategoryDto> UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, UpdateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
return _service.UpdatePeriodAsync(productAssetCategoryId, periodId, input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("period")] |
|||
public virtual Task<ProductAssetCategoryDto> DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId) |
|||
{ |
|||
return _service.DeletePeriodAsync(productAssetCategoryId, periodId); |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("")] |
|||
public virtual Task<ProductAssetCategoryDto> CreateAsync(CreateProductAssetCategoryDto input) |
|||
{ |
|||
return _service.CreateAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
public virtual Task<ProductAssetCategoryDto> UpdateAsync(Guid id, UpdateProductAssetCategoryDto input) |
|||
{ |
|||
return _service.UpdateAsync(id, input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
public virtual Task DeleteAsync(Guid id) |
|||
{ |
|||
return _service.DeleteAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public virtual Task<ProductAssetCategoryDto> GetAsync(Guid id) |
|||
{ |
|||
return _service.GetAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("")] |
|||
public virtual Task<PagedResultDto<ProductAssetCategoryDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|||
{ |
|||
return _service.GetListAsync(input); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
[RemoteService(Name = EShopPluginsBookingRemoteServiceConsts.RemoteServiceName)] |
|||
[Route("/api/e-shop/plugins/booking/product-asset")] |
|||
public class ProductAssetController : BookingController, IProductAssetAppService |
|||
{ |
|||
private readonly IProductAssetAppService _service; |
|||
|
|||
public ProductAssetController(IProductAssetAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("period/{productAssetId}")] |
|||
public virtual Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId, CreateProductAssetPeriodDto input) |
|||
{ |
|||
return _service.CreatePeriodAsync(productAssetId, input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("period")] |
|||
public virtual Task<ProductAssetDto> UpdatePeriodAsync(Guid productAssetId, Guid periodId, UpdateProductAssetPeriodDto input) |
|||
{ |
|||
return _service.UpdatePeriodAsync(productAssetId, periodId, input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("period")] |
|||
public virtual Task<ProductAssetDto> DeletePeriodAsync(Guid productAssetId, Guid periodId) |
|||
{ |
|||
return _service.DeletePeriodAsync(productAssetId, periodId); |
|||
} |
|||
|
|||
[HttpPost] |
|||
[Route("")] |
|||
public virtual Task<ProductAssetDto> CreateAsync(CreateProductAssetDto input) |
|||
{ |
|||
return _service.CreateAsync(input); |
|||
} |
|||
|
|||
[HttpPut] |
|||
[Route("{id}")] |
|||
public virtual Task<ProductAssetDto> UpdateAsync(Guid id, UpdateProductAssetDto input) |
|||
{ |
|||
return _service.UpdateAsync(id, input); |
|||
} |
|||
|
|||
[HttpDelete] |
|||
[Route("{id}")] |
|||
public virtual Task DeleteAsync(Guid id) |
|||
{ |
|||
return _service.DeleteAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("{id}")] |
|||
public virtual Task<ProductAssetDto> GetAsync(Guid id) |
|||
{ |
|||
return _service.GetAsync(id); |
|||
} |
|||
|
|||
[HttpGet] |
|||
[Route("")] |
|||
public virtual Task<PagedResultDto<ProductAssetDto>> GetListAsync(PagedAndSortedResultRequestDto input) |
|||
{ |
|||
return _service.GetListAsync(input); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.CreateModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["CreateProductAssetCategory"].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> |
|||
@ -0,0 +1,28 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory |
|||
{ |
|||
public class CreateModalModel : BookingPageModel |
|||
{ |
|||
[BindProperty] |
|||
public CreateProductAssetCategoryViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetCategoryAppService _service; |
|||
|
|||
public CreateModalModel(IProductAssetCategoryAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<CreateProductAssetCategoryViewModel, CreateProductAssetCategoryDto>(ViewModel); |
|||
await _service.CreateAsync(dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.EditModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["EditProductAssetCategory"].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> |
|||
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory |
|||
{ |
|||
public class EditModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid Id { get; set; } |
|||
|
|||
[BindProperty] |
|||
public EditProductAssetCategoryViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetCategoryAppService _service; |
|||
|
|||
public EditModalModel(IProductAssetCategoryAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
var dto = await _service.GetAsync(Id); |
|||
ViewModel = ObjectMapper.Map<ProductAssetCategoryDto, EditProductAssetCategoryViewModel>(dto); |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<EditProductAssetCategoryViewModel, UpdateProductAssetCategoryDto>(ViewModel); |
|||
await _service.UpdateAsync(Id, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Permissions |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Menus |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["ProductAssetCategory"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:ProductAssetCategory"].Value); |
|||
PageLayout.Content.MenuItemName = BookingMenus.ProductAssetCategory; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/index.css"/> |
|||
} |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["ProductAssetCategory"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-end"> |
|||
@if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAssetCategory.Create)) |
|||
{ |
|||
<abp-button id="NewProductAssetCategoryButton" |
|||
text="@L["CreateProductAssetCategory"].Value" |
|||
icon="plus" |
|||
button-type="Primary" /> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="ProductAssetCategoryTable" class="nowrap"/> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory |
|||
{ |
|||
public class IndexModel : BookingPageModel |
|||
{ |
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels |
|||
{ |
|||
public class CreateProductAssetCategoryViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetCategoryProductId")] |
|||
public Guid ProductId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryProductSkuId")] |
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryAssetCategoryId")] |
|||
public Guid AssetCategoryId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryPeriodSchemeId")] |
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryFromTime")] |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryToTime")] |
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategory.ViewModels |
|||
{ |
|||
public class EditProductAssetCategoryViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetCategoryFromTime")] |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryToTime")] |
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPluginsBooking'); |
|||
|
|||
var service = easyAbp.eShop.plugins.booking.productAssetCategories.productAssetCategory; |
|||
var createModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/CreateModal'); |
|||
var editModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory/EditModal'); |
|||
|
|||
var dataTable = $('#ProductAssetCategoryTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[0, "asc"]], |
|||
ajax: abp.libs.datatables.createAjax(service.getList), |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('ProductAssetCategoryPeriods'), |
|||
action: function (data) { |
|||
document.location.href = abp.appPath + 'EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod?ProductAssetCategoryId=' + data.record.id; |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Edit'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAssetCategory.Update'), |
|||
action: function (data) { |
|||
editModal.open({ id: data.record.id }); |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Delete'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAssetCategory.Delete'), |
|||
confirmMessage: function (data) { |
|||
return l('ProductAssetCategoryDeletionConfirmationMessage', data.record.id); |
|||
}, |
|||
action: function (data) { |
|||
service.delete(data.record.id) |
|||
.then(function () { |
|||
abp.notify.info(l('SuccessfullyDeleted')); |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryAssetCategoryId'), |
|||
data: "assetCategoryId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryPrice'), |
|||
data: "price" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryPeriodSchemeId'), |
|||
data: "periodSchemeId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryFromTime'), |
|||
data: "fromTime" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryToTime'), |
|||
data: "toTime" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryProductId'), |
|||
data: "productId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryProductSkuId'), |
|||
data: "productSkuId" |
|||
}, |
|||
] |
|||
})); |
|||
|
|||
createModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
editModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
$('#NewProductAssetCategoryButton').click(function (e) { |
|||
e.preventDefault(); |
|||
createModal.open(); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,19 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.CreateModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["CreateProductAssetCategoryPeriod"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-input asp-for="ProductAssetCategoryId" /> |
|||
<abp-form-content /> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod |
|||
{ |
|||
public class CreateModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetCategoryId { get; set; } |
|||
|
|||
[BindProperty] |
|||
public CreateProductAssetCategoryPeriodViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetCategoryAppService _service; |
|||
|
|||
public CreateModalModel(IProductAssetCategoryAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<CreateProductAssetCategoryPeriodViewModel, CreateProductAssetCategoryPeriodDto>(ViewModel); |
|||
await _service.CreatePeriodAsync(ProductAssetCategoryId, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.EditModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["EditProductAssetCategoryPeriod"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-input asp-for="ProductAssetCategoryId" /> |
|||
<abp-input asp-for="PeriodId" /> |
|||
<abp-form-content /> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -0,0 +1,45 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod |
|||
{ |
|||
public class EditModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetCategoryId { get; set; } |
|||
|
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[BindProperty] |
|||
public EditProductAssetCategoryPeriodViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetCategoryAppService _service; |
|||
|
|||
public EditModalModel(IProductAssetCategoryAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
var dto = await _service.GetAsync(ProductAssetCategoryId); |
|||
ViewModel = ObjectMapper.Map<ProductAssetCategoryPeriodDto, EditProductAssetCategoryPeriodViewModel>( |
|||
dto.Periods.Single(x => x.PeriodId == PeriodId)); |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<EditProductAssetCategoryPeriodViewModel, UpdateProductAssetCategoryPeriodDto>(ViewModel); |
|||
await _service.UpdatePeriodAsync(ProductAssetCategoryId, PeriodId, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using EasyAbp.EShop.Plugins.Booking.Permissions |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Menus |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["ProductAssetCategoryPeriod"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:ProductAssetCategoryPeriod"].Value); |
|||
PageLayout.Content.MenuItemName = BookingMenus.ProductAssetCategory; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/index.css"/> |
|||
} |
|||
|
|||
<script> |
|||
let productAssetCategoryId = '@Model.ProductAssetCategoryId'; |
|||
</script> |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["ProductAssetCategoryPeriod"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-end"> |
|||
@if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAssetCategory.Update)) |
|||
{ |
|||
<abp-button id="NewProductAssetCategoryPeriodButton" |
|||
text="@L["CreateProductAssetCategoryPeriod"].Value" |
|||
icon="plus" |
|||
button-type="Primary"/> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="ProductAssetCategoryPeriodTable" class="nowrap"/> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod |
|||
{ |
|||
public class IndexModel : BookingPageModel |
|||
{ |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetCategoryId { get; set; } |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels |
|||
{ |
|||
public class CreateProductAssetCategoryPeriodViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetCategoryPeriodPeriodId")] |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetCategoryPeriodPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssetCategories.ProductAssetCategoryPeriod.ViewModels |
|||
{ |
|||
public class EditProductAssetCategoryPeriodViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetCategoryPeriodPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPluginsBooking'); |
|||
|
|||
var service = easyAbp.eShop.plugins.booking.productAssetCategories.productAssetCategory; |
|||
var createModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/CreateModal'); |
|||
var editModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategoryPeriod/EditModal'); |
|||
|
|||
var dataTable = $('#ProductAssetCategoryPeriodTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[0, "asc"]], |
|||
ajax: function (requestData, callback, settings) { |
|||
if (callback) { |
|||
service.get(productAssetCategoryId).then(function (result) { |
|||
callback({ |
|||
recordsTotal: result.periods.length, |
|||
recordsFiltered: result.periods.length, |
|||
data: result.periods |
|||
}); |
|||
}); |
|||
} |
|||
}, |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('Edit'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAssetCategory.Update'), |
|||
action: function (data) { |
|||
editModal.open({ productAssetCategoryId: productAssetCategoryId, periodId: data.record.periodId }); |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Delete'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAssetCategory.Update'), |
|||
confirmMessage: function (data) { |
|||
return l('ProductAssetCategoryPeriodDeletionConfirmationMessage', data.record.periodId); |
|||
}, |
|||
action: function (data) { |
|||
service.deletePeriod(productAssetCategoryId, data.record.periodId) |
|||
.then(function () { |
|||
abp.notify.info(l('SuccessfullyDeleted')); |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryPeriodPeriodId'), |
|||
data: "periodId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetCategoryPeriodPrice'), |
|||
data: "price" |
|||
}, |
|||
] |
|||
})); |
|||
|
|||
createModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
editModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
$('#NewProductAssetCategoryPeriodButton').click(function (e) { |
|||
e.preventDefault(); |
|||
createModal.open({ productAssetCategoryId: productAssetCategoryId }); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,18 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.CreateModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["CreateProductAsset"].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> |
|||
@ -0,0 +1,28 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset |
|||
{ |
|||
public class CreateModalModel : BookingPageModel |
|||
{ |
|||
[BindProperty] |
|||
public CreateProductAssetViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetAppService _service; |
|||
|
|||
public CreateModalModel(IProductAssetAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<CreateProductAssetViewModel, CreateProductAssetDto>(ViewModel); |
|||
await _service.CreateAsync(dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.EditModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["EditProductAsset"].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> |
|||
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset |
|||
{ |
|||
public class EditModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid Id { get; set; } |
|||
|
|||
[BindProperty] |
|||
public EditProductAssetViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetAppService _service; |
|||
|
|||
public EditModalModel(IProductAssetAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
var dto = await _service.GetAsync(Id); |
|||
ViewModel = ObjectMapper.Map<ProductAssetDto, EditProductAssetViewModel>(dto); |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<EditProductAssetViewModel, UpdateProductAssetDto>(ViewModel); |
|||
await _service.UpdateAsync(Id, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Permissions |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Menus |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["ProductAsset"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:ProductAsset"].Value); |
|||
PageLayout.Content.MenuItemName = BookingMenus.ProductAsset; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Plugins/Booking/ProductAssets/ProductAsset/index.css"/> |
|||
} |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["ProductAsset"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-end"> |
|||
@if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAsset.Create)) |
|||
{ |
|||
<abp-button id="NewProductAssetButton" |
|||
text="@L["CreateProductAsset"].Value" |
|||
icon="plus" |
|||
button-type="Primary" /> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="ProductAssetTable" class="nowrap"/> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset |
|||
{ |
|||
public class IndexModel : BookingPageModel |
|||
{ |
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
|
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels |
|||
{ |
|||
public class CreateProductAssetViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetProductId")] |
|||
public Guid ProductId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetProductSkuId")] |
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetAssetId")] |
|||
public Guid AssetId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetPeriodSchemeId")] |
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetFromTime")] |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetToTime")] |
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using System; |
|||
|
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAsset.ViewModels |
|||
{ |
|||
public class EditProductAssetViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetFromTime")] |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetToTime")] |
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPluginsBooking'); |
|||
|
|||
var service = easyAbp.eShop.plugins.booking.productAssets.productAsset; |
|||
var createModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssets/ProductAsset/CreateModal'); |
|||
var editModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssets/ProductAsset/EditModal'); |
|||
|
|||
var dataTable = $('#ProductAssetTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[0, "asc"]], |
|||
ajax: abp.libs.datatables.createAjax(service.getList), |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('ProductAssetPeriods'), |
|||
action: function (data) { |
|||
document.location.href = abp.appPath + 'EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod?ProductAssetId=' + data.record.id; |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Edit'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAsset.Update'), |
|||
action: function (data) { |
|||
editModal.open({ id: data.record.id }); |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Delete'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAsset.Delete'), |
|||
confirmMessage: function (data) { |
|||
return l('ProductAssetDeletionConfirmationMessage', data.record.id); |
|||
}, |
|||
action: function (data) { |
|||
service.delete(data.record.id) |
|||
.then(function () { |
|||
abp.notify.info(l('SuccessfullyDeleted')); |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
title: l('ProductAssetAssetId'), |
|||
data: "assetId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetPrice'), |
|||
data: "price" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetPeriodSchemeId'), |
|||
data: "periodSchemeId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetFromTime'), |
|||
data: "fromTime" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetToTime'), |
|||
data: "toTime" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetProductId'), |
|||
data: "productId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetProductSkuId'), |
|||
data: "productSkuId" |
|||
}, |
|||
] |
|||
})); |
|||
|
|||
createModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
editModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
$('#NewProductAssetButton').click(function (e) { |
|||
e.preventDefault(); |
|||
createModal.open(); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,19 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.CreateModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="CreateModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["CreateProductAssetPeriod"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-input asp-for="ProductAssetId" /> |
|||
<abp-form-content/> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod |
|||
{ |
|||
public class CreateModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetId { get; set; } |
|||
|
|||
[BindProperty] |
|||
public CreateProductAssetPeriodViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetAppService _service; |
|||
|
|||
public CreateModalModel(IProductAssetAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<CreateProductAssetPeriodViewModel, CreateProductAssetPeriodDto>(ViewModel); |
|||
await _service.CreatePeriodAsync(ProductAssetId, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
@page |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@model EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.EditModalModel |
|||
@{ |
|||
Layout = null; |
|||
} |
|||
<abp-dynamic-form abp-model="ViewModel" data-ajaxForm="true" asp-page="EditModal"> |
|||
<abp-modal> |
|||
<abp-modal-header title="@L["EditProductAssetPeriod"].Value"></abp-modal-header> |
|||
<abp-modal-body> |
|||
<abp-input asp-for="ProductAssetId" /> |
|||
<abp-input asp-for="PeriodId" /> |
|||
<abp-form-content /> |
|||
</abp-modal-body> |
|||
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer> |
|||
</abp-modal> |
|||
</abp-dynamic-form> |
|||
@ -0,0 +1,45 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod |
|||
{ |
|||
public class EditModalModel : BookingPageModel |
|||
{ |
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetId { get; set; } |
|||
|
|||
[HiddenInput] |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[BindProperty] |
|||
public EditProductAssetPeriodViewModel ViewModel { get; set; } |
|||
|
|||
private readonly IProductAssetAppService _service; |
|||
|
|||
public EditModalModel(IProductAssetAppService service) |
|||
{ |
|||
_service = service; |
|||
} |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
var dto = await _service.GetAsync(ProductAssetId); |
|||
ViewModel = ObjectMapper.Map<ProductAssetPeriodDto, EditProductAssetPeriodViewModel>( |
|||
dto.Periods.Single(x => x.PeriodId == PeriodId)); |
|||
} |
|||
|
|||
public virtual async Task<IActionResult> OnPostAsync() |
|||
{ |
|||
var dto = ObjectMapper.Map<EditProductAssetPeriodViewModel, UpdateProductAssetPeriodDto>(ViewModel); |
|||
await _service.UpdatePeriodAsync(ProductAssetId, PeriodId, dto); |
|||
return NoContent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
@page |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Microsoft.AspNetCore.Mvc.Localization |
|||
@using Volo.Abp.AspNetCore.Mvc.UI.Layout |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod |
|||
@using EasyAbp.EShop.Plugins.Booking.Localization |
|||
@using EasyAbp.EShop.Plugins.Booking.Permissions |
|||
@using EasyAbp.EShop.Plugins.Booking.Web.Menus |
|||
@model IndexModel |
|||
@inject IPageLayout PageLayout |
|||
@inject IHtmlLocalizer<BookingResource> L |
|||
@inject IAuthorizationService Authorization |
|||
@{ |
|||
PageLayout.Content.Title = L["ProductAssetPeriod"].Value; |
|||
PageLayout.Content.BreadCrumb.Add(L["Menu:ProductAssetPeriod"].Value); |
|||
PageLayout.Content.MenuItemName = BookingMenus.ProductAsset; |
|||
} |
|||
|
|||
@section scripts |
|||
{ |
|||
<abp-script src="/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/index.js" /> |
|||
} |
|||
@section styles |
|||
{ |
|||
<abp-style src="/Pages/EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/index.css"/> |
|||
} |
|||
|
|||
<script> |
|||
let productAssetId = '@Model.ProductAssetId'; |
|||
</script> |
|||
|
|||
<abp-card> |
|||
<abp-card-header> |
|||
<abp-row> |
|||
<abp-column size-md="_6"> |
|||
<abp-card-title>@L["ProductAssetPeriod"]</abp-card-title> |
|||
</abp-column> |
|||
<abp-column size-md="_6" class="text-end"> |
|||
@if (await Authorization.IsGrantedAsync(BookingPermissions.ProductAsset.Update)) |
|||
{ |
|||
<abp-button id="NewProductAssetPeriodButton" |
|||
text="@L["CreateProductAssetPeriod"].Value" |
|||
icon="plus" |
|||
button-type="Primary"/> |
|||
} |
|||
</abp-column> |
|||
</abp-row> |
|||
</abp-card-header> |
|||
<abp-card-body> |
|||
<abp-table striped-rows="true" id="ProductAssetPeriodTable" class="nowrap"/> |
|||
</abp-card-body> |
|||
</abp-card> |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod |
|||
{ |
|||
public class IndexModel : BookingPageModel |
|||
{ |
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid ProductAssetId { get; set; } |
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
await Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
|
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels |
|||
{ |
|||
public class CreateProductAssetPeriodViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetPeriodPeriodId")] |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Display(Name = "ProductAssetPeriodPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
|
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Web.Pages.EShop.Plugins.Booking.ProductAssets.ProductAssetPeriod.ViewModels |
|||
{ |
|||
public class EditProductAssetPeriodViewModel |
|||
{ |
|||
[Display(Name = "ProductAssetPeriodPrice")] |
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
$(function () { |
|||
|
|||
var l = abp.localization.getResource('EasyAbpEShopPluginsBooking'); |
|||
|
|||
var service = easyAbp.eShop.plugins.booking.productAssets.productAsset; |
|||
var createModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/CreateModal'); |
|||
var editModal = new abp.ModalManager(abp.appPath + 'EShop/Plugins/Booking/ProductAssets/ProductAssetPeriod/EditModal'); |
|||
|
|||
var dataTable = $('#ProductAssetPeriodTable').DataTable(abp.libs.datatables.normalizeConfiguration({ |
|||
processing: true, |
|||
serverSide: true, |
|||
paging: true, |
|||
searching: false, |
|||
autoWidth: false, |
|||
scrollCollapse: true, |
|||
order: [[0, "asc"]], |
|||
ajax: function (requestData, callback, settings) { |
|||
if (callback) { |
|||
service.get(productAssetId).then(function (result) { |
|||
callback({ |
|||
recordsTotal: result.periods.length, |
|||
recordsFiltered: result.periods.length, |
|||
data: result.periods |
|||
}); |
|||
}); |
|||
} |
|||
}, |
|||
columnDefs: [ |
|||
{ |
|||
rowAction: { |
|||
items: |
|||
[ |
|||
{ |
|||
text: l('Edit'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAsset.Update'), |
|||
action: function (data) { |
|||
editModal.open({ productAssetId: productAssetId, periodId: data.record.periodId }); |
|||
} |
|||
}, |
|||
{ |
|||
text: l('Delete'), |
|||
visible: abp.auth.isGranted('EasyAbp.EShop.Plugins.Booking.ProductAsset.Update'), |
|||
confirmMessage: function (data) { |
|||
return l('ProductAssetPeriodDeletionConfirmationMessage', data.record.periodId); |
|||
}, |
|||
action: function (data) { |
|||
service.deletePeriod(productAssetId, data.record.periodId) |
|||
.then(function () { |
|||
abp.notify.info(l('SuccessfullyDeleted')); |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
} |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
title: l('ProductAssetPeriodPeriodId'), |
|||
data: "periodId" |
|||
}, |
|||
{ |
|||
title: l('ProductAssetPeriodPrice'), |
|||
data: "price" |
|||
}, |
|||
] |
|||
})); |
|||
|
|||
createModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
editModal.onResult(function () { |
|||
dataTable.ajax.reload(); |
|||
}); |
|||
|
|||
$('#NewProductAssetPeriodButton').click(function (e) { |
|||
e.preventDefault(); |
|||
createModal.open({ productAssetId: productAssetId }); |
|||
}); |
|||
}); |
|||
@ -0,0 +1,28 @@ |
|||
using Shouldly; |
|||
using System.Threading.Tasks; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryAppServiceTests : BookingApplicationTestBase |
|||
{ |
|||
private readonly IProductAssetCategoryAppService _productAssetCategoryAppService; |
|||
|
|||
public ProductAssetCategoryAppServiceTests() |
|||
{ |
|||
_productAssetCategoryAppService = GetRequiredService<IProductAssetCategoryAppService>(); |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
// Assert
|
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
using Shouldly; |
|||
using System.Threading.Tasks; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public class ProductAssetAppServiceTests : BookingApplicationTestBase |
|||
{ |
|||
private readonly IProductAssetAppService _productAssetAppService; |
|||
|
|||
public ProductAssetAppServiceTests() |
|||
{ |
|||
_productAssetAppService = GetRequiredService<IProductAssetAppService>(); |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
// Assert
|
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryDomainTests : BookingDomainTestBase |
|||
{ |
|||
public ProductAssetCategoryDomainTests() |
|||
{ |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Assert
|
|||
|
|||
// Assert
|
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System.Threading.Tasks; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public class ProductAssetDomainTests : BookingDomainTestBase |
|||
{ |
|||
public ProductAssetDomainTests() |
|||
{ |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Assert
|
|||
|
|||
// Assert
|
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryRepositoryTests : BookingEntityFrameworkCoreTestBase |
|||
{ |
|||
private readonly IProductAssetCategoryRepository _productAssetCategoryRepository; |
|||
|
|||
public ProductAssetCategoryRepositoryTests() |
|||
{ |
|||
_productAssetCategoryRepository = GetRequiredService<IProductAssetCategoryRepository>(); |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
await WithUnitOfWorkAsync(async () => |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
//Assert
|
|||
}); |
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.ProductAssets |
|||
{ |
|||
public class ProductAssetRepositoryTests : BookingEntityFrameworkCoreTestBase |
|||
{ |
|||
private readonly IProductAssetRepository _productAssetRepository; |
|||
|
|||
public ProductAssetRepositoryTests() |
|||
{ |
|||
_productAssetRepository = GetRequiredService<IProductAssetRepository>(); |
|||
} |
|||
|
|||
/* |
|||
[Fact] |
|||
public async Task Test1() |
|||
{ |
|||
await WithUnitOfWorkAsync(async () => |
|||
{ |
|||
// Arrange
|
|||
|
|||
// Act
|
|||
|
|||
//Assert
|
|||
}); |
|||
} |
|||
*/ |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue