Пример #1
0
 public void DeleteAirframeMaintainInvoice(AirframeMaintainInvoiceDTO airframeMaintainInvoice)
 {
     MaintainInvoice deleteAirframeMaintainInvoice =
         _invoiceRepository.GetMaintainInvoice(airframeMaintainInvoice.AirframeMaintainInvoiceId);
     //获取需要删除的对象。
     UpdateMaintainInvoiceLines(new List<MaintainInvoiceLineDTO>(), deleteAirframeMaintainInvoice);
     _invoiceRepository.Remove(deleteAirframeMaintainInvoice); //删除机身维修发票。
 }
Пример #2
0
 public void ModifyAirframeMaintainInvoice(AirframeMaintainInvoiceDTO airframeMaintainInvoice)
 {
     Supplier supplier = _supplierRepository.Get(airframeMaintainInvoice.SupplierId);
     airframeMaintainInvoice.SupplierName = supplier.CnName;
     MaintainInvoice updateAirframeMaintainInvoice =
         _invoiceRepository.GetMaintainInvoice(airframeMaintainInvoice.AirframeMaintainInvoiceId); //获取需要更新的对象。
     MaintainInvoiceFactory.SetMaintainInvoice(updateAirframeMaintainInvoice,
         airframeMaintainInvoice.SerialNumber,
         airframeMaintainInvoice.InvoideCode, airframeMaintainInvoice.InvoiceDate,
         airframeMaintainInvoice.SupplierName, airframeMaintainInvoice.SupplierId,
         airframeMaintainInvoice.InvoiceValue, airframeMaintainInvoice.PaidAmount,
         airframeMaintainInvoice.OperatorName,
         airframeMaintainInvoice.Reviewer, airframeMaintainInvoice.Status, airframeMaintainInvoice.CurrencyId,
         airframeMaintainInvoice.DocumentName, airframeMaintainInvoice.DocumentId,
         airframeMaintainInvoice.PaymentScheduleLineId,
         airframeMaintainInvoice.InMaintainTime, airframeMaintainInvoice.OutMaintainTime);
     UpdateMaintainInvoiceLines(airframeMaintainInvoice.MaintainInvoiceLines, updateAirframeMaintainInvoice);
     _invoiceRepository.Modify(updateAirframeMaintainInvoice);
 }
Пример #3
0
 public void InsertAirframeMaintainInvoice(AirframeMaintainInvoiceDTO airframeMaintainInvoice)
 {
     Supplier supplier = _supplierRepository.Get(airframeMaintainInvoice.SupplierId);
     airframeMaintainInvoice.SupplierName = supplier.CnName;
     AirframeMaintainInvoice newAirframeMaintainInvoice = MaintainInvoiceFactory.CreateAirframeMaintainInvoice();
     newAirframeMaintainInvoice.SetInvoiceNumber(GetMaxInvoiceNumber());
     MaintainInvoiceFactory.SetMaintainInvoice(newAirframeMaintainInvoice, airframeMaintainInvoice.SerialNumber,
         airframeMaintainInvoice.InvoideCode, airframeMaintainInvoice.InvoiceDate,
         airframeMaintainInvoice.SupplierName, airframeMaintainInvoice.SupplierId,
         airframeMaintainInvoice.InvoiceValue, airframeMaintainInvoice.PaidAmount,
         airframeMaintainInvoice.OperatorName,
         airframeMaintainInvoice.Reviewer, airframeMaintainInvoice.Status, airframeMaintainInvoice.CurrencyId,
         airframeMaintainInvoice.DocumentName, airframeMaintainInvoice.DocumentId,
         airframeMaintainInvoice.PaymentScheduleLineId,
         airframeMaintainInvoice.InMaintainTime, airframeMaintainInvoice.OutMaintainTime);
     if (airframeMaintainInvoice.MaintainInvoiceLines != null)
     {
         foreach (MaintainInvoiceLineDTO maintainInvoiceLine in airframeMaintainInvoice.MaintainInvoiceLines)
         {
             MaintainInvoiceLine newMaintainInvoiceLine = MaintainInvoiceFactory.CreateInvoiceLine();
             MaintainInvoiceFactory.SetInvoiceLine(newMaintainInvoiceLine, maintainInvoiceLine.MaintainItem,
                 maintainInvoiceLine.ItemName, maintainInvoiceLine.UnitPrice, maintainInvoiceLine.Amount,
                 maintainInvoiceLine.Note);
             newAirframeMaintainInvoice.InvoiceLines.Add(newMaintainInvoiceLine);
         }
     }
     newAirframeMaintainInvoice.SetInvoiceValue();
     _invoiceRepository.Add(newAirframeMaintainInvoice);
     var maintainCost = new RegularCheckMaintainCostDTO
     {
         MaintainInvoiceId = newAirframeMaintainInvoice.Id,
         Year = newAirframeMaintainInvoice.InvoiceDate.Year
     };
     _maintainCostAppService.InsertRegularCheckMaintainCost(maintainCost);
 }