private void Login() { try { UserModel result = _api.LoginUser(User.Phone); if (result == null) { throw new Exception("User Not Found"); } else if (User.Password == result.Password)//SecurePasswordHasherHelper.Verify(User.Password, result.Password)) { //set session data //go to dashboard _ = new AllBankAccounts(); _ = new AllTransactions(); result = setAccounts.SetBankAccounts(result); _ = new CreateData(result); Mediator.Notify(ApplicationPage.Dashboard.ToString(), ""); } else { //login failed MessageBox.Show("login failed"); } } catch (Exception) { MessageBox.Show("User Not Found"); } }
public async Task Remove(object param) { Transaction = TransactionsModel.Transaction(param as TransactionsModel); await _api.DeleteTransaction(Transaction); _ = new AllBankAccounts(); _ = new AllTransactions(); TransactionsList = _api.GetTransactionsById(DataStore.AccountNo); }
public BankAccount(Customer customer, decimal initialDeposit, string accountType) { CustomerName = $"{customer.FirstName} {customer.LastName}"; AccountType = accountType; AccountNumber = accountNumber; CustomerId = customer.CustomerId; accountNumber += 123; AllBankAccounts.Add(this); AllCustomers.Add(customer); MakeDeposite(this, initialDeposit, DateTime.Now, "initial Deposit"); }
private async Task SetBankAccount(UserModel user) { BankAccountModel details = new BankAccountModel() { Balance = 0.0M, CustomerRef = user.Id }; await API.SetBankAccount(details); _ = new AllBankAccounts(); _ = new AllTransactions(); }