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

@@ -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>(