private void InternalTransfer() { var s = Computing.ComputeChecksum("001168340011225033158321"); try { var action = new AccountActionModel(eActionType.InternalTransfer, DestinationOwnerName, DestinationIdNumber, OwnerName, BankIdNumber, Title, Amount); var actionDto = Mapper.Map <AccountActionDto>(action); ErrorLabel = Visibility.Hidden; using (var client = new Service.AccountManagerClient()) { var result = client.Transfer(actionDto); if (result.Success()) { _navigationService.NavigateTo("BankPage", ""); } else { ErrorMessage = result.Result.ExceptionMessage; ErrorLabel = Visibility.Visible; } } } catch (Exception ex) { ErrorMessage = ex.Message; ErrorLabel = Visibility.Visible; } }
private void withdrawal() { try { var action = new AccountActionModel(eActionType.Withdrawal, OwnerName, BankIdNumber, OwnerName, BankIdNumber, "Deposit", Amount); var actionDto = Mapper.Map <AccountActionDto>(action); ErrorLabel = Visibility.Hidden; using (var client = new Service.AccountManagerClient()) { var result = client.Withdraw(actionDto); if (result.Success()) { refresh(); //_navigationService.NavigateTo("BankPage", ""); } else { ErrorMessage = result.Result.ExceptionMessage; ErrorLabel = Visibility.Visible; } } } catch (Exception ex) { ErrorMessage = ex.Message; ErrorLabel = Visibility.Visible; } }
private void getAccount(int userId) { using (var client = new Service.AccountManagerClient()) { var result = client.GetBankAccount(userId); if (result.Success()) { _accountModel = Mapper.Map <BankAccountModel>(result.Data); } } }
private void getHistory(int bankId) { History.Clear(); using (var client = new Service.AccountManagerClient()) { var result = client.GetHistory(bankId); if (result.Success()) { var historyList = Mapper.Map <List <HistoryEntryModel> >(result.Data); foreach (var entry in historyList) { History.Add(entry); } } } }