update account edit method

This commit is contained in:
SamSys
2025-12-15 13:26:09 +03:30
parent a3d286c040
commit a4f3feba1c
3 changed files with 11 additions and 3 deletions

View File

@@ -74,6 +74,8 @@ public interface IAccountApplication
void CameraLogin(CameraLoginRequest request);
Task<GetPmUserDto> GetPmUserAsync(long accountId);
}
public class CameraLoginRequest

View File

@@ -999,5 +999,8 @@ public class AccountApplication : IAccountApplication
_authHelper.CameraSignIn(authViewModel);
}
public async Task<GetPmUserDto> GetPmUserAsync(long accountId)
{
return await _pmUserQueryService.GetPmUserDataByAccountId(accountId);
}
}

View File

@@ -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<RoleViewModel> Roless;
public AccountSearchModel SearchModel;
public IndexModel(IAccountApplication accountApplication, IRoleApplication roleApplication, IAuthHelper authHelper,
ISmsService smsService, IHubContext<SendAccountMessage> 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<RoleResponse>(