diff --git a/.gitignore b/.gitignore index 9e8a275..15ea7c9 100644 --- a/.gitignore +++ b/.gitignore @@ -257,4 +257,5 @@ modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/Logs/logs.txt modules/BookingService/host/EasyAbp.BookingService.Web.Host/Logs/logs.txt modules/BookingService/host/EasyAbp.BookingService.Web.Unified/Logs/logs.txt modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/Logs/logs.txt -/local \ No newline at end of file +appsettings.secrets.json +/local diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Host/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Host/Program.cs index 6f78e7a..667cfee 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Host/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Host/Program.cs @@ -3,9 +3,9 @@ namespace EasyAbp.BookingService.Blazor.Host; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/Program.cs index 88b4508..00ac08f 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService.Blazor.Server.Host; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/appsettings.secrets.json b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Blazor.Server.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/Program.cs index 0d3fac7..3816970 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/appsettings.secrets.json b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.HttpApi.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/Program.cs index eda92d9..64c977a 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/appsettings.secrets.json b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.IdentityServer/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/Program.cs index fff8621..5aca7a9 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/Program.cs @@ -11,9 +11,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/appsettings.secrets.json b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/Program.cs b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/Program.cs index 9e7b746..40ab3c7 100644 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/Program.cs +++ b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/Program.cs @@ -11,9 +11,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/appsettings.secrets.json b/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService.Orleans/host/EasyAbp.BookingService.Orleans.Web.Unified/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Host/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.Blazor.Host/Program.cs index 9bc044d..32af46c 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Host/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.Blazor.Host/Program.cs @@ -3,9 +3,9 @@ namespace EasyAbp.BookingService.Blazor.Host; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); @@ -20,4 +20,4 @@ public async static Task Main(string[] args) await host.RunAsync(); } -} +} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/Program.cs index 3ca0e0f..06d6336 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService.Blazor.Server.Host; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG @@ -50,4 +50,4 @@ public async static Task Main(string[] args) Log.CloseAndFlush(); } } -} +} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/appsettings.secrets.json b/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService/host/EasyAbp.BookingService.Blazor.Server.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/Program.cs index 8d55ce2..72dbb2d 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/appsettings.secrets.json b/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService/host/EasyAbp.BookingService.HttpApi.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/Program.cs index 8488cfb..e150803 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/Program.cs @@ -8,9 +8,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG @@ -50,4 +50,4 @@ public async static Task Main(string[] args) Log.CloseAndFlush(); } } -} +} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/appsettings.secrets.json b/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService/host/EasyAbp.BookingService.IdentityServer/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Web.Host/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.Web.Host/Program.cs index daa89fb..11b08a2 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.Web.Host/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.Web.Host/Program.cs @@ -11,9 +11,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG diff --git a/modules/BookingService/host/EasyAbp.BookingService.Web.Host/appsettings.secrets.json b/modules/BookingService/host/EasyAbp.BookingService.Web.Host/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService/host/EasyAbp.BookingService.Web.Host/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/Program.cs b/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/Program.cs index a76eac0..4a732f2 100644 --- a/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/Program.cs +++ b/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/Program.cs @@ -11,9 +11,9 @@ namespace EasyAbp.BookingService; -public class Program +public static class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { Log.Logger = new LoggerConfiguration() #if DEBUG @@ -53,4 +53,4 @@ public async static Task Main(string[] args) Log.CloseAndFlush(); } } -} +} \ No newline at end of file diff --git a/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/appsettings.secrets.json b/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/appsettings.secrets.json deleted file mode 100644 index 7a73a41..0000000 --- a/modules/BookingService/host/EasyAbp.BookingService.Web.Unified/appsettings.secrets.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/modules/BookingService/src/EasyAbp.BookingService.Web/Menus/BookingServiceMenuContributor.cs b/modules/BookingService/src/EasyAbp.BookingService.Web/Menus/BookingServiceMenuContributor.cs index 45b8e4b..1e609dd 100644 --- a/modules/BookingService/src/EasyAbp.BookingService.Web/Menus/BookingServiceMenuContributor.cs +++ b/modules/BookingService/src/EasyAbp.BookingService.Web/Menus/BookingServiceMenuContributor.cs @@ -1,4 +1,6 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.BookingService.Localization; using Volo.Abp.UI.Navigation; namespace EasyAbp.BookingService.Web.Menus; @@ -16,8 +18,13 @@ public async Task ConfigureMenuAsync(MenuConfigurationContext context) private Task ConfigureMainMenuAsync(MenuConfigurationContext context) { //Add main menu items. - context.Menu.AddItem(new ApplicationMenuItem(BookingServiceMenus.Prefix, displayName: "BookingService", "~/BookingService", icon: "fa fa-globe")); + // context.Menu.AddItem(new ApplicationMenuItem(BookingServiceMenus.Prefix, displayName: "BookingService", "~/BookingService", icon: "fa fa-globe")); + + var l = context.GetLocalizer(); //Add main menu items. + + var bookingServiceMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == BookingServiceCommonMenus.Prefix, + () => new ApplicationMenuItem(BookingServiceCommonMenus.Prefix, l["Menu:BookingService"])); return Task.CompletedTask; } -} +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/en.json b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/en.json index 90c06e1..bb5548e 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/en.json +++ b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/en.json @@ -15,6 +15,97 @@ "EasyAbp.BookingService:CannotUpdatePeriodInUse": "Can not update Period which is in use. PeriodId: {id}", "EasyAbp.BookingService:CannotDeletePeriodSchemeInUse": "Can not delete PeriodScheme which is in use. PeriodScheme: {name}, Id: {id}. ", "EasyAbp.BookingService:FailToObtainAssetOccupancyLock": "Fail to obtain asset occupancy lock", - "EasyAbp.BookingService:InvalidOccupyingVolume": "Negative occupying volume: {volume}" + "EasyAbp.BookingService:InvalidOccupyingVolume": "Negative occupying volume: {volume}", + "Menu:BookingService": "BookingService", + "Menu:AssetCategory": "AssetCategory", + "Permission:PeriodScheme": "PeriodScheme", + "Permission:AssetSchedule": "AssetSchedule", + "Permission:Asset": "Asset", + "Permission:AssetPeriodScheme": "AssetPeriodScheme", + "Menu:AssetOccupancy": "AssetOccupancy", + "Menu:AssetPeriodScheme": "AssetPeriodScheme", + "Menu:Asset": "Asset", + "Menu:AssetSchedule": "AssetSchedule", + "Menu:PeriodScheme": "PeriodScheme", + "Menu:Period": "Period", + "Permission:AssetCategory": "AssetCategory", + "Permission:AssetOccupancy": "AssetOccupancy", + "AssetCategory": "AssetCategory", + "AssetCategoryAssetDefinitionName": "AssetDefinitionName", + "AssetCategoryPeriodSchemeId": "PeriodSchemeId", + "AssetCategoryDefaultPeriodUsable": "DefaultPeriodUsable", + "AssetCategoryTimeInAdvance": "TimeInAdvance", + "AssetCategoryDisabled": "Disabled", + "AssetCategoryCode": "Code", + "AssetCategoryLevel": "Level", + "AssetCategoryParentId": "ParentId", + "AssetCategoryDisplayName": "DisplayName", + "CreateAssetCategory": "CreateAssetCategory", + "EditAssetCategory": "EditAssetCategory", + "AssetCategoryDeletionConfirmationMessage": "Are you sure to delete the assetCategory {0}?", + "SuccessfullyDeleted": "Successfully deleted", + "AssetOccupancy": "AssetOccupancy", + "AssetOccupancyAssetId": "AssetId", + "AssetOccupancyAssetDefinitionName": "AssetDefinitionName", + "AssetOccupancyVolume": "Volume", + "AssetOccupancyDate": "Date", + "AssetOccupancyStartingTime": "StartingTime", + "AssetOccupancyDuration": "Duration", + "AssetOccupancyOccupierUserId": "OccupierUserId", + "AssetOccupancyOccupierName": "OccupierName", + "CreateAssetOccupancy": "CreateAssetOccupancy", + "AssetOccupancyDeletionConfirmationMessage": "Are you sure to delete the assetOccupancy {0}?", + "AssetPeriodScheme": "AssetPeriodScheme", + "AssetPeriodSchemePeriodSchemeId": "PeriodSchemeId", + "AssetPeriodSchemeAssetId": "AssetId", + "AssetPeriodSchemeDate": "Date", + "CreateAssetPeriodScheme": "CreateAssetPeriodScheme", + "EditAssetPeriodScheme": "EditAssetPeriodScheme", + "AssetPeriodSchemeDeletionConfirmationMessage": "Are you sure to delete the assetPeriodScheme {0}?", + "Asset": "Asset", + "AssetName": "AssetName", + "AssetAssetDefinitionName": "AssetDefinitionName", + "AssetAssetCategoryId": "AssetCategoryId", + "AssetPeriodSchemeId": "PeriodSchemeId", + "AssetDefaultPeriodUsable": "DefaultPeriodUsable", + "AssetVolume": "Volume", + "AssetPriority": "Priority", + "AssetTimeInAdvance": "TimeInAdvance", + "AssetDisabled": "Disabled", + "CreateAsset": "CreateAsset", + "EditAsset": "EditAsset", + "AssetDeletionConfirmationMessage": "Are you sure to delete the asset {0}?", + "AssetSchedule": "AssetSchedule", + "AssetScheduleDate": "Date", + "AssetScheduleAssetId": "AssetId", + "AssetSchedulePeriodSchemeId": "PeriodSchemeId", + "AssetSchedulePeriodId": "PeriodId", + "AssetSchedulePeriodUsable": "PeriodUsable", + "AssetScheduleTimeInAdvance": "TimeInAdvance", + "CreateAssetSchedule": "CreateAssetSchedule", + "EditAssetSchedule": "EditAssetSchedule", + "AssetScheduleDeletionConfirmationMessage": "Are you sure to delete the assetSchedule {0}?", + "PeriodScheme": "PeriodScheme", + "PeriodSchemeName": "PeriodSchemeName", + "PeriodSchemeIsDefault": "IsDefault", + "PeriodSchemePeriods": "Periods", + "CreatePeriodScheme": "CreatePeriodScheme", + "EditPeriodScheme": "EditPeriodScheme", + "PeriodSchemeDeletionConfirmationMessage": "Are you sure to delete the periodScheme {0}?", + "TimeInAdvanceMaxDaysInAdvance": "TimeInAdvanceMaxDaysInAdvance", + "TimeInAdvanceMaxTimespanInAdvance": "TimeInAdvanceMaxTimespanInAdvance", + "TimeInAdvanceMinDaysInAdvance": "TimeInAdvanceMinDaysInAdvance", + "TimeInAdvanceMinTimespanInAdvance": "TimeInAdvanceMinTimespanInAdvance", + "Enum:PeriodUsable:0": "Accept", + "Enum:PeriodUsable:1": "Reject", + "PeriodStartingTime": "PeriodStartingTime", + "PeriodDuration": "PeriodDuration", + "CreatePeriod": "CreatePeriod", + "EditPeriod": "EditPeriod", + "Period": "Period", + "PeriodDeletionConfirmationMessage": "Are you sure to delete the period {0}?", + "PeriodSchemeSetAsDefaultConfirmationMessage": "Are you sure to set this period scheme as default {0}?", + "SuccessfullyEdited": "Successfully edited", + "SetAsDefault": "Set as default" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hans.json b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hans.json index adcedd9..bafba2b 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hans.json +++ b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hans.json @@ -15,6 +15,97 @@ "EasyAbp.BookingService:CannotUpdatePeriodInUse": "不能更新正在使用的时段。时段Id:{id}", "EasyAbp.BookingService:CannotDeletePeriodSchemeInUse": "不能删除正在使用的时段方案:{name}, Id:{id}. ", "EasyAbp.BookingService:FailToObtainAssetOccupancyLock": "获取资产占用锁失败", - "EasyAbp.BookingService:InvalidOccupyingVolume": "占用容量必须大于0: {volume}" + "EasyAbp.BookingService:InvalidOccupyingVolume": "占用容量必须大于0: {volume}", + "Menu:BookingService": "预订服务", + "Menu:AssetCategory": "资产目录", + "Permission:PeriodScheme": "时段方案", + "Permission:AssetSchedule": "资产排期", + "Permission:Asset": "资产", + "Permission:AssetPeriodScheme": "资产时段方案", + "Menu:AssetOccupancy": "资产占用", + "Menu:AssetPeriodScheme": "资产时段方案", + "Menu:Asset": "资产", + "Menu:AssetSchedule": "资产排期", + "Menu:PeriodScheme": "时段方案", + "Permission:AssetCategory": "资产目录", + "Permission:AssetOccupancy": "资产占用", + "AssetCategory": "资产目录", + "AssetCategoryAssetDefinitionName": "资产定义", + "AssetCategoryPeriodSchemeId": "时段方案Id", + "AssetCategoryDefaultPeriodUsable": "默认时段可预定", + "AssetCategoryTimeInAdvance": "提前预订时间", + "AssetCategoryDisabled": "已禁用", + "AssetCategoryCode": "代码", + "AssetCategoryLevel": "级别", + "AssetCategoryParentId": "父级Id", + "AssetCategoryDisplayName": "名称", + "CreateAssetCategory": "创建资产目录", + "EditAssetCategory": "编辑资产目录", + "AssetCategoryDeletionConfirmationMessage": "确定删除资产吗 {0}?", + "SuccessfullyDeleted": "已成功删除", + "AssetOccupancy": "资产占用", + "AssetOccupancyAssetId": "资产Id", + "AssetOccupancyAssetDefinitionName": "资产定义", + "AssetOccupancyVolume": "占用量", + "AssetOccupancyDate": "占用日期", + "AssetOccupancyStartingTime": "占用开始时间", + "AssetOccupancyDuration": "占用时长", + "AssetOccupancyOccupierUserId": "占用人Id", + "AssetOccupancyOccupierName": "占用人名称", + "CreateAssetOccupancy": "创建资产占用", + "AssetOccupancyDeletionConfirmationMessage": "确定删除资产占用吗 {0}?", + "AssetPeriodScheme": "资产时段方案", + "AssetPeriodSchemePeriodSchemeId": "时段方案Id", + "AssetPeriodSchemeAssetId": "资产Id", + "AssetPeriodSchemeDate": "日期", + "CreateAssetPeriodScheme": "创建资产时段方案", + "EditAssetPeriodScheme": "编辑资产时段方案", + "AssetPeriodSchemeDeletionConfirmationMessage": "确定删除资产时段方案吗 {0}?", + "Asset": "资产", + "AssetName": "名称", + "AssetAssetDefinitionName": "资产定义", + "AssetAssetCategoryId": "所属资产目录Id", + "AssetPeriodSchemeId": "时段方案Id", + "AssetDefaultPeriodUsable": "默认时段可预定", + "AssetVolume": "资产总容量", + "AssetPriority": "资产优先级", + "AssetTimeInAdvance": "提前预订时间", + "AssetDisabled": "已禁用", + "CreateAsset": "创建资产", + "EditAsset": "编辑资产", + "AssetDeletionConfirmationMessage": "确定删除资产吗 {0}?", + "AssetSchedule": "资产排期", + "AssetScheduleDate": "日期", + "AssetScheduleAssetId": "资产Id", + "AssetSchedulePeriodSchemeId": "时段方案Id", + "AssetSchedulePeriodId": "时段Id", + "AssetSchedulePeriodUsable": "时段可预定", + "AssetScheduleTimeInAdvance": "提前预定时间", + "CreateAssetSchedule": "创建资产排期", + "EditAssetSchedule": "编辑资产排期", + "AssetScheduleDeletionConfirmationMessage": "确定删除资产排期吗 {0}?", + "PeriodScheme": "时段方案", + "PeriodSchemeName": "名称", + "PeriodSchemeIsDefault": "默认", + "PeriodSchemePeriods": "时段", + "CreatePeriodScheme": "创建时段方案", + "EditPeriodScheme": "编辑时段方案", + "PeriodSchemeDeletionConfirmationMessage": "确定删除时段方案吗 {0}?", + "TimeInAdvanceMaxDaysInAdvance": "提前预定天数上限", + "TimeInAdvanceMaxTimespanInAdvance": "提前预定时间上限", + "TimeInAdvanceMinDaysInAdvance": "提前预定天数下限", + "TimeInAdvanceMinTimespanInAdvance": "提前预定时间下限", + "Enum:PeriodUsable:0": "可预定", + "Enum:PeriodUsable:1": "不可预定", + "PeriodStartingTime": "起始时间", + "PeriodDuration": "持续时间", + "CreatePeriod": "创建时段", + "EditPeriod": "编辑时段", + "Period": "时段", + "Menu:Period": "时段", + "PeriodDeletionConfirmationMessage": "确定删除时段吗 {0}?", + "PeriodSchemeSetAsDefaultConfirmationMessage": "确定设置此时段方案为默认方案吗 {0}?", + "SuccessfullyEdited": "编辑成功", + "SetAsDefault": "设为默认方案" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hant.json b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hant.json index 6b7400e..ae35d8a 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hant.json +++ b/modules/Common/src/EasyAbp.BookingService.Common.Domain.Shared/EasyAbp/BookingService/Localization/zh-Hant.json @@ -2,19 +2,110 @@ "culture": "zh-Hant", "texts": { "EasyAbp.BookingService:AssetDefinitionNotExists": "資產定義不存在:{assetDefinitionName}", - "EasyAbp.BookingService:AssetDefinitionNameNotMatch": "資產定義必須與所屬類型的定義保持一直,當前資產定義: {assetDefinitionName},所屬類型資產定義:{categoryAssetDefinitionName}", + "EasyAbp.BookingService:AssetDefinitionNameNotMatch": "資產定義必須與所屬型別的定義保持一直,當前資產定義: {assetDefinitionName},所屬型別資產定義:{categoryAssetDefinitionName}", "EasyAbp.BookingService:AssetNotExists": "找不到資產:{assetId}", "EasyAbp.BookingService:AssetScheduleExists": "已存在相同時間範圍的排期, 日期: {date}, 資產: {assetId}, 時段方案: {periodSchemeId}, 時段: {periodId}, 策略: {periodUsable}", "EasyAbp.BookingService:AssetDisabled": "資產已被禁用: {assetId}", - "EasyAbp.BookingService:DefaultPeriodSchemeAlreadyExists": "已存在默認時段方案,請先將其設為非默認,再重新操作", + "EasyAbp.BookingService:DefaultPeriodSchemeAlreadyExists": "已存在預設時段方案,請先將其設為非預設,再重新操作", "EasyAbp.BookingService:InsufficientAssetVolume": "由於資產剩餘容量不足而佔用失敗", "EasyAbp.BookingService:DisabledAssetOrCategory": "禁用的資產或資產目錄", - "EasyAbp.BookingService:DefaultPeriodSchemeNotFound": "默認時段不存在", + "EasyAbp.BookingService:DefaultPeriodSchemeNotFound": "預設時段不存在", "EasyAbp.BookingService:UnexpectedNegativeVolume": "資產佔用計數(資產:{assetId}, 日期:{date}, 開始時間:{startingTime}, 持續時間:{duration})的volume({volume},{changedVolume})不能小於0", "EasyAbp.BookingService:CannotDeletePeriodInUse": "不能刪除正在使用的時段。時段Id:{id}", "EasyAbp.BookingService:CannotUpdatePeriodInUse": "不能更新正在使用的時段。時段Id:{id}", "EasyAbp.BookingService:CannotDeletePeriodSchemeInUse": "不能刪除正在使用的時段方案:{name}, Id:{id}. ", "EasyAbp.BookingService:FailToObtainAssetOccupancyLock": "獲取資產佔用鎖失敗", - "EasyAbp.BookingService:InvalidOccupyingVolume": "佔用容量必須大於0: {volume}" + "EasyAbp.BookingService:InvalidOccupyingVolume": "佔用容量必須大於0: {volume}", + "Menu:BookingService": "預訂服務", + "Menu:AssetCategory": "資產目錄", + "Permission:PeriodScheme": "時段方案", + "Permission:AssetSchedule": "資產排期", + "Permission:Asset": "資產", + "Permission:AssetPeriodScheme": "資產時段方案", + "Menu:AssetOccupancy": "資產佔用", + "Menu:AssetPeriodScheme": "資產時段方案", + "Menu:Asset": "資產", + "Menu:AssetSchedule": "資產排期", + "Menu:PeriodScheme": "時段方案", + "Permission:AssetCategory": "資產目錄", + "Permission:AssetOccupancy": "資產佔用", + "AssetCategory": "資產目錄", + "AssetCategoryAssetDefinitionName": "資產定義", + "AssetCategoryPeriodSchemeId": "時段方案Id", + "AssetCategoryDefaultPeriodUsable": "預設時段可預定", + "AssetCategoryTimeInAdvance": "提前預訂時間", + "AssetCategoryDisabled": "已禁用", + "AssetCategoryCode": "程式碼", + "AssetCategoryLevel": "級別", + "AssetCategoryParentId": "父級Id", + "AssetCategoryDisplayName": "名稱", + "CreateAssetCategory": "建立資產目錄", + "EditAssetCategory": "編輯資產目錄", + "AssetCategoryDeletionConfirmationMessage": "確定刪除資產嗎 {0}?", + "SuccessfullyDeleted": "已成功刪除", + "AssetOccupancy": "資產佔用", + "AssetOccupancyAssetId": "資產Id", + "AssetOccupancyAssetDefinitionName": "資產定義", + "AssetOccupancyVolume": "佔用量", + "AssetOccupancyDate": "佔用日期", + "AssetOccupancyStartingTime": "佔用開始時間", + "AssetOccupancyDuration": "佔用時長", + "AssetOccupancyOccupierUserId": "佔用人Id", + "AssetOccupancyOccupierName": "佔用人名稱", + "CreateAssetOccupancy": "建立資產佔用", + "AssetOccupancyDeletionConfirmationMessage": "確定刪除資產佔用嗎 {0}?", + "AssetPeriodScheme": "資產時段方案", + "AssetPeriodSchemePeriodSchemeId": "時段方案Id", + "AssetPeriodSchemeAssetId": "資產Id", + "AssetPeriodSchemeDate": "日期", + "CreateAssetPeriodScheme": "建立資產時段方案", + "EditAssetPeriodScheme": "編輯資產時段方案", + "AssetPeriodSchemeDeletionConfirmationMessage": "確定刪除資產時段方案嗎 {0}?", + "Asset": "資產", + "AssetName": "名稱", + "AssetAssetDefinitionName": "資產定義", + "AssetAssetCategoryId": "所屬資產目錄Id", + "AssetPeriodSchemeId": "時段方案Id", + "AssetDefaultPeriodUsable": "預設時段可預定", + "AssetVolume": "資產總容量", + "AssetPriority": "資產優先順序", + "AssetTimeInAdvance": "提前預訂時間", + "AssetDisabled": "已禁用", + "CreateAsset": "建立資產", + "EditAsset": "編輯資產", + "AssetDeletionConfirmationMessage": "確定刪除資產嗎 {0}?", + "AssetSchedule": "資產排期", + "AssetScheduleDate": "日期", + "AssetScheduleAssetId": "資產Id", + "AssetSchedulePeriodSchemeId": "時段方案Id", + "AssetSchedulePeriodId": "時段Id", + "AssetSchedulePeriodUsable": "時段可預定", + "AssetScheduleTimeInAdvance": "提前預定時間", + "CreateAssetSchedule": "建立資產排期", + "EditAssetSchedule": "編輯資產排期", + "AssetScheduleDeletionConfirmationMessage": "確定刪除資產排期嗎 {0}?", + "PeriodScheme": "時段方案", + "PeriodSchemeName": "名稱", + "PeriodSchemeIsDefault": "預設", + "PeriodSchemePeriods": "時段", + "CreatePeriodScheme": "建立時段方案", + "EditPeriodScheme": "編輯時段方案", + "PeriodSchemeDeletionConfirmationMessage": "確定刪除時段方案嗎 {0}?", + "TimeInAdvanceMaxDaysInAdvance": "提前預定天數上限", + "TimeInAdvanceMaxTimespanInAdvance": "提前預定時間上限", + "TimeInAdvanceMinDaysInAdvance": "提前預定天數下限", + "TimeInAdvanceMinTimespanInAdvance": "提前預定時間下限", + "Enum:PeriodUsable:0": "可預定", + "Enum:PeriodUsable:1": "不可預定", + "PeriodStartingTime": "起始時間", + "PeriodDuration": "持續時間", + "CreatePeriod": "建立時段", + "EditPeriod": "編輯時段", + "Period": "時段", + "Menu:Period": "時段", + "PeriodDeletionConfirmationMessage": "確定刪除時段嗎 {0}?", + "PeriodSchemeSetAsDefaultConfirmationMessage": "確定設定此時段方案為預設方案嗎 {0}?", + "SuccessfullyEdited": "編輯成功", + "SetAsDefault": "設為預設方案" } } \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebAutoMapperProfile.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebAutoMapperProfile.cs index 5121a77..58f6d8c 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebAutoMapperProfile.cs +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebAutoMapperProfile.cs @@ -1,4 +1,19 @@ -using AutoMapper; +using EasyAbp.BookingService.AssetCategories.Dtos; +using EasyAbp.BookingService.AssetOccupancies.Dtos; +using EasyAbp.BookingService.AssetPeriodSchemes.Dtos; +using EasyAbp.BookingService.Assets.Dtos; +using EasyAbp.BookingService.AssetSchedules.Dtos; +using EasyAbp.BookingService.PeriodSchemes.Dtos; +using AutoMapper; +using EasyAbp.BookingService.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.ViewModels; +using EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; namespace EasyAbp.BookingService.Web; @@ -9,5 +24,29 @@ public BookingServiceCommonWebAutoMapperProfile() /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(MemberList.Destination); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + CreateMap(); } -} +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebModule.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebModule.cs index b9059f7..8cd3f51 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebModule.cs +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/BookingServiceCommonWebModule.cs @@ -1,10 +1,12 @@ using EasyAbp.BookingService.Localization; +using EasyAbp.BookingService.Web.Menus; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; namespace EasyAbp.BookingService.Web; @@ -32,6 +34,11 @@ public override void PreConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + options.MenuContributors.Add(new BookingServiceCommonMenuContributor()); + }); + Configure(options => { options.FileSets.AddEmbedded(); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/EasyAbp.BookingService.Common.Web.csproj b/modules/Common/src/EasyAbp.BookingService.Common.Web/EasyAbp.BookingService.Common.Web.csproj index 4fa0ffe..c31c467 100644 --- a/modules/Common/src/EasyAbp.BookingService.Common.Web/EasyAbp.BookingService.Common.Web.csproj +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/EasyAbp.BookingService.Common.Web.csproj @@ -37,4 +37,13 @@ + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenuContributor.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenuContributor.cs new file mode 100644 index 0000000..7987c9c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenuContributor.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using EasyAbp.BookingService.Localization; +using EasyAbp.BookingService.Permissions; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.BookingService.Web.Menus; + +public class BookingServiceCommonMenuContributor : IMenuContributor +{ + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenuAsync(context); + } + } + + private async Task ConfigureMainMenuAsync(MenuConfigurationContext context) + { + var l = context.GetLocalizer(); //Add main menu items. + + var bookingServiceMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == BookingServiceCommonMenus.Prefix, + () => new ApplicationMenuItem(BookingServiceCommonMenus.Prefix, l["Menu:BookingService"])); + + if (await context.IsGrantedAsync(BookingServicePermissions.AssetCategory.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.AssetCategory, l["Menu:AssetCategory"], + "/BookingService/AssetCategories/AssetCategory") + ); + } + + if (await context.IsGrantedAsync(BookingServicePermissions.AssetOccupancy.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.AssetOccupancy, l["Menu:AssetOccupancy"], + "/BookingService/AssetOccupancies/AssetOccupancy") + ); + } + + if (await context.IsGrantedAsync(BookingServicePermissions.AssetPeriodScheme.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.AssetPeriodScheme, l["Menu:AssetPeriodScheme"], + "/BookingService/AssetPeriodSchemes/AssetPeriodScheme") + ); + } + + if (await context.IsGrantedAsync(BookingServicePermissions.Asset.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.Asset, l["Menu:Asset"], + "/BookingService/Assets/Asset") + ); + } + + if (await context.IsGrantedAsync(BookingServicePermissions.AssetSchedule.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.AssetSchedule, l["Menu:AssetSchedule"], + "/BookingService/AssetSchedules/AssetSchedule") + ); + } + + if (await context.IsGrantedAsync(BookingServicePermissions.PeriodScheme.Default)) + { + bookingServiceMenuItem.AddItem( + new ApplicationMenuItem(BookingServiceCommonMenus.PeriodScheme, l["Menu:PeriodScheme"], + "/BookingService/PeriodSchemes/PeriodScheme") + ); + } + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenus.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenus.cs new file mode 100644 index 0000000..424a390 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Menus/BookingServiceCommonMenus.cs @@ -0,0 +1,21 @@ +namespace EasyAbp.BookingService.Web.Menus; + +public static class BookingServiceCommonMenus +{ + public const string Prefix = "EasyAbp.BookingService.Common"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + public const string AssetCategory = Prefix + ".AssetCategory"; + + public const string AssetOccupancy = Prefix + ".AssetOccupancy"; + + public const string AssetPeriodScheme = Prefix + ".AssetPeriodScheme"; + + public const string Asset = Prefix + ".Asset"; + + public const string AssetSchedule = Prefix + ".AssetSchedule"; + + public const string PeriodScheme = Prefix + ".PeriodScheme"; +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml new file mode 100644 index 0000000..e9b2f3c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml @@ -0,0 +1,19 @@ +@page +@inject IHtmlLocalizer L +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml.cs new file mode 100644 index 0000000..8534f6a --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetCategories; +using EasyAbp.BookingService.AssetCategories.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateAssetCategoryViewModel ViewModel { get; set; } + + private readonly IAssetCategoryAppService _service; + + public CreateModalModel(IAssetCategoryAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml new file mode 100644 index 0000000..e41f6a9 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml @@ -0,0 +1,20 @@ +@page +@inject IHtmlLocalizer L +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml.cs new file mode 100644 index 0000000..1331312 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/EditModal.cshtml.cs @@ -0,0 +1,38 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetCategories; +using EasyAbp.BookingService.AssetCategories.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public EditAssetCategoryViewModel ViewModel { get; set; } + + private readonly IAssetCategoryAppService _service; + + public EditModalModel(IAssetCategoryAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml new file mode 100644 index 0000000..f8b5a8e --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService AuthorizationService +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["AssetCategory"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:AssetCategory"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.AssetCategory; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["AssetCategory"] + + + @if (await AuthorizationService.IsGrantedAsync(BookingServicePermissions.AssetCategory.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml.cs new file mode 100644 index 0000000..8baf560 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/CreateAssetCategoryViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/CreateAssetCategoryViewModel.cs new file mode 100644 index 0000000..ef1ef1e --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/CreateAssetCategoryViewModel.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.ViewModels; + +public class CreateAssetCategoryViewModel : EditAssetCategoryViewModel +{ + [Display(Name = "AssetCategoryAssetDefinitionName")] + public string AssetDefinitionName { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/EditAssetCategoryViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/EditAssetCategoryViewModel.cs new file mode 100644 index 0000000..a0d9781 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/ViewModels/EditAssetCategoryViewModel.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; +using JetBrains.Annotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetCategories.AssetCategory.ViewModels; + +public class EditAssetCategoryViewModel : ExtensibleObject +{ + [Display(Name = "AssetCategoryPeriodSchemeId")] + public Guid? PeriodSchemeId { get; set; } + + [Display(Name = "AssetCategoryDefaultPeriodUsable")] + public PeriodUsable? DefaultPeriodUsable { get; set; } + + [Display(Name = "AssetCategoryTimeInAdvance")] + [CanBeNull] + public TimeInAdvanceViewModel TimeInAdvance { get; set; } + + [Display(Name = "AssetCategoryDisabled")] + public bool Disabled { get; set; } + + [Display(Name = "AssetCategoryParentId")] + public Guid? ParentId { get; set; } + + [Display(Name = "AssetCategoryDisplayName")] + public string DisplayName { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/index.js new file mode 100644 index 0000000..5246195 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetCategories/AssetCategory/index.js @@ -0,0 +1,98 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.assetCategories.assetCategory; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetCategories/AssetCategory/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetCategories/AssetCategory/EditModal'); + + var dataTable = $('#AssetCategoryTable').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('Edit'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetCategory.Update'), + action: function (data) { + editModal.open({id: data.record.id}); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetCategory.Update'), + confirmMessage: function (data) { + return l('AssetCategoryDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('AssetCategoryAssetDefinitionName'), + data: "assetDefinitionName" + }, + { + title: l('AssetCategoryPeriodSchemeId'), + data: "periodSchemeId" + }, + { + title: l('AssetCategoryDefaultPeriodUsable'), + data: "defaultPeriodUsable" + }, + { + title: l('AssetCategoryTimeInAdvance'), + data: "timeInAdvance" + }, + { + title: l('AssetCategoryDisabled'), + data: "disabled" + }, + { + title: l('AssetCategoryCode'), + data: "code" + }, + { + title: l('AssetCategoryLevel'), + data: "level" + }, + { + title: l('AssetCategoryParentId'), + data: "parentId" + }, + { + title: l('AssetCategoryDisplayName'), + data: "displayName" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewAssetCategoryButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml new file mode 100644 index 0000000..48ea3e8 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml.cs new file mode 100644 index 0000000..0e841bc --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetOccupancies; +using EasyAbp.BookingService.AssetOccupancies.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateAssetOccupancyViewModel ViewModel { get; set; } + + private readonly IAssetOccupancyAppService _service; + + public CreateModalModel(IAssetOccupancyAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml new file mode 100644 index 0000000..c6b938f --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService AuthorizationService +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["AssetOccupancy"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:AssetOccupancy"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.AssetOccupancy; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["AssetOccupancy"] + + + @if (await AuthorizationService.IsGrantedAsync(BookingServicePermissions.AssetOccupancy.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml.cs new file mode 100644 index 0000000..56ec54b --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/ViewModels/CreateEditAssetOccupancyViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/ViewModels/CreateEditAssetOccupancyViewModel.cs new file mode 100644 index 0000000..849bdcd --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/ViewModels/CreateEditAssetOccupancyViewModel.cs @@ -0,0 +1,26 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetOccupancies.AssetOccupancy.ViewModels; + +public class CreateAssetOccupancyViewModel : ExtensibleObject +{ + [Display(Name = "AssetOccupancyAssetId")] + public Guid AssetId { get; set; } + + [Display(Name = "AssetOccupancyVolume")] + public int Volume { get; set; } + + [Display(Name = "AssetOccupancyDate")] + public DateTime Date { get; set; } + + [Display(Name = "AssetOccupancyStartingTime")] + public TimeSpan StartingTime { get; set; } + + [Display(Name = "AssetOccupancyDuration")] + public TimeSpan Duration { get; set; } + + [Display(Name = "AssetOccupancyOccupierUserId")] + public Guid? OccupierUserId { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/index.js new file mode 100644 index 0000000..9768e7f --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetOccupancies/AssetOccupancy/index.js @@ -0,0 +1,90 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.assetOccupancies.assetOccupancy; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetOccupancies/AssetOccupancy/CreateModal'); + + var dataTable = $('#AssetOccupancyTable').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('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetOccupancy.Update'), + confirmMessage: function (data) { + return l('AssetOccupancyDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('AssetOccupancyAssetId'), + data: "assetId" + }, + { + title: l('AssetOccupancyAsset'), + data: "asset" + }, + { + title: l('AssetOccupancyAssetDefinitionName'), + data: "assetDefinitionName" + }, + { + title: l('AssetOccupancyVolume'), + data: "volume" + }, + { + title: l('AssetOccupancyDate'), + data: "date" + }, + { + title: l('AssetOccupancyStartingTime'), + data: "startingTime" + }, + { + title: l('AssetOccupancyDuration'), + data: "duration" + }, + { + title: l('AssetOccupancyOccupierUserId'), + data: "occupierUserId" + }, + { + title: l('AssetOccupancyOccupierName'), + data: "occupierName" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewAssetOccupancyButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml new file mode 100644 index 0000000..914ed0c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml.cs new file mode 100644 index 0000000..451ddf5 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetPeriodSchemes; +using EasyAbp.BookingService.AssetPeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateAssetPeriodSchemeViewModel ViewModel { get; set; } + + private readonly IAssetPeriodSchemeAppService _service; + + public CreateModalModel(IAssetPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml new file mode 100644 index 0000000..2950b55 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml @@ -0,0 +1,20 @@ +@page +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml.cs new file mode 100644 index 0000000..cb9f54c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal.cshtml.cs @@ -0,0 +1,37 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetPeriodSchemes; +using EasyAbp.BookingService.AssetPeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public AssetPeriodSchemeKey Id { get; set; } + + [BindProperty] + public EditAssetPeriodSchemeViewModel ViewModel { get; set; } + + private readonly IAssetPeriodSchemeAppService _service; + + public EditModalModel(IAssetPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml new file mode 100644 index 0000000..c6d220a --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService AuthorizationService +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["AssetPeriodScheme"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:AssetPeriodScheme"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.AssetPeriodScheme; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["AssetPeriodScheme"] + + + @if (await AuthorizationService.IsGrantedAsync(BookingServicePermissions.AssetPeriodScheme.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml.cs new file mode 100644 index 0000000..c04135c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/CreateAssetPeriodSchemeViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/CreateAssetPeriodSchemeViewModel.cs new file mode 100644 index 0000000..43b45c8 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/CreateAssetPeriodSchemeViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.ViewModels; + +public class CreateAssetPeriodSchemeViewModel : ExtensibleObject +{ + [Display(Name = "AssetPeriodSchemePeriodSchemeId")] + public Guid PeriodSchemeId { get; set; } + + [Display(Name = "AssetPeriodSchemeAssetId")] + public Guid AssetId { get; set; } + + [Display(Name = "AssetPeriodSchemeDate")] + public DateTime Date { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/EditAssetPeriodSchemeViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/EditAssetPeriodSchemeViewModel.cs new file mode 100644 index 0000000..ba99300 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/ViewModels/EditAssetPeriodSchemeViewModel.cs @@ -0,0 +1,11 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetPeriodSchemes.AssetPeriodScheme.ViewModels; + +public class EditAssetPeriodSchemeViewModel : ExtensibleObject +{ + [Display(Name = "AssetPeriodSchemeDate")] + public DateTime Date { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/index.js new file mode 100644 index 0000000..932e158 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetPeriodSchemes/AssetPeriodScheme/index.js @@ -0,0 +1,80 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.assetPeriodSchemes.assetPeriodScheme; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetPeriodSchemes/AssetPeriodScheme/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetPeriodSchemes/AssetPeriodScheme/EditModal'); + + var dataTable = $('#AssetPeriodSchemeTable').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('Edit'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetPeriodScheme.Update'), + action: function (data) { + editModal.open({ + date: data.record.date, + assetId: data.record.assetId + }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetPeriodScheme.Update'), + confirmMessage: function (data) { + return l('AssetPeriodSchemeDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete({ + date: data.record.date, + assetId: data.record.assetId + }) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('AssetPeriodSchemePeriodSchemeId'), + data: "periodSchemeId" + }, + { + title: l('AssetPeriodSchemeAssetId'), + data: "assetId" + }, + { + title: l('AssetPeriodSchemeDate'), + data: "date" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewAssetPeriodSchemeButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml new file mode 100644 index 0000000..f67fd70 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml.cs new file mode 100644 index 0000000..82c2aa3 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.AssetSchedules.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateAssetScheduleViewModel ViewModel { get; set; } + + private readonly IAssetScheduleAppService _service; + + public CreateModalModel(IAssetScheduleAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml new file mode 100644 index 0000000..0a8f574 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml.cs new file mode 100644 index 0000000..dc73c2f --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/EditModal.cshtml.cs @@ -0,0 +1,38 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.AssetSchedules.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public EditAssetScheduleViewModel ViewModel { get; set; } + + private readonly IAssetScheduleAppService _service; + + public EditModalModel(IAssetScheduleAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml new file mode 100644 index 0000000..c61c012 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService Authorization +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["AssetSchedule"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:AssetSchedule"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.AssetSchedule; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["AssetSchedule"] + + + @if (await Authorization.IsGrantedAsync(BookingServicePermissions.AssetSchedule.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml.cs new file mode 100644 index 0000000..151d65c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/CreateAssetScheduleViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/CreateAssetScheduleViewModel.cs new file mode 100644 index 0000000..82625f7 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/CreateAssetScheduleViewModel.cs @@ -0,0 +1,28 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.ViewModels; + +public class CreateAssetScheduleViewModel : ExtensibleObject +{ + [Display(Name = "AssetScheduleDate")] + public DateTime Date { get; set; } + + [Display(Name = "AssetScheduleAssetId")] + public Guid AssetId { get; set; } + + [Display(Name = "AssetSchedulePeriodSchemeId")] + public Guid PeriodSchemeId { get; set; } + + [Display(Name = "AssetSchedulePeriodId")] + public Guid PeriodId { get; set; } + + [Display(Name = "AssetSchedulePeriodUsable")] + public PeriodUsable PeriodUsable { get; set; } + + [Display(Name = "AssetScheduleTimeInAdvance")] + public TimeInAdvanceViewModel TimeInAdvance { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/EditAssetScheduleViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/EditAssetScheduleViewModel.cs new file mode 100644 index 0000000..283cde7 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/ViewModels/EditAssetScheduleViewModel.cs @@ -0,0 +1,15 @@ +using System.ComponentModel.DataAnnotations; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.AssetSchedules.AssetSchedule.ViewModels; + +public class EditAssetScheduleViewModel : ExtensibleObject +{ + [Display(Name = "AssetSchedulePeriodUsable")] + public PeriodUsable PeriodUsable { get; set; } + + [Display(Name = "AssetScheduleTimeInAdvance")] + public TimeInAdvanceViewModel TimeInAdvance { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/index.js new file mode 100644 index 0000000..ced9b25 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/AssetSchedules/AssetSchedule/index.js @@ -0,0 +1,86 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.assetSchedules.assetSchedule; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetSchedules/AssetSchedule/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/AssetSchedules/AssetSchedule/EditModal'); + + var dataTable = $('#AssetScheduleTable').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('Edit'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetSchedule.Update'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.AssetSchedule.Update'), + confirmMessage: function (data) { + return l('AssetScheduleDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('AssetScheduleDate'), + data: "date" + }, + { + title: l('AssetScheduleAssetId'), + data: "assetId" + }, + { + title: l('AssetSchedulePeriodSchemeId'), + data: "periodSchemeId" + }, + { + title: l('AssetSchedulePeriodId'), + data: "periodId" + }, + { + title: l('AssetSchedulePeriodUsable'), + data: "periodUsable" + }, + { + title: l('AssetScheduleTimeInAdvance'), + data: "timeInAdvance" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewAssetScheduleButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml new file mode 100644 index 0000000..64f4625 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml.cs new file mode 100644 index 0000000..f72f10a --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.Assets; +using EasyAbp.BookingService.Assets.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateEditAssetViewModel ViewModel { get; set; } + + private readonly IAssetAppService _service; + + public CreateModalModel(IAssetAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml new file mode 100644 index 0000000..6114731 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml.cs new file mode 100644 index 0000000..e3e2490 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/EditModal.cshtml.cs @@ -0,0 +1,38 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.BookingService.Assets; +using EasyAbp.BookingService.Assets.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public CreateEditAssetViewModel ViewModel { get; set; } + + private readonly IAssetAppService _service; + + public EditModalModel(IAssetAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml new file mode 100644 index 0000000..e012a9c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService AuthorizationService +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["Asset"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Asset"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.Asset; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["Asset"] + + + @if (await AuthorizationService.IsGrantedAsync(BookingServicePermissions.Asset.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml.cs new file mode 100644 index 0000000..4ba57ed --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/ViewModels/CreateEditAssetViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/ViewModels/CreateEditAssetViewModel.cs new file mode 100644 index 0000000..da25d01 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/ViewModels/CreateEditAssetViewModel.cs @@ -0,0 +1,38 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.BookingService.AssetSchedules; +using EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.Assets.Asset.ViewModels; + +public class CreateEditAssetViewModel : ExtensibleObject +{ + [Display(Name = "AssetName")] + public string Name { get; set; } + + [Required] + [Display(Name = "AssetAssetDefinitionName")] + public string AssetDefinitionName { get; set; } + + [Display(Name = "AssetAssetCategoryId")] + public Guid AssetCategoryId { get; set; } + + [Display(Name = "AssetPeriodSchemeId")] + public Guid? PeriodSchemeId { get; set; } + + [Display(Name = "AssetDefaultPeriodUsable")] + public PeriodUsable? DefaultPeriodUsable { get; set; } + + [Display(Name = "AssetVolume")] + public int Volume { get; set; } + + [Display(Name = "AssetPriority")] + public int Priority { get; set; } + + [Display(Name = "AssetTimeInAdvance")] + public TimeInAdvanceViewModel TimeInAdvance { get; set; } + + [Display(Name = "AssetDisabled")] + public bool Disabled { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/index.js new file mode 100644 index 0000000..0bc7b4d --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Assets/Asset/index.js @@ -0,0 +1,98 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.assets.asset; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/Assets/Asset/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/Assets/Asset/EditModal'); + + var dataTable = $('#AssetTable').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('Edit'), + visible: abp.auth.isGranted('EasyAbp.BookingService.Asset.Update'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.Asset.Update'), + confirmMessage: function (data) { + return l('AssetDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('AssetName'), + data: "name" + }, + { + title: l('AssetAssetDefinitionName'), + data: "assetDefinitionName" + }, + { + title: l('AssetAssetCategoryId'), + data: "assetCategoryId" + }, + { + title: l('AssetPeriodSchemeId'), + data: "periodSchemeId" + }, + { + title: l('AssetDefaultPeriodUsable'), + data: "defaultPeriodUsable" + }, + { + title: l('AssetVolume'), + data: "volume" + }, + { + title: l('AssetPriority'), + data: "priority" + }, + { + title: l('AssetTimeInAdvance'), + data: "timeInAdvance" + }, + { + title: l('AssetDisabled'), + data: "disabled" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewAssetButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml deleted file mode 100644 index d750b3f..0000000 --- a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using EasyAbp.BookingService.Localization -@using EasyAbp.BookingService.Web.Pages.BookingService -@model EasyAbp.BookingService.Web.Pages.BookingService.IndexModel -@inject IStringLocalizer L - -@{ -} -

BookingService

-

@L["SamplePageMessage"]

diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml.cs deleted file mode 100644 index 53ee265..0000000 --- a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/Index.cshtml.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace EasyAbp.BookingService.Web.Pages.BookingService; - -public class IndexModel : BookingServicePageModel -{ - public void OnGet() - { - } -} diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml new file mode 100644 index 0000000..5588c4d --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml @@ -0,0 +1,19 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml.cs new file mode 100644 index 0000000..bf3dfcc --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/CreateModal.cshtml.cs @@ -0,0 +1,32 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.BookingService.PeriodSchemes; +using EasyAbp.BookingService.PeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateEditPeriodViewModel ViewModel { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid PeriodSchemeId { get; set; } + + private readonly IPeriodSchemeAppService _service; + + public CreateModalModel(IPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreatePeriodAsync(PeriodSchemeId, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml new file mode 100644 index 0000000..32ac14f --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml @@ -0,0 +1,20 @@ +@page +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml.cs new file mode 100644 index 0000000..151bec1 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/EditModal.cshtml.cs @@ -0,0 +1,43 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.BookingService.PeriodSchemes; +using EasyAbp.BookingService.PeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid PeriodSchemeId { get; set; } + + [BindProperty] + public CreateEditPeriodViewModel ViewModel { get; set; } + + private readonly IPeriodSchemeAppService _service; + + public EditModalModel(IPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(PeriodSchemeId); + ViewModel = ObjectMapper.Map(dto.Periods.Single(x => x.Id == Id)); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdatePeriodAsync(PeriodSchemeId, Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml new file mode 100644 index 0000000..cb6525c --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml @@ -0,0 +1,55 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService Authorization +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["Period"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Period"].Value); +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + + + @L["Period"] + + + @if (await Authorization.IsGrantedAsync(BookingServicePermissions.PeriodScheme.Update)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml.cs new file mode 100644 index 0000000..c32eba4 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/Index.cshtml.cs @@ -0,0 +1,16 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period; + +public class IndexModel : BookingServicePageModel +{ + [BindProperty(SupportsGet = true)] + public Guid PeriodSchemeId { get; set; } + + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/ViewModels/CreateEditPeriodViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/ViewModels/CreateEditPeriodViewModel.cs new file mode 100644 index 0000000..c9291cd --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/ViewModels/CreateEditPeriodViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.Period.ViewModels; + +public class CreateEditPeriodViewModel : ExtensibleObject, IPeriodInfo +{ + [Display(Name = "PeriodStartingTime")] + public TimeSpan StartingTime { get; set; } + + [Display(Name = "PeriodDuration")] + public TimeSpan Duration { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/index.js new file mode 100644 index 0000000..3a27cb5 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/Period/index.js @@ -0,0 +1,80 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.periodSchemes.periodScheme; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/PeriodSchemes/Period/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/PeriodSchemes/Period/EditModal'); + + var dataTable = $('#PeriodTable').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(periodSchemeId).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.BookingService.PeriodScheme.Update'), + action: function (data) { + editModal.open({id: data.record.id, periodSchemeId: periodSchemeId}); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.PeriodScheme.Update'), + confirmMessage: function (data) { + return l('PeriodDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.deletePeriod(periodSchemeId, data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('PeriodStartingTime'), + data: "startingTime" + }, + { + title: l('PeriodDuration'), + data: "duration" + }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewPeriodButton').click(function (e) { + e.preventDefault(); + createModal.open({periodSchemeId: periodSchemeId}); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml new file mode 100644 index 0000000..b7d11ff --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.BookingService.Localization +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml.cs new file mode 100644 index 0000000..ab6293b --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/CreateModal.cshtml.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using EasyAbp.BookingService.PeriodSchemes; +using EasyAbp.BookingService.PeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme; + +public class CreateModalModel : BookingServicePageModel +{ + [BindProperty] + public CreateEditPeriodSchemeViewModel ViewModel { get; set; } + + private readonly IPeriodSchemeAppService _service; + + public CreateModalModel(IPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml new file mode 100644 index 0000000..2d9bca0 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.BookingService.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml.cs new file mode 100644 index 0000000..e388f72 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/EditModal.cshtml.cs @@ -0,0 +1,38 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.BookingService.PeriodSchemes; +using EasyAbp.BookingService.PeriodSchemes.Dtos; +using EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme; + +public class EditModalModel : BookingServicePageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public CreateEditPeriodSchemeViewModel ViewModel { get; set; } + + private readonly IPeriodSchemeAppService _service; + + public EditModalModel(IPeriodSchemeAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml new file mode 100644 index 0000000..b35c13e --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml @@ -0,0 +1,53 @@ +@page +@using EasyAbp.BookingService.Localization +@using EasyAbp.BookingService.Permissions +@using EasyAbp.BookingService.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Card +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.IndexModel +@inject IPageLayout PageLayout +@inject IAuthorizationService Authorization +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["PeriodScheme"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:PeriodScheme"].Value); + PageLayout.Content.MenuItemName = BookingServiceCommonMenus.PeriodScheme; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + @L["PeriodScheme"] + + + @if (await Authorization.IsGrantedAsync(BookingServicePermissions.PeriodScheme.Create)) + { + + } + + + + + + + \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml.cs new file mode 100644 index 0000000..a3da0a6 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/Index.cshtml.cs @@ -0,0 +1,11 @@ +using System.Threading.Tasks; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme; + +public class IndexModel : BookingServicePageModel +{ + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } +} diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/ViewModels/CreateEditPeriodSchemeViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/ViewModels/CreateEditPeriodSchemeViewModel.cs new file mode 100644 index 0000000..0a36af7 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/ViewModels/CreateEditPeriodSchemeViewModel.cs @@ -0,0 +1,10 @@ +using System.ComponentModel.DataAnnotations; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.PeriodSchemes.PeriodScheme.ViewModels; + +public class CreateEditPeriodSchemeViewModel : ExtensibleObject +{ + [Display(Name = "PeriodSchemeName")] + public string Name { get; set; } +} \ No newline at end of file diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/index.css b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/index.css new file mode 100644 index 0000000..e69de29 diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/index.js b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/index.js new file mode 100644 index 0000000..c155a29 --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/PeriodSchemes/PeriodScheme/index.js @@ -0,0 +1,90 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpBookingService'); + + var service = easyAbp.bookingService.periodSchemes.periodScheme; + var createModal = new abp.ModalManager(abp.appPath + 'BookingService/PeriodSchemes/PeriodScheme/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'BookingService/PeriodSchemes/PeriodScheme/EditModal'); + + var dataTable = $('#PeriodSchemeTable').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('PeriodSchemePeriods'), + action: function (data) { + document.location.href = abp.appPath + 'BookingService/PeriodSchemes/Period?PeriodSchemeId=' + data.record.id; + } + }, + { + text: l('SetAsDefault'), + visible: abp.auth.isGranted('EasyAbp.BookingService.PeriodScheme.Update'), + confirmMessage: function (data) { + return l('PeriodSchemeSetAsDefaultConfirmationMessage', data.record.id); + }, + action: function (data) { + service.setAsDefault(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyEdited')); + dataTable.ajax.reload(); + }); + } + }, + { + text: l('Edit'), + visible: abp.auth.isGranted('EasyAbp.BookingService.PeriodScheme.Update'), + action: function (data) { + editModal.open({id: data.record.id}); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('EasyAbp.BookingService.PeriodScheme.Update'), + confirmMessage: function (data) { + return l('PeriodSchemeDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + title: l('PeriodSchemeName'), + data: "name" + }, + { + title: l('PeriodSchemeIsDefault'), + data: "isDefault" + } + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewPeriodSchemeButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); diff --git a/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/ViewModels/TimeInAdvanceViewModel.cs b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/ViewModels/TimeInAdvanceViewModel.cs new file mode 100644 index 0000000..8fc101a --- /dev/null +++ b/modules/Common/src/EasyAbp.BookingService.Common.Web/Pages/BookingService/ViewModels/TimeInAdvanceViewModel.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace EasyAbp.BookingService.Web.Pages.BookingService.ViewModels; + +public class TimeInAdvanceViewModel : IValidatableObject, ITimeInAdvance +{ + /// + [Display(Name = "TimeInAdvanceMaxDaysInAdvance")] + [Required, Range(-1, int.MaxValue)] + public int MaxDaysInAdvance { get; set; } + + /// + [Display(Name = "TimeInAdvanceMaxTimespanInAdvance")] + public TimeSpan MaxTimespanInAdvance { get; set; } + + /// + [Range(-1, int.MaxValue)] + [Display(Name = "TimeInAdvanceMinDaysInAdvance")] + public int? MinDaysInAdvance { get; set; } + + /// + [Display(Name = "TimeInAdvanceMinTimespanInAdvance")] + public TimeSpan? MinTimespanInAdvance { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + if (MinDaysInAdvance > MaxDaysInAdvance) + { + yield return new ValidationResult( + "MinDaysInAdvance should be less than or equal to MaxDaysInAdvance!", + new[] + { + nameof(MinDaysInAdvance), nameof(MaxDaysInAdvance) + } + ); + } + + if (MinTimespanInAdvance > MaxTimespanInAdvance) + { + yield return new ValidationResult( + "MinTimespanInAdvance should be less than or equal to MaxTimespanInAdvance!", + new[] + { + nameof(MinTimespanInAdvance), nameof(MinTimespanInAdvance) + } + ); + } + } +} \ No newline at end of file