File tree Expand file tree Collapse file tree 8 files changed +17
-18
lines changed
AbpCompanyName.AbpProjectName.Application
AbpCompanyName.AbpProjectName.Web.Mvc
Shared/Components/TenantChange Expand file tree Collapse file tree 8 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public override void Initialize()
23
23
24
24
Configuration . Modules . AbpAutoMapper ( ) . Configurators . Add (
25
25
// Scan the assembly for classes which inherit from AutoMapper.Profile
26
- cfg => cfg . AddProfiles ( thisAssembly )
26
+ cfg => cfg . AddMaps ( thisAssembly )
27
27
) ;
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public async Task<IActionResult> Index()
36
36
public async Task < ActionResult > EditRoleModal ( int roleId )
37
37
{
38
38
var output = await _roleAppService . GetRoleForEdit ( new EntityDto ( roleId ) ) ;
39
- var model = new EditRoleModalViewModel ( output ) ;
39
+ var model = ObjectMapper . Map < EditRoleModalViewModel > ( output ) ;
40
40
41
41
return View ( "_EditRoleModal" , model ) ;
42
42
}
Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ namespace AbpCompanyName.AbpProjectName.Web.Models.Roles
7
7
[ AutoMapFrom ( typeof ( GetRoleForEditOutput ) ) ]
8
8
public class EditRoleModalViewModel : GetRoleForEditOutput , IPermissionsEditViewModel
9
9
{
10
- public EditRoleModalViewModel ( GetRoleForEditOutput output )
11
- {
12
- output . MapTo ( this ) ;
13
- }
14
-
15
10
public bool HasPermission ( FlatPermissionDto permission )
16
11
{
17
12
return GrantedPermissionNames . Contains ( permission . Name ) ;
Original file line number Diff line number Diff line change 3
3
@{
4
4
Layout = null ;
5
5
}
6
- @Html.Partial ( "~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditRole")))
6
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditRole")))
7
7
8
8
<div class =" modal-body" >
9
9
<form name =" RoleEditForm" role =" form" novalidate class =" form-validation" >
58
58
</form >
59
59
</div >
60
60
61
- @Html.Partial ( "~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
61
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
62
62
63
63
<script src =" ~/view-resources/Views/Roles/_EditRoleModal.js" asp-append-version =" true" ></script >
Original file line number Diff line number Diff line change 1
1
using System . Threading . Tasks ;
2
2
using Microsoft . AspNetCore . Mvc ;
3
3
using Abp . AutoMapper ;
4
+ using Abp . ObjectMapping ;
4
5
using AbpCompanyName . AbpProjectName . Sessions ;
5
6
6
7
namespace AbpCompanyName . AbpProjectName . Web . Views . Shared . Components . TenantChange
7
8
{
8
9
public class TenantChangeViewComponent : AbpProjectNameViewComponent
9
10
{
10
11
private readonly ISessionAppService _sessionAppService ;
12
+ private readonly IObjectMapper _objectMapper ;
11
13
12
- public TenantChangeViewComponent ( ISessionAppService sessionAppService )
14
+ public TenantChangeViewComponent ( ISessionAppService sessionAppService ,
15
+ IObjectMapper objectMapper )
13
16
{
14
17
_sessionAppService = sessionAppService ;
18
+ _objectMapper = objectMapper ;
15
19
}
16
20
17
21
public async Task < IViewComponentResult > InvokeAsync ( )
18
22
{
19
23
var loginInfo = await _sessionAppService . GetCurrentLoginInformations ( ) ;
20
- var model = loginInfo . MapTo < TenantChangeViewModel > ( ) ;
24
+ var model = _objectMapper . Map < TenantChangeViewModel > ( loginInfo ) ;
21
25
return View ( model ) ;
22
26
}
23
27
}
Original file line number Diff line number Diff line change 5
5
@{
6
6
Layout = null ;
7
7
}
8
- @Html.Partial ( "~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("ChangeTenant")))
8
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("ChangeTenant")))
9
9
10
10
<div class =" modal-body" >
11
11
<form name =" TenantChangeForm" role =" form" novalidate class =" form-validation" >
12
12
<div class =" form-group form-float" >
13
13
<div class =" form-line" >
14
- <input class =" form-control" type =" text" name =" TenancyName" maxlength =" @AbpTenantBase.MaxTenancyNameLength" value =" @Model.TenancyName" >
14
+ <input class =" form-control" type =" text" name =" TenancyName" maxlength =" @AbpTenantBase.MaxTenancyNameLength.ToString() " value =" @Model.TenancyName" >
15
15
<label class =" form-label" >@L( "TenancyName")</label >
16
16
</div >
17
17
</div >
18
18
<span class =" help-block" >@L( "LeaveEmptyToSwitchToHost")</span >
19
19
</form >
20
20
</div >
21
21
22
- @Html.Partial ( "~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
22
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
23
23
24
24
<script src =" ~/view-resources/Views/Shared/Components/TenantChange/_ChangeModal.js" asp-append-version =" true" ></script >
Original file line number Diff line number Diff line change 5
5
@{
6
6
Layout = null ;
7
7
}
8
- @Html.Partial ( "~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditTenant")))
8
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditTenant")))
9
9
10
10
<div class =" modal-body" >
11
11
<form name =" TenantEditForm" role =" form" novalidate class =" form-validation" >
31
31
</form >
32
32
</div >
33
33
34
- @Html.Partial ( "~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
34
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
35
35
36
36
<script src =" ~/view-resources/Views/Tenants/_EditTenantModal.js" asp-append-version =" true" ></script >
Original file line number Diff line number Diff line change 3
3
@{
4
4
Layout = null ;
5
5
}
6
- @Html.Partial ( "~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditUser")))
6
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(L("EditUser")))
7
7
8
8
<div class =" modal-body" >
9
9
<form name =" UserEditForm" role =" form" novalidate class =" form-validation" >
86
86
</form >
87
87
</div >
88
88
89
- @Html.Partial ( "~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
89
+ @await Html.PartialAsync ("~/Views/Shared/Modals/_ModalFooterWithSaveAndCancel.cshtml")
90
90
91
91
<script src =" ~/view-resources/Views/Users/_EditUserModal.js" asp-append-version =" true" ></script >
You can’t perform that action at this time.
0 commit comments