public void DeleteAcPaymentSchedule(AcPaymentScheduleDTO acPaymentSchedule)
 {
     if (acPaymentSchedule == null)
     {
         throw new Exception("飞机付款计划不能为空");
     }
     DeletePaymentSchedule(acPaymentSchedule.AcPaymentScheduleId); //删除飞机付款计划
 }
        public void ModifyAcPaymentSchedule(AcPaymentScheduleDTO acPaymentSchedule)
        {
            if (acPaymentSchedule == null)
            {
                throw new Exception("飞机付款计划不能为空");
            }
            var persistAcPayment =
                _paymentScheduleRepository.Get(acPaymentSchedule.AcPaymentScheduleId) as AircraftPaymentSchedule;
            if (persistAcPayment == null)
            {
                throw new Exception("找不到需要更新的付款计划");
            }
            //更新飞机付款计划
            if (!persistAcPayment.SupplierId.Equals(acPaymentSchedule.SupplierId))
            {
                persistAcPayment.SetSupplier(acPaymentSchedule.SupplierId, acPaymentSchedule.SupplierName);
            }
            if (!persistAcPayment.CurrencyId.Equals(acPaymentSchedule.CurrencyId))
            {
                persistAcPayment.SetCurrency(acPaymentSchedule.CurrencyId);
            }
            if (!persistAcPayment.ContractAircraftId.Equals(acPaymentSchedule.ContractAcId))
            {
                persistAcPayment.SetContractAircraft(acPaymentSchedule.ContractAcId);
            }

            UpdatePaymentSchedule(persistAcPayment, acPaymentSchedule.PaymentScheduleLines); //更新飞机付款计划
        }
        public void InsertAcPaymentSchedule(AcPaymentScheduleDTO acPaymentSchedule)
        {
            if (acPaymentSchedule == null)
            {
                throw new Exception("飞机付款计划不能为空");
            }

            PaymentSchedule newAcPaymentSchedule =
                PaymentScheduleFactory.CreateAcPaymentSchedule(acPaymentSchedule.SupplierName,
                    acPaymentSchedule.SupplierId,
                    acPaymentSchedule.CurrencyId,
                    acPaymentSchedule.ContractAcId);
            InsertPaymentSchedule(newAcPaymentSchedule, acPaymentSchedule.PaymentScheduleLines); //新增飞机付款计划
        }