diff --git a/src/EventHub.Application/Events/EventAppService.cs b/src/EventHub.Application/Events/EventAppService.cs index 2eb3f62..9b7ac0e 100644 --- a/src/EventHub.Application/Events/EventAppService.cs +++ b/src/EventHub.Application/Events/EventAppService.cs @@ -54,8 +54,10 @@ namespace EventHub.Events if (organization.OwnerUserId != CurrentUser.GetId()) { - throw new BusinessException(EventHubErrorCodes.NotAuthorizedToCreateEventInThisOrganization) - .WithData("OrganizationName", organization.DisplayName); + throw new AbpAuthorizationException( + L["EventHub:NotAuthorizedToCreateEventInThisOrganization", organization.DisplayName], + EventHubErrorCodes.NotAuthorizedToCreateEventInThisOrganization + ); } var @event = await _eventManager.CreateAsync( @@ -184,7 +186,7 @@ namespace EventHub.Events var countriesQueryable = await _countriesRepository.GetQueryableAsync(); var query = from country in countriesQueryable - orderby country.Name ascending + orderby country.Name select country; var countries = await AsyncExecuter.ToListAsync(query); @@ -209,7 +211,7 @@ namespace EventHub.Events if (organization.OwnerUserId != CurrentUser.GetId()) { throw new AbpAuthorizationException( - L["EventHub:NotAuthorizedToUpdateEvent"].Value.Replace("{EventTitle}", @event.Title), + L["EventHub:NotAuthorizedToUpdateEvent", @event.Title], EventHubErrorCodes.NotAuthorizedToUpdateEvent ); } diff --git a/src/EventHub.Domain.Shared/Localization/EventHub/en.json b/src/EventHub.Domain.Shared/Localization/EventHub/en.json index b8ff954..d986d6d 100644 --- a/src/EventHub.Domain.Shared/Localization/EventHub/en.json +++ b/src/EventHub.Domain.Shared/Localization/EventHub/en.json @@ -17,7 +17,7 @@ "DisplayName:IsOnline": "Is Online?", "DisplayName:Capacity": "Capacity", "EventHub:OrganizationNameAlreadyExists": "The organization {Name} already exists. Please use another name.", - "EventHub:NotAuthorizedToCreateEventInThisOrganization": "You are not authorized to create events for the organization {OrganizationName}.", + "EventHub:NotAuthorizedToCreateEventInThisOrganization": "You are not authorized to create events for the organization {0}.", "EventHub:EventEndTimeCantBeEarlierThanStartTime": "Event end time can not be earlier than the start time.", "EventHub:CantRegisterOrUnregisterForAPastEvent": "Can not register to or unregister from an event in the past.", "Events": "Events", @@ -63,7 +63,7 @@ "LocationHasNotSpecifiedYet": "Event {0} has not been specified yet.", "Language": "Language", "EventHub:CapacityCantBeLowerThanRegisteredUserCount": "Capacity can not be lower than the currently registered user count.", - "EventHub:NotAuthorizedToUpdateEvent": "You are not authorized to update the \"{EventTitle}\" event.", + "EventHub:NotAuthorizedToUpdateEvent": "You are not authorized to update the \"{0}\" event.", "CoverImage": "Cover Image", "EventHub:CantChangeEventTiming": "Can not change the event timing more than {MaxTimingChangeLimit} times.", "EventCoverImageEditSuccessMessage": "The event's cover image has been changed successfully.", diff --git a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs index e36e4fb..5552d26 100644 --- a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs +++ b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs @@ -4,7 +4,6 @@ using EventHub.Users; using Volo.Abp; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.Timing; namespace EventHub.Events.Registrations {