Browse Source

dashboard data dynamic, user details fetch from session storage

feature/Redmine-18711-Receiver_Module_for_Web
arjundhami123 1 year ago
parent
commit
c881627a1a
  1. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/DesignTimeBuild/.dtbcache.v2
  2. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/813e5e72-e4b3-4f66-9466-3e9816506926.vsidx
  3. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/dd6572ed-0f7d-4953-bb34-95fd8cf2d9f4.vsidx
  4. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/e201466f-7afd-4ac3-ab72-025f5b13ea31.vsidx
  5. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/fbb38871-b706-413e-8e30-23cbfacd185a.vsidx
  6. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.futdcache.v2
  7. BIN
      CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo
  8. BIN
      CustomerOnlineRemit/.vs/ProjectEvaluation/customeronlineremit.metadata.v7.bin
  9. BIN
      CustomerOnlineRemit/.vs/ProjectEvaluation/customeronlineremit.projects.v7.bin
  10. 6
      CustomerOnlineRemit/CustomerOnlineRemit.Business/Business/Account/AccountBusiness.cs
  11. 6
      CustomerOnlineRemit/CustomerOnlineRemit.Business/Business/Account/IAccountBusiness.cs
  12. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Business.dll
  13. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Business.pdb
  14. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll
  15. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb
  16. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll
  17. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb
  18. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.csproj.AssemblyReference.cache
  19. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.dll
  20. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.pdb
  21. 1
      CustomerOnlineRemit/CustomerOnlineRemit.Common/Model/CommonResponse.cs
  22. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll
  23. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb
  24. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/CustomerOnlineRemit.Common.dll
  25. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/CustomerOnlineRemit.Common.pdb
  26. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/ref/CustomerOnlineRemit.Common.dll
  27. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/refint/CustomerOnlineRemit.Common.dll
  28. 22
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/Repository/Account/AccountRepository.cs
  29. 6
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/Repository/Account/IAccountRepository.cs
  30. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll
  31. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb
  32. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll
  33. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb
  34. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.csproj.AssemblyReference.cache
  35. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.dll
  36. BIN
      CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.pdb
  37. 12
      CustomerOnlineRemit/CustomerOnlineRemit/Authentication/CustomAuthenticationStateProvider.cs
  38. 17
      CustomerOnlineRemit/CustomerOnlineRemit/Data/Account/AccountServices.cs
  39. 26
      CustomerOnlineRemit/CustomerOnlineRemit/Helper/LoginUserInfo.cs
  40. 9
      CustomerOnlineRemit/CustomerOnlineRemit/Helper/SessionHelper/ILoginUserInfo.cs
  41. 37
      CustomerOnlineRemit/CustomerOnlineRemit/Helper/SessionHelper/LoginUserInfo.cs
  42. 3
      CustomerOnlineRemit/CustomerOnlineRemit/Program.cs
  43. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Business.dll
  44. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Business.pdb
  45. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll
  46. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb
  47. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll
  48. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb
  49. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.dll
  50. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.pdb
  51. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.csproj.AssemblyReference.cache
  52. 2
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.csproj.CoreCompileInputs.cache
  53. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.dll
  54. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.pdb
  55. 2
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/project.razor.vs.json
  56. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/ref/CustomerOnlineRemit.dll
  57. BIN
      CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/refint/CustomerOnlineRemit.dll

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/DesignTimeBuild/.dtbcache.v2

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/813e5e72-e4b3-4f66-9466-3e9816506926.vsidx

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/dd6572ed-0f7d-4953-bb34-95fd8cf2d9f4.vsidx

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/e201466f-7afd-4ac3-ab72-025f5b13ea31.vsidx

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/FileContentIndex/fbb38871-b706-413e-8e30-23cbfacd185a.vsidx

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.futdcache.v2

BIN
CustomerOnlineRemit/.vs/CustomerOnlineRemit/v17/.suo

BIN
CustomerOnlineRemit/.vs/ProjectEvaluation/customeronlineremit.metadata.v7.bin

BIN
CustomerOnlineRemit/.vs/ProjectEvaluation/customeronlineremit.projects.v7.bin

6
CustomerOnlineRemit/CustomerOnlineRemit.Business/Business/Account/AccountBusiness.cs

@ -18,17 +18,17 @@ namespace CustomerOnlineRemit.Business.Business.Account
return _accountRepo.DoLoginAsync(loginModel);
}
public Task<CommonResponse> GetDynamicTable(string flag)
public Task<CommonResponse> GetDynamicTable(string flag, LoginResponse loginDetails)
{
return _accountRepo.GetDynamicTable(flag);
}
public Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll)
public Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll, LoginResponse loginDetails)
{
return _accountRepo.GetCustomerReceiverList(ShowAll);
}
public Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll)
public Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll, LoginResponse loginDetails)
{
return _accountRepo.GetCustomerTransactionList(ShowAll);
}

6
CustomerOnlineRemit/CustomerOnlineRemit.Business/Business/Account/IAccountBusiness.cs

@ -7,8 +7,8 @@ namespace CustomerOnlineRemit.Business.Business.Account
public interface IAccountBusiness
{
Task<LoginResponse> DoLoginAsync(LoginModel loginModel);
Task<CommonResponse> GetDynamicTable(string flag);
Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll);
Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll);
Task<CommonResponse> GetDynamicTable(string flag, LoginResponse loginDetails);
Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll, LoginResponse loginDetails);
Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll, LoginResponse loginDetails);
}
}

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Business.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Business.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.csproj.AssemblyReference.cache

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Business/obj/Debug/net7.0/CustomerOnlineRemit.Business.pdb

1
CustomerOnlineRemit/CustomerOnlineRemit.Common/Model/CommonResponse.cs

@ -30,7 +30,6 @@
public string Id { get; set; }
public dynamic Data { get; set; }
public List<dynamic> ListData { get; set; }
public string Extra { get; set; }
public string Extra2 { get; set; }

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/CustomerOnlineRemit.Common.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/ref/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Common/obj/Debug/net7.0/refint/CustomerOnlineRemit.Common.dll

22
CustomerOnlineRemit/CustomerOnlineRemit.Repository/Repository/Account/AccountRepository.cs

@ -25,11 +25,11 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
{
var sql = "EXEC proc_online_customer_login";
sql += " @Flag = " + _dbHelper.FilterString("l");
sql += ", @customerEmail = " + _dbHelper.FilterString(loginModel.UserName);
sql += ", @customerPassword = " + _dbHelper.FilterString(loginModel.Password);
sql += ", @ipAddress = " + _dbHelper.FilterString(loginModel.IpAddress);
sql += ", @sessionId = " + _dbHelper.FilterString(loginModel.SessionId);
sql += ", @LogInfo = N" + _dbHelper.FilterString(JsonConvert.SerializeObject(loginModel.LoginInfo));
sql += ",@customerEmail = " + _dbHelper.FilterString(loginModel.UserName);
sql += ",@customerPassword = " + _dbHelper.FilterString(loginModel.Password);
sql += ",@ipAddress = " + _dbHelper.FilterString(loginModel.IpAddress);
sql += ",@sessionId = " + _dbHelper.FilterString(loginModel.SessionId);
sql += ",@LogInfo = N" + _dbHelper.FilterString(JsonConvert.SerializeObject(loginModel.LoginInfo));
Log.Debug("ACCOUNTREPOSITORY | DOLOGINASYNC | SQL | " + sql);
var dr = _dbHelper.ExecuteDataRow(sql);
@ -56,7 +56,7 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
_response.GoogleAuthCode = "";
_response.MobileNumber = Convert.ToString(dr["mobile"]);
_response.RememberMe = loginModel.RememberMe;
_response.SessionId = Convert.ToString(dr["username"]);
_response.SessionId = loginModel.SessionId;
}
}
}
@ -70,14 +70,14 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
return Task.FromResult(_response);
}
public Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll)
public Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll, LoginResponse loginDetails)
{
CustomerReceiverModel _response = new CustomerReceiverModel();
try
{
var sql = "EXEC PROC_DYNAMIC_TABLE";
sql += " @Flag = " + _dbHelper.FilterString("CustomerReceiver");
sql += " @ShowAll = " + _dbHelper.FilterString(ShowAll.ToString());
sql += ",@ShowAll = " + _dbHelper.FilterString(ShowAll.ToString());
Log.Debug("ACCOUNTREPOSITORY | GETCUSTOMERRECEIVERLIST | SQL | " + sql);
var dt = _dbHelper.ExecuteDataTable(sql);
@ -119,14 +119,14 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
return Task.FromResult(_response);
}
public Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll)
public Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll, LoginResponse loginDetails)
{
CustomerTransactionList _response = new CustomerTransactionList();
try
{
var sql = "EXEC PROC_DYNAMIC_TABLE";
sql += " @Flag = " + _dbHelper.FilterString("CustomerTxn");
sql += " @ShowAll = " + _dbHelper.FilterString(ShowAll.ToString());
sql += ",@ShowAll = " + _dbHelper.FilterString(ShowAll.ToString());
Log.Debug("ACCOUNTREPOSITORY | GETCUSTOMERTRANSACTIONLIST | SQL | " + sql);
var dt = _dbHelper.ExecuteDataTable(sql);
@ -171,7 +171,7 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
return Task.FromResult(_response);
}
public Task<CommonResponse> GetDynamicTable(string flag)
public Task<CommonResponse> GetDynamicTable(string flag, LoginResponse loginDetails)
{
CommonResponse _response = new CommonResponse();
try

6
CustomerOnlineRemit/CustomerOnlineRemit.Repository/Repository/Account/IAccountRepository.cs

@ -7,8 +7,8 @@ namespace CustomerOnlineRemit.Repository.Repository.Account
public interface IAccountRepository
{
Task<LoginResponse> DoLoginAsync(LoginModel loginModel);
Task<CommonResponse> GetDynamicTable(string flag);
Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll);
Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll);
Task<CommonResponse> GetDynamicTable(string flag, LoginResponse loginDetails);
Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll, LoginResponse loginDetails);
Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll, LoginResponse loginDetails);
}
}

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.csproj.AssemblyReference.cache

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit.Repository/obj/Debug/net7.0/CustomerOnlineRemit.Repository.pdb

12
CustomerOnlineRemit/CustomerOnlineRemit/Authentication/CustomAuthenticationStateProvider.cs

@ -36,7 +36,6 @@ namespace CustomerOnlineRemit.Authentication
{
return await Task.FromResult(new AuthenticationState(_anonymous));
}
}
public async Task UpdateAuthenticationState(LoginResponse userSession)
@ -49,7 +48,16 @@ namespace CustomerOnlineRemit.Authentication
claimsPrincipal = new ClaimsPrincipal(new ClaimsIdentity(new List<Claim>
{
new Claim(ClaimTypes.Name, userSession.UserName)
new Claim(ClaimTypes.Name, userSession.UserName),
new Claim("UserName", userSession.UserName),
new Claim("UserId", userSession.UserId),
new Claim("FullName", userSession.FullName),
new Claim("MobileNumber", userSession.MobileNumber),
new Claim("Email", userSession.Email),
new Claim("RememberMe", Convert.ToString(userSession.RememberMe)),
new Claim("ForceChangePassword", Convert.ToString(userSession.ForceChangePassword)),
new Claim("GoogleAuthCode", userSession.GoogleAuthCode),
new Claim("SessionId", userSession.SessionId)
}));
}
else

17
CustomerOnlineRemit/CustomerOnlineRemit/Data/Account/AccountServices.cs

@ -3,6 +3,7 @@ using CustomerOnlineRemit.Business.Business.Account;
using CustomerOnlineRemit.Common.Model;
using CustomerOnlineRemit.Common.Model.Account;
using CustomerOnlineRemit.Common.Model.Customer;
using CustomerOnlineRemit.Helper.SessionHelper;
using Microsoft.AspNetCore.Components.Authorization;
namespace CustomerOnlineRemit.Data.Account
@ -12,24 +13,24 @@ namespace CustomerOnlineRemit.Data.Account
private readonly IAccountBusiness _accountBusiness;
private readonly HttpClient _httpClient;
private readonly AuthenticationStateProvider _authStateProvider;
private readonly ILoginUserInfo _loginInfo;
public AccountServices(IAccountBusiness accountBusiness, IHttpClientFactory httpClientFactory, AuthenticationStateProvider authStateProvider)
public AccountServices(IAccountBusiness accountBusiness, IHttpClientFactory httpClientFactory, AuthenticationStateProvider authStateProvider, ILoginUserInfo loginInfo)
{
_accountBusiness = accountBusiness;
_httpClient = httpClientFactory.CreateClient("MyInternalClient");
_authStateProvider = authStateProvider;
_loginInfo = loginInfo;
}
public async Task<CommonResponse> DoLoginAsync(LoginModel loginModel)
{
loginModel.SessionId = Guid.NewGuid().ToString();
var response = await _accountBusiness.DoLoginAsync(loginModel);
if (response.ResponseCode == ResponseHelper.SUCCESS)
{
var customAuthStateProvider = (CustomAuthenticationStateProvider)_authStateProvider;
await customAuthStateProvider.UpdateAuthenticationState(new LoginResponse
{
UserName = response.UserName
});
await customAuthStateProvider.UpdateAuthenticationState(response);
}
return response;
}
@ -41,12 +42,14 @@ namespace CustomerOnlineRemit.Data.Account
public async Task<CustomerReceiverModel> GetCustomerReceiverList(bool ShowAll)
{
return await _accountBusiness.GetCustomerReceiverList(ShowAll);
var loginDetails = await _loginInfo.GetLoginDetails();
return await _accountBusiness.GetCustomerReceiverList(ShowAll, loginDetails);
}
public async Task<CustomerTransactionList> GetCustomerTransactionList(bool ShowAll)
{
return await _accountBusiness.GetCustomerTransactionList(ShowAll);
var loginDetails = await _loginInfo.GetLoginDetails();
return await _accountBusiness.GetCustomerTransactionList(ShowAll, loginDetails);
}
}
}

26
CustomerOnlineRemit/CustomerOnlineRemit/Helper/LoginUserInfo.cs

@ -1,26 +0,0 @@
using CustomerOnlineRemit.Common.Model.Account;
using System.Security.Claims;
namespace CustomerOnlineRemit.Helper
{
public static class LoginUserInfo
{
public static LoginResponse GetLoginDetails(this HttpContext context)
{
var claimIdentity = context.User.Identity as ClaimsIdentity;
var model = new LoginResponse();
if (claimIdentity.IsAuthenticated)
{
model.UserName = claimIdentity.FindFirst(x => x.Type == "UserName").Value;
model.FullName = claimIdentity.FindFirst(x => x.Type == ClaimTypes.Name).Value;
model.ForceChangePassword = Convert.ToBoolean(claimIdentity.FindFirst(x => x.Type == "ForceChangePassword").Value);
model.MobileNumber = claimIdentity.FindFirst(x => x.Type == "MobileNumber").Value;
model.Email = claimIdentity.FindFirst(x => x.Type == "Email").Value;
model.RememberMe = Convert.ToBoolean(claimIdentity.FindFirst(x => x.Type == "RememberMe").Value);
model.SessionId = claimIdentity.FindFirst(x => x.Type == "SessionId").Value;
}
return model;
}
}
}

9
CustomerOnlineRemit/CustomerOnlineRemit/Helper/SessionHelper/ILoginUserInfo.cs

@ -0,0 +1,9 @@
using CustomerOnlineRemit.Common.Model.Account;
namespace CustomerOnlineRemit.Helper.SessionHelper
{
public interface ILoginUserInfo
{
Task<LoginResponse> GetLoginDetails();
}
}

37
CustomerOnlineRemit/CustomerOnlineRemit/Helper/SessionHelper/LoginUserInfo.cs

@ -0,0 +1,37 @@
using CustomerOnlineRemit.Common.Model;
using CustomerOnlineRemit.Common.Model.Account;
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
namespace CustomerOnlineRemit.Helper.SessionHelper
{
public class LoginUserInfo : ILoginUserInfo
{
private ProtectedSessionStorage _sessionStorage;
public LoginUserInfo(ProtectedSessionStorage sessionStorage)
{
_sessionStorage = sessionStorage;
}
public async Task<LoginResponse> GetLoginDetails()
{
LoginResponse _response = new LoginResponse();
try
{
var userSessionStorageResult = await _sessionStorage.GetAsync<LoginResponse>("UserSession");
_response = userSessionStorageResult.Success ? userSessionStorageResult.Value : null;
if (_response == null)
return await Task.FromResult(_response);
_response.ResponseCode = ResponseHelper.SUCCESS;
_response.ResponseMessage = ResponseMessageHelper.SUCCESS;
}
catch (Exception ex)
{
_response.ResponseCode = ResponseHelper.EXCEPTION;
_response.ResponseMessage = "Exception occured: " + ex.Message;
}
return await Task.FromResult(_response);
}
}
}

3
CustomerOnlineRemit/CustomerOnlineRemit/Program.cs

@ -20,6 +20,7 @@ using CustomerOnlineRemit.Authentication;
using CustomerOnlineRemit.Business.Business.Account;
using CustomerOnlineRemit.Components;
using CustomerOnlineRemit.Data.Account;
using CustomerOnlineRemit.Helper.SessionHelper;
using CustomerOnlineRemit.Repository.ConnectionServices;
using CustomerOnlineRemit.Repository.Repository.Account;
using Microsoft.AspNetCore.Authentication.Cookies;
@ -45,7 +46,9 @@ builder.Services.AddScoped<ToastAlertComponent>();
builder.Services.AddScoped<AccountServices>();
builder.Services.AddScoped<ProtectedSessionStorage>();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
builder.Services.AddScoped<IAccountBusiness, AccountBusiness>();
builder.Services.AddScoped<ILoginUserInfo, LoginUserInfo>();
builder.Services.AddScoped<IAccountRepository, AccountRepository>();
builder.Services.AddScoped<IDBServiceUtility, DBServiceUtility>();
builder.Services.AddScoped<IAccountServices, AccountServices>();

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Business.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Business.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Common.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Common.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Repository.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.Repository.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/bin/Debug/net7.0/CustomerOnlineRemit.pdb

BIN
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.csproj.AssemblyReference.cache

2
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.csproj.CoreCompileInputs.cache

@ -1 +1 @@
c9a9879ded997bbd3c7e9f4d75a3412de67cca8f
75000278dd7cb78eba52acf79768445f3457e302

BIN
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/CustomerOnlineRemit.pdb

2
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/project.razor.vs.json
File diff suppressed because it is too large
View File

BIN
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/ref/CustomerOnlineRemit.dll

BIN
CustomerOnlineRemit/CustomerOnlineRemit/obj/Debug/net7.0/refint/CustomerOnlineRemit.dll

Loading…
Cancel
Save