Esempio n. 1
0
        public void EndCreatePaymentEvent(IAsyncResult result)
        {
            try
            {
                int id = PaymentEventService.EndCreatePaymentEvent(result);
                if (id != -1)
                {
                    //get the freshly add payment
                    PaymentEventViewModel paymentEvent = result.AsyncState as PaymentEventViewModel;
                    paymentEvent.Id    = id;
                    paymentEvent.IsNew = false;
                    //add it to the collection
                    PaymentEvents.Add(paymentEvent);

                    //force the update of the
                    OnPropertyChanged(() => FilteredEvents);
                    OnPropertyChanged(() => ThisMonthEvents);
                }
            }
            catch (Exception)
            {
                ErrorMessage = ViewModelsResources.ErrorSavingPaymentEvent;
                IsError      = true;
            }
            InProgress = false;
        }
Esempio n. 2
0
 public void RemovePaymentEvent(PaymentEventViewModel vm)
 {
     if (!vm.IsNew)
     {
         PaymentEventService.BeginRemovePaymentEvent(vm.Id, EndRemovePaymentEvent, vm);
         InProgress = true;
     }
 }
Esempio n. 3
0
 public bool CanUpdatePayment(PaymentEventViewModel vm)
 {
     if (vm != null)
     {
         vm.RunWhenErrorsChange = UpdatePartnerCommand.RaiseCanExecuteChanged;
     }
     return(vm != null && !vm.HasErrors);
 }
Esempio n. 4
0
 public void UpdateOrSavePayment(PaymentEventViewModel vm)
 {
     if (vm.IsNew)
     {
         PaymentEventService.BeginCreatePaymentEvent(vm.Payment, Customer.Id, EndCreatePaymentEvent, vm);
         InProgress = true;
     }
     else
     {
         PaymentEventService.BeginUpdatePaymentEvent(vm.Payment, EndUpdatePaymentEvent, vm);
         InProgress = true;
     }
 }
Esempio n. 5
0
 public bool CanRemovePaymentEvent(PaymentEventViewModel vm)
 {
     return(vm != null && !vm.IsNew);
 }