Esempio n. 1
0
 public void InsertEngineMaintainInvoice(EngineMaintainInvoiceDTO engineMaintainInvoice)
 {
     Supplier supplier = _supplierRepository.Get(engineMaintainInvoice.SupplierId);
     engineMaintainInvoice.SupplierName = supplier.CnName;
     EngineMaintainInvoice newEngineMaintainInvoice = MaintainInvoiceFactory.CreateEngineMaintainInvoice();
     newEngineMaintainInvoice.SetInvoiceNumber(GetMaxInvoiceNumber());
     MaintainInvoiceFactory.SetMaintainInvoice(newEngineMaintainInvoice, engineMaintainInvoice.SerialNumber,
         engineMaintainInvoice.InvoideCode, engineMaintainInvoice.InvoiceDate, engineMaintainInvoice.SupplierName,
         engineMaintainInvoice.SupplierId,
         engineMaintainInvoice.InvoiceValue, engineMaintainInvoice.PaidAmount, engineMaintainInvoice.OperatorName,
         engineMaintainInvoice.Reviewer, engineMaintainInvoice.Status, engineMaintainInvoice.CurrencyId,
         engineMaintainInvoice.DocumentName, engineMaintainInvoice.DocumentId,
         engineMaintainInvoice.PaymentScheduleLineId,
         engineMaintainInvoice.InMaintainTime, engineMaintainInvoice.OutMaintainTime);
     newEngineMaintainInvoice.SetType(engineMaintainInvoice.Type);
     if (engineMaintainInvoice.MaintainInvoiceLines != null)
     {
         foreach (MaintainInvoiceLineDTO maintainInvoiceLine in engineMaintainInvoice.MaintainInvoiceLines)
         {
             MaintainInvoiceLine newMaintainInvoiceLine = MaintainInvoiceFactory.CreateInvoiceLine();
             MaintainInvoiceFactory.SetInvoiceLine(newMaintainInvoiceLine, maintainInvoiceLine.MaintainItem,
                 maintainInvoiceLine.ItemName, maintainInvoiceLine.UnitPrice, maintainInvoiceLine.Amount,
                 maintainInvoiceLine.Note);
             newEngineMaintainInvoice.InvoiceLines.Add(newMaintainInvoiceLine);
         }
     }
     newEngineMaintainInvoice.SetInvoiceValue();
     _invoiceRepository.Add(newEngineMaintainInvoice);
     if (newEngineMaintainInvoice.Type == EngineMaintainInvoiceType.非FHA超包修)
     {
         var maintainCost = new NonFhaMaintainCostDTO
         {
             MaintainInvoiceId = newEngineMaintainInvoice.Id,
             Year = newEngineMaintainInvoice.InvoiceDate.Year,
             SupplierId = newEngineMaintainInvoice.SupplierId
         };
         _maintainCostAppService.InsertNonFhaMaintainCost(maintainCost);
     }
     else
     {
         var maintainCost = new FhaMaintainCostDTO
         {
             MaintainInvoiceId = newEngineMaintainInvoice.Id,
             Year = newEngineMaintainInvoice.InvoiceDate.Year
         };
         _maintainCostAppService.InsertFhaMaintainCost(maintainCost);
     }
 }
Esempio n. 2
0
 public void ModifyFhaMaintainCost(FhaMaintainCostDTO fhaMaintainCost)
 {
     var updateFhaMaintainCost = _maintainCostRepository.Get(fhaMaintainCost.Id) as FhaMaintainCost; //获取需要更新的对象。
     MaintainCostFactory.SetFhaMaintainCost(updateFhaMaintainCost, fhaMaintainCost.AircraftTypeId,
         fhaMaintainCost.EngineProperty, fhaMaintainCost.Jx,
         fhaMaintainCost.YearBudgetRate, fhaMaintainCost.Rate, fhaMaintainCost.AirHour,
         fhaMaintainCost.HourPercent, fhaMaintainCost.Hour, fhaMaintainCost.FhaFeeUsd,
         fhaMaintainCost.FhaFeeRmb, fhaMaintainCost.Custom, fhaMaintainCost.CustomAddedRmb,
         fhaMaintainCost.TotalTax, fhaMaintainCost.AddedValueRate, fhaMaintainCost.AddedValue,
         fhaMaintainCost.IncludeAddedValue, fhaMaintainCost.CustomAdded, fhaMaintainCost.MaintainInvoiceId,
         fhaMaintainCost.Year);
     _maintainCostRepository.Modify(updateFhaMaintainCost);
 }
Esempio n. 3
0
 public void DeleteFhaMaintainCost(FhaMaintainCostDTO fhaMaintainCost)
 {
     MaintainCost deleteFhaMaintainCost = _maintainCostRepository.Get(fhaMaintainCost.Id); //获取需要删除的对象。
     _maintainCostRepository.Remove(deleteFhaMaintainCost); //删除Fha维修成。
 }
Esempio n. 4
0
 public void InsertFhaMaintainCost(FhaMaintainCostDTO fhaMaintainCost)
 {
     FhaMaintainCost newFhaMaintainCost = MaintainCostFactory.CreateFhaMaintainCost();
     MaintainCostFactory.SetFhaMaintainCost(newFhaMaintainCost, fhaMaintainCost.AircraftTypeId,
         fhaMaintainCost.EngineProperty, fhaMaintainCost.Jx,
         fhaMaintainCost.YearBudgetRate, fhaMaintainCost.Rate, fhaMaintainCost.AirHour,
         fhaMaintainCost.HourPercent, fhaMaintainCost.Hour, fhaMaintainCost.FhaFeeUsd,
         fhaMaintainCost.FhaFeeRmb, fhaMaintainCost.Custom, fhaMaintainCost.CustomAddedRmb,
         fhaMaintainCost.TotalTax, fhaMaintainCost.AddedValueRate, fhaMaintainCost.AddedValue,
         fhaMaintainCost.IncludeAddedValue, fhaMaintainCost.CustomAdded, fhaMaintainCost.MaintainInvoiceId,
         fhaMaintainCost.Year);
     _maintainCostRepository.Add(newFhaMaintainCost);
 }