Browse Source

Rename pagemodel classes.

pull/15/head
Halil İbrahim Kalkan 6 years ago
parent
commit
fbf986bdfe
  1. 4
      eventhub/src/EventHub.Web/EventHubWebAutoMapperProfile.cs
  2. 4
      eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml
  3. 4
      eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml.cs
  4. 2
      eventhub/src/EventHub.Web/Pages/Events/New.cshtml
  5. 4
      eventhub/src/EventHub.Web/Pages/Events/New.cshtml.cs
  6. 4
      eventhub/src/EventHub.Web/Pages/Organizations/Index.cshtml
  7. 4
      eventhub/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs
  8. 2
      eventhub/src/EventHub.Web/Pages/Organizations/New.cshtml
  9. 6
      eventhub/src/EventHub.Web/Pages/Organizations/New.cshtml.cs
  10. 2
      eventhub/src/EventHub.Web/Pages/Organizations/Profile.cshtml
  11. 4
      eventhub/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs

4
eventhub/src/EventHub.Web/EventHubWebAutoMapperProfile.cs

@ -8,8 +8,8 @@ namespace EventHub.Web
{ {
public EventHubWebAutoMapperProfile() public EventHubWebAutoMapperProfile()
{ {
CreateMap<EventHub.Web.Pages.Organizations.New.CreateOrganizationViewModel, CreateOrganizationDto>(); CreateMap<EventHub.Web.Pages.Organizations.NewPageModel.CreateOrganizationViewModel, CreateOrganizationDto>();
CreateMap<EventHub.Web.Pages.Events.New.NewEventViewModel, CreateEventDto>(); CreateMap<EventHub.Web.Pages.Events.NewPageModel.NewEventViewModel, CreateEventDto>();
} }
} }
} }

4
eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml

@ -4,7 +4,7 @@
@using EventHub.Web.Pages.Events.Components.AttendeesArea @using EventHub.Web.Pages.Events.Components.AttendeesArea
@using EventHub.Web.Pages.Events.Components.RegistrationArea @using EventHub.Web.Pages.Events.Components.RegistrationArea
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@model EventHub.Web.Pages.Events.Detail @model EventHub.Web.Pages.Events.DetailPageModel
<abp-row> <abp-row>
<abp-column size-lg="_8" size-md="_6"> <abp-column size-lg="_8" size-md="_6">
<abp-card class="mb-3"> <abp-card class="mb-3">
@ -14,7 +14,7 @@
<abp-card-subtitle> <abp-card-subtitle>
@Model.Event.StartTime.ToLongDateString(), @Model.Event.StartTime.ToLongDateString(),
@Model.Event.StartTime.ToString("hh:mm") <br/> @Model.Event.StartTime.ToString("hh:mm") <br/>
<span class="text-muted">@L["OrganizedBy"]</span> <a href="@Url.Page("/Organizations/OrganizationProfile", new {name = Model.Event.OrganizationName})">@Model.Event.OrganizationDisplayName</a> <span class="text-muted">@L["OrganizedBy"]</span> <a href="@Url.Page("/Organizations/Profile", new {name = Model.Event.OrganizationName})">@Model.Event.OrganizationDisplayName</a>
</abp-card-subtitle> </abp-card-subtitle>
<abp-card-text class="mt-3"> <abp-card-text class="mt-3">
@Model.Event.Description @Model.Event.Description

4
eventhub/src/EventHub.Web/Pages/Events/Detail.cshtml.cs

@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Routing;
namespace EventHub.Web.Pages.Events namespace EventHub.Web.Pages.Events
{ {
public class Detail : PageModel public class DetailPageModel : PageModel
{ {
[BindProperty(SupportsGet = true)] [BindProperty(SupportsGet = true)]
public string Url { get; set; } public string Url { get; set; }
@ -16,7 +16,7 @@ namespace EventHub.Web.Pages.Events
private readonly IEventAppService _eventAppService; private readonly IEventAppService _eventAppService;
private readonly LinkGenerator _linkGenerator; private readonly LinkGenerator _linkGenerator;
public Detail( public DetailPageModel(
IEventAppService eventAppService, IEventAppService eventAppService,
LinkGenerator linkGenerator) LinkGenerator linkGenerator)
{ {

2
eventhub/src/EventHub.Web/Pages/Events/New.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<EventHubResource> L @inject IHtmlLocalizer<EventHubResource> L
@using EventHub.Localization @using EventHub.Localization
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@model EventHub.Web.Pages.Events.New @model EventHub.Web.Pages.Events.NewPageModel
<h1>@L["NewEvent"]</h1> <h1>@L["NewEvent"]</h1>
<form method="post"> <form method="post">
<abp-select asp-for="Event.OrganizationId" /> <abp-select asp-for="Event.OrganizationId" />

4
eventhub/src/EventHub.Web/Pages/Events/New.cshtml.cs

@ -12,7 +12,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
namespace EventHub.Web.Pages.Events namespace EventHub.Web.Pages.Events
{ {
public class New : EventHubPageModel public class NewPageModel : EventHubPageModel
{ {
[BindProperty] [BindProperty]
public NewEventViewModel Event { get; set; } public NewEventViewModel Event { get; set; }
@ -22,7 +22,7 @@ namespace EventHub.Web.Pages.Events
private readonly IEventAppService _eventAppService; private readonly IEventAppService _eventAppService;
private readonly IOrganizationAppService _organizationAppService; private readonly IOrganizationAppService _organizationAppService;
public New( public NewPageModel(
IEventAppService eventAppService, IEventAppService eventAppService,
IOrganizationAppService organizationAppService) IOrganizationAppService organizationAppService)
{ {

4
eventhub/src/EventHub.Web/Pages/Organizations/Index.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<EventHubResource> L @inject IHtmlLocalizer<EventHubResource> L
@using EventHub.Localization @using EventHub.Localization
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@model EventHub.Web.Pages.Organizations.Index @model EventHub.Web.Pages.Organizations.IndexPageModel
<abp-row> <abp-row>
@foreach (var organization in Model.Organizations) @foreach (var organization in Model.Organizations)
@ -15,7 +15,7 @@
<abp-card-text> <abp-card-text>
@organization.Description.TruncateWithPostfix(100) @organization.Description.TruncateWithPostfix(100)
</abp-card-text> </abp-card-text>
<a abp-button="Primary" href="@Url.Page("/Organizations/OrganizationProfile", new {name = organization.Name})"> @L["SeeOrganization"]</a> <a abp-button="Primary" href="@Url.Page("/Organizations/Profile", new {name = organization.Name})"> @L["SeeOrganization"]</a>
</abp-card-body> </abp-card-body>
</abp-card> </abp-card>
</abp-column> </abp-column>

4
eventhub/src/EventHub.Web/Pages/Organizations/Index.cshtml.cs

@ -5,13 +5,13 @@ using Volo.Abp.Application.Dtos;
namespace EventHub.Web.Pages.Organizations namespace EventHub.Web.Pages.Organizations
{ {
public class Index : EventHubPageModel public class IndexPageModel : EventHubPageModel
{ {
public IReadOnlyList<OrganizationInListDto> Organizations { get; set; } public IReadOnlyList<OrganizationInListDto> Organizations { get; set; }
private readonly IOrganizationAppService _organizationAppService; private readonly IOrganizationAppService _organizationAppService;
public Index(IOrganizationAppService organizationAppService) public IndexPageModel(IOrganizationAppService organizationAppService)
{ {
_organizationAppService = organizationAppService; _organizationAppService = organizationAppService;
} }

2
eventhub/src/EventHub.Web/Pages/Organizations/New.cshtml

@ -2,6 +2,6 @@
@inject IHtmlLocalizer<EventHubResource> L @inject IHtmlLocalizer<EventHubResource> L
@using EventHub.Localization @using EventHub.Localization
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@model EventHub.Web.Pages.Organizations.New @model EventHub.Web.Pages.Organizations.NewPageModel
<h1>@L["NewOrganization"]</h1> <h1>@L["NewOrganization"]</h1>
<abp-dynamic-form abp-model="Organization" submit-button="true" /> <abp-dynamic-form abp-model="Organization" submit-button="true" />

6
eventhub/src/EventHub.Web/Pages/Organizations/New.cshtml.cs

@ -9,14 +9,14 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form;
namespace EventHub.Web.Pages.Organizations namespace EventHub.Web.Pages.Organizations
{ {
[Authorize] [Authorize]
public class New : EventHubPageModel public class NewPageModel : EventHubPageModel
{ {
[BindProperty] [BindProperty]
public CreateOrganizationViewModel Organization { get; set; } public CreateOrganizationViewModel Organization { get; set; }
private readonly IOrganizationAppService _organizationAppService; private readonly IOrganizationAppService _organizationAppService;
public New(IOrganizationAppService organizationAppService) public NewPageModel(IOrganizationAppService organizationAppService)
{ {
_organizationAppService = organizationAppService; _organizationAppService = organizationAppService;
} }
@ -35,7 +35,7 @@ namespace EventHub.Web.Pages.Organizations
var input = ObjectMapper.Map<CreateOrganizationViewModel, CreateOrganizationDto>(Organization); var input = ObjectMapper.Map<CreateOrganizationViewModel, CreateOrganizationDto>(Organization);
await _organizationAppService.CreateAsync(input); await _organizationAppService.CreateAsync(input);
return RedirectToPage("./OrganizationProfile", new {name = Organization.Name}); return RedirectToPage("./Profile", new {name = Organization.Name});
} }
catch (Exception exception) catch (Exception exception)
{ {

2
eventhub/src/EventHub.Web/Pages/Organizations/OrganizationProfile.cshtml → eventhub/src/EventHub.Web/Pages/Organizations/Profile.cshtml

@ -2,7 +2,7 @@
@inject IHtmlLocalizer<EventHubResource> L @inject IHtmlLocalizer<EventHubResource> L
@using EventHub.Localization @using EventHub.Localization
@using Microsoft.AspNetCore.Mvc.Localization @using Microsoft.AspNetCore.Mvc.Localization
@model EventHub.Web.Pages.Organizations.OrganizationProfile @model EventHub.Web.Pages.Organizations.ProfilePageModel
<h1>@Model.Organization.DisplayName <small class="text-muted">@Model.Organization.Name</small></h1> <h1>@Model.Organization.DisplayName <small class="text-muted">@Model.Organization.Name</small></h1>
<img class="img-fluid mb-3" src="https://picsum.photos/seed/@Model.Name/1920/400?blur=8"> <img class="img-fluid mb-3" src="https://picsum.photos/seed/@Model.Name/1920/400?blur=8">
<p class="lead"> <p class="lead">

4
eventhub/src/EventHub.Web/Pages/Organizations/OrganizationProfile.cshtml.cs → eventhub/src/EventHub.Web/Pages/Organizations/Profile.cshtml.cs

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
namespace EventHub.Web.Pages.Organizations namespace EventHub.Web.Pages.Organizations
{ {
public class OrganizationProfile : PageModel public class ProfilePageModel : PageModel
{ {
[BindProperty(SupportsGet = true)] [BindProperty(SupportsGet = true)]
public string Name { get; set; } public string Name { get; set; }
@ -14,7 +14,7 @@ namespace EventHub.Web.Pages.Organizations
private readonly IOrganizationAppService _organizationAppService; private readonly IOrganizationAppService _organizationAppService;
public OrganizationProfile(IOrganizationAppService organizationAppService) public ProfilePageModel(IOrganizationAppService organizationAppService)
{ {
_organizationAppService = organizationAppService; _organizationAppService = organizationAppService;
} }
Loading…
Cancel
Save