예제 #1
0
        public async Task <IActionResult> Create(WalletVM wallet)
        {
            try
            {
                WalletDTO createdWallet = await _walletService.CreateNewWallet(wallet.UniqueMasterCitizenNumber,
                                                                               wallet.PostalIndexNumber,
                                                                               wallet.SupportedBankId,
                                                                               wallet.FirstName,
                                                                               wallet.LastName);

                IEnumerable <SupportedBankVM> supportedBankVMs = (await _supportedBankService.GetAllSupportedBanksAsync()).ToSupportedBankVMs();
                var pageVM = new UpsertWalletVM(wallet, supportedBankVMs);
                ViewData["Success"] = $"Your password is {createdWallet.Password}";
                return(View(pageVM));
            }
            catch (Exception e)
            {
                IEnumerable <SupportedBankVM> supportedBankVMs = (await _supportedBankService.GetAllSupportedBanksAsync()).ToSupportedBankVMs();
                var pageVM = new UpsertWalletVM(wallet, supportedBankVMs);
                ViewData["Error"] = e.Message;
                return(View(pageVM));
            }
        }
        public async Task <WalletDTO> ArrangeWallet()
        {
            WalletDTO wallet = await _walletService.CreateNewWallet("2108996781057", "0612", 1, "Stefan", "Burgic");

            return(wallet);
        }