예제 #1
0
 public void InsertUndercartMaintainInvoice(UndercartMaintainInvoiceDTO undercartMaintainInvoice)
 {
     Supplier supplier = _supplierRepository.Get(undercartMaintainInvoice.SupplierId);
     undercartMaintainInvoice.SupplierName = supplier.CnName;
     UndercartMaintainInvoice newUndercartMaintainInvoice =
         MaintainInvoiceFactory.CreateUndercartMaintainInvoice();
     newUndercartMaintainInvoice.SetInvoiceNumber(GetMaxInvoiceNumber());
     MaintainInvoiceFactory.SetMaintainInvoice(newUndercartMaintainInvoice, undercartMaintainInvoice.SerialNumber,
         undercartMaintainInvoice.InvoideCode, undercartMaintainInvoice.InvoiceDate,
         undercartMaintainInvoice.SupplierName, undercartMaintainInvoice.SupplierId,
         undercartMaintainInvoice.InvoiceValue, undercartMaintainInvoice.PaidAmount,
         undercartMaintainInvoice.OperatorName,
         undercartMaintainInvoice.Reviewer, undercartMaintainInvoice.Status, undercartMaintainInvoice.CurrencyId,
         undercartMaintainInvoice.DocumentName, undercartMaintainInvoice.DocumentId,
         undercartMaintainInvoice.PaymentScheduleLineId,
         undercartMaintainInvoice.InMaintainTime, undercartMaintainInvoice.OutMaintainTime);
     if (undercartMaintainInvoice.MaintainInvoiceLines != null)
     {
         foreach (MaintainInvoiceLineDTO maintainInvoiceLine in undercartMaintainInvoice.MaintainInvoiceLines)
         {
             MaintainInvoiceLine newMaintainInvoiceLine = MaintainInvoiceFactory.CreateInvoiceLine();
             MaintainInvoiceFactory.SetInvoiceLine(newMaintainInvoiceLine, maintainInvoiceLine.MaintainItem,
                 maintainInvoiceLine.ItemName, maintainInvoiceLine.UnitPrice, maintainInvoiceLine.Amount,
                 maintainInvoiceLine.Note);
             newUndercartMaintainInvoice.InvoiceLines.Add(newMaintainInvoiceLine);
         }
     }
     newUndercartMaintainInvoice.SetInvoiceValue();
     _invoiceRepository.Add(newUndercartMaintainInvoice);
     var maintainCost = new UndercartMaintainCostDTO
     {
         MaintainInvoiceId = newUndercartMaintainInvoice.Id,
         Year = newUndercartMaintainInvoice.InvoiceDate.Year
     };
     _maintainCostAppService.InsertUndercartMaintainCost(maintainCost);
 }
예제 #2
0
 public void InsertUndercartMaintainCost(UndercartMaintainCostDTO undercartMaintainCost)
 {
     UndercartMaintainCost newUndercartMaintainCost = MaintainCostFactory.CreateUndercartMaintainCost();
     MaintainCostFactory.SetUndercartMaintainCost(newUndercartMaintainCost, undercartMaintainCost.AircraftId,
         undercartMaintainCost.ActionCategoryId, undercartMaintainCost.AircraftTypeId,
         undercartMaintainCost.Type, undercartMaintainCost.Part, undercartMaintainCost.InMaintainTime,
         undercartMaintainCost.OutMaintainTime, undercartMaintainCost.TotalDays,
         undercartMaintainCost.DepartmentDeclareAmount, undercartMaintainCost.FinancialApprovalAmount,
         undercartMaintainCost.FinancialApprovalAmountNonTax, undercartMaintainCost.MaintainInvoiceId,
         undercartMaintainCost.MaintainFeeEur, undercartMaintainCost.Rate, undercartMaintainCost.MaintainFeeRmb,
         undercartMaintainCost.FreightFee, undercartMaintainCost.ReplaceFee, undercartMaintainCost.CustomRate,
         undercartMaintainCost.Custom, undercartMaintainCost.AddedValueRate, undercartMaintainCost.AddedValue,
         undercartMaintainCost.Year);
     _maintainCostRepository.Add(newUndercartMaintainCost);
 }
예제 #3
0
 public void ModifyUndercartMaintainCost(UndercartMaintainCostDTO undercartMaintainCost)
 {
     var updateUndercartMaintainCost =
         _maintainCostRepository.Get(undercartMaintainCost.Id) as UndercartMaintainCost; //获取需要更新的对象。
     MaintainCostFactory.SetUndercartMaintainCost(updateUndercartMaintainCost, undercartMaintainCost.AircraftId,
         undercartMaintainCost.ActionCategoryId, undercartMaintainCost.AircraftTypeId,
         undercartMaintainCost.Type, undercartMaintainCost.Part, undercartMaintainCost.InMaintainTime,
         undercartMaintainCost.OutMaintainTime, undercartMaintainCost.TotalDays,
         undercartMaintainCost.DepartmentDeclareAmount, undercartMaintainCost.FinancialApprovalAmount,
         undercartMaintainCost.FinancialApprovalAmountNonTax, undercartMaintainCost.MaintainInvoiceId,
         undercartMaintainCost.MaintainFeeEur, undercartMaintainCost.Rate, undercartMaintainCost.MaintainFeeRmb,
         undercartMaintainCost.FreightFee, undercartMaintainCost.ReplaceFee, undercartMaintainCost.CustomRate,
         undercartMaintainCost.Custom, undercartMaintainCost.AddedValueRate, undercartMaintainCost.AddedValue,
         undercartMaintainCost.Year);
     _maintainCostRepository.Modify(updateUndercartMaintainCost);
 }
예제 #4
0
 public void DeleteUndercartMaintainCost(UndercartMaintainCostDTO undercartMaintainCost)
 {
     MaintainCost deleteUndercartMaintainCost = _maintainCostRepository.Get(undercartMaintainCost.Id);
         //获取需要删除的对象。
     _maintainCostRepository.Remove(deleteUndercartMaintainCost); //删除起落架维修成。
 }