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);
 }
Beispiel #2
0
 public void ModifyRegularCheckMaintainCost(RegularCheckMaintainCostDTO regularCheckMaintainCost)
 {
     var updateRegularCheckMaintainCost =
         _maintainCostRepository.Get(regularCheckMaintainCost.Id) as RegularCheckMaintainCost; //获取需要更新的对象。
     MaintainCostFactory.SetRegularCheckMaintainCost(updateRegularCheckMaintainCost,
         regularCheckMaintainCost.AircraftId, regularCheckMaintainCost.ActionCategoryId,
         regularCheckMaintainCost.AircraftTypeId,
         regularCheckMaintainCost.RegularCheckType, regularCheckMaintainCost.RegularCheckLevel,
         regularCheckMaintainCost.InMaintainTime, regularCheckMaintainCost.OutMaintainTime,
         regularCheckMaintainCost.TotalDays,
         regularCheckMaintainCost.DepartmentDeclareAmount, regularCheckMaintainCost.FinancialApprovalAmount,
         regularCheckMaintainCost.FinancialApprovalAmountNonTax, regularCheckMaintainCost.MaintainInvoiceId,
         regularCheckMaintainCost.Year);
     _maintainCostRepository.Modify(updateRegularCheckMaintainCost);
 }
Beispiel #3
0
 public void DeleteRegularCheckMaintainCost(RegularCheckMaintainCostDTO regularCheckMaintainCost)
 {
     MaintainCost deleteRegularCheckMaintainCost = _maintainCostRepository.Get(regularCheckMaintainCost.Id);
         //获取需要删除的对象。
     _maintainCostRepository.Remove(deleteRegularCheckMaintainCost); //删除定检维修成。
 }
Beispiel #4
0
 public void InsertRegularCheckMaintainCost(RegularCheckMaintainCostDTO regularCheckMaintainCost)
 {
     RegularCheckMaintainCost newRegularCheckMaintainCost = MaintainCostFactory.CreateRegularCheckMaintainCost();
     MaintainCostFactory.SetRegularCheckMaintainCost(newRegularCheckMaintainCost,
         regularCheckMaintainCost.AircraftId, regularCheckMaintainCost.ActionCategoryId,
         regularCheckMaintainCost.AircraftTypeId,
         regularCheckMaintainCost.RegularCheckType, regularCheckMaintainCost.RegularCheckLevel,
         regularCheckMaintainCost.InMaintainTime, regularCheckMaintainCost.OutMaintainTime,
         regularCheckMaintainCost.TotalDays,
         regularCheckMaintainCost.DepartmentDeclareAmount, regularCheckMaintainCost.FinancialApprovalAmount,
         regularCheckMaintainCost.FinancialApprovalAmountNonTax, regularCheckMaintainCost.MaintainInvoiceId,
         regularCheckMaintainCost.Year);
     _maintainCostRepository.Add(newRegularCheckMaintainCost);
 }