示例#1
0
        public void SelectedSOAResult(object payload)
        {
            var item = payload as BillPaymentInfo;

            if (item != null)
            {
                if (!this.Model.PaymentDetails.Any(x => x.Bill.Id == item.Id))
                {
                    var payment = PaymentDetail.New();
                    payment.Bill           = item;
                    payment.PaymentType    = CargoConstants.PaymentTypes.Cash.Id;
                    payment.RefDate        = new Csla.SmartDate(DateTime.Now);
                    payment.PartialPayment = item.AmountPaid;
                    payment.AmountDue      = item.AmountDue;
                    this.Model.PaymentDetails.Add(payment);
                }
                else
                {
                    NavigationManager.ShowMessage("Error", "Selected SOA already exists on the list, please retry.", MessageBoxButton.OK);
                }
            }
            EventAggregator.GetEvent <CommonEvents.DialogResultEvent>().Unsubscribe(SelectedSOAResult);
        }