diff --git a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs index 6cb88864..b1da0153 100644 --- a/AccountManagement.Application.Contracts/Account/IAccountApplication.cs +++ b/AccountManagement.Application.Contracts/Account/IAccountApplication.cs @@ -74,6 +74,8 @@ public interface IAccountApplication void CameraLogin(CameraLoginRequest request); + Task GetPmUserAsync(long accountId); + } public class CameraLoginRequest diff --git a/AccountManagement.Application/AccountApplication.cs b/AccountManagement.Application/AccountApplication.cs index 2b111195..545c991e 100644 --- a/AccountManagement.Application/AccountApplication.cs +++ b/AccountManagement.Application/AccountApplication.cs @@ -999,5 +999,8 @@ public class AccountApplication : IAccountApplication _authHelper.CameraSignIn(authViewModel); } - + public async Task GetPmUserAsync(long accountId) + { + return await _pmUserQueryService.GetPmUserDataByAccountId(accountId); + } } \ No newline at end of file diff --git a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs index 88899470..902acf03 100644 --- a/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Accounts/Account/Index.cshtml.cs @@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.SignalR; using Newtonsoft.Json; using ServiceHost.Hubs; +using Shared.Contracts.PmUser.Queries; namespace ServiceHost.Areas.Admin.Pages.Accounts.Account; @@ -30,6 +31,7 @@ public class IndexModel : PageModel public List Roless; public AccountSearchModel SearchModel; + public IndexModel(IAccountApplication accountApplication, IRoleApplication roleApplication, IAuthHelper authHelper, ISmsService smsService, IHubContext hubContext) @@ -121,11 +123,11 @@ public class IndexModel : PageModel //); - var result = _accountApplication.getu(account.Id).GetAwaiter().GetResult(); + var result = _accountApplication.GetPmUserAsync(account.Id).GetAwaiter().GetResult(); // مثل قبل: - if (result != null) + if (result.AccountId > 0) { account.IsProgramManagerUser = (result.AccountId== account.Id && result.IsActive); account.UserRoles = result.Roles; @@ -136,6 +138,7 @@ public class IndexModel : PageModel } var pmRolseSelectList = _roleApplication.GetPmRoleList(null).GetAwaiter().GetResult(); + //سلکت لیست تمام رول های پروگرام منیجر account.RoleList = pmRolseSelectList; //var response = InternalApiCaller.GetAsync(