Exemplo n.º 1
0
        public async void DeleteAllBankNotifyAsync()
        {
            await _notifyService.DeleteAllBankNotifiesAsync();

            BankNotifies.Clear();
            SelectedBankNotify = new BankNotifyItemViewModel();
        }
Exemplo n.º 2
0
        public async void DeleteBankNotifyAsync()
        {
            if (_selectedBankNotify.Id != 0)
            {
                await _notifyService.DeleteBankNotifyAsync(GenereateBankNotifyModelFromViewModel(_selectedBankNotify));

                BankNotifies.Remove(_selectedBankNotify);
                SelectedBankNotify = new BankNotifyItemViewModel();
            }
        }
Exemplo n.º 3
0
        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));
            }
        }
Exemplo n.º 4
0
 public void AddEmptySelectedValue()
 {
     SelectedBankNotify = new BankNotifyItemViewModel();
 }
Exemplo n.º 5
0
 public BankNotifyViewModel(IBankNotifyService notifyService)
 {
     _notifyService     = notifyService;
     BankNotifies       = new ObservableCollection <BankNotifyItemViewModel>();
     SelectedBankNotify = new BankNotifyItemViewModel();
 }
Exemplo n.º 6
0
 private static BankNotifyModel GenereateBankNotifyModelFromViewModel(BankNotifyItemViewModel viewModel)
 {
     return(new BankNotifyModel(viewModel.Id, viewModel.DisplayName, viewModel.Description, viewModel.Created, viewModel.IsReaded));
 }