public async void LoadAsync() { await _notifyService.Initialize(); var notifies = await _notifyService.GetBankNotifiesAsync(); foreach (var notify in notifies) { BankNotifies.Add(GenerateBankNotifyItemViewModelFromModel(notify)); } }
public async void SaveBankNotifyAsync(BankNotifyItemViewModel model) { if (_selectedBankNotify.Id == 0) { if (String.IsNullOrWhiteSpace(model.DisplayName) && String.IsNullOrWhiteSpace(model.Description)) { return; } var notifyModel = await _notifyService.CreateBankNotifyAsync(GenereateBankNotifyModelFromViewModel(model)); BankNotifies.Add(GenerateBankNotifyItemViewModelFromModel(notifyModel)); SelectedBankNotify = new BankNotifyItemViewModel(); } else { await _notifyService.UpdateBankNotifyAsync(GenereateBankNotifyModelFromViewModel(_selectedBankNotify)); } }