public void Apply(AccountAdded e) { var acct = Accounts.Find(a => a.AccountNumber.Equals(e.Account.AccountNumber)); if (acct == null) { Accounts.Add(e.Account); } }
public void AddAccount(AccountCurrency currency, string type, string name) { if (Data is List <Account> dataList) { var acc = new Account(currency, type, name); dataList.Add(acc); AccountAdded?.Invoke(this, new AccountManagerEventArgs(acc, AccountManagerEventType.AccountAdded)); } }
protected override void InsertItem(int index, Account item) { base.InsertItem(index, item); if (AccountAdded != null) { FrostbiteConnection.RaiseEvent(AccountAdded.GetInvocationList(), item); } }
async void OnSave(object sender, EventArgs e) { var account = BindingContext as Account; if (String.IsNullOrWhiteSpace(account.Name)) { await DisplayAlert("Error", "Please enter name for entry", "OK"); return; } //Check if this is a new account or an edit of existing account if (account.Status == null) { AccountAdded?.Invoke(this, account); } else { AccountUpdated?.Invoke(this, account); } await Navigation.PopAsync(); }
public override Task Handle(AccountAdded request, CancellationToken cancellationToken) { return(Unit.Task); }
public void Apply(AccountAdded e) { var balance = new AccountBalance(e.Available, e.Current, e.Limit); Accounts[e.AccountId] = new Account(e.AccountId, e.Name, e.OfficialName, e.Type, e.SubType, e.AccessToken, e.BankId, e.BankName, e.Timestamp, balance); }