Пример #1
0
        public async Task <IActionResult> Index(CancellationToken cancellationToken)
        {
            Guid UserID = Guid.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value);

            List <Transact> wallets = await TransactRepository.GetWalletByUserIdAsync(UserID, cancellationToken);

            WalletTransactViewModel model = new WalletTransactViewModel
            {
                Wallets = wallets
            };

            return(PartialView("WalletTransactionPartialView", model));
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync(string Id, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(Id))
            {
                ViewData["Error"] = "شناسه نا معتبر";
                return(Page());
            }
            CustomUser user = await CustomUserManager.FindByIdAsync(Id);

            Model = Mapper.Map(user, Model);
            List <string> roles = CustomUserManager.GetRolesAsync(user).GetAwaiter().GetResult().ToList();

            Model.SelectedRoles = roles.Select(c => new RoleModel {
                Name = c, Checked = true
            }).ToList();
            List <Transact> transactList = await TransactRepository.GetWalletByUserIdAsync(user.Id, cancellationToken);

            Model.Transactions = Mapper.Map <List <TransactModel> >(transactList);
            return(Page());
        }