public void DeleteEngineMaintainPlan(EngineMaintainPlanDTO engineMaintainPlan)
 {
     EngineMaintainPlan deleteEngineMaintainPlan =
         _aunualMaintainPlanRepository.GetEngineMaintainPlan(engineMaintainPlan.Id); //获取需要删除的对象。
     UpdateEngineMaintainPlanDetails(new List<EngineMaintainPlanDetailDTO>(), deleteEngineMaintainPlan);
     _aunualMaintainPlanRepository.Remove(deleteEngineMaintainPlan); //删除发动机维修计划。
 }
 public void ModifyEngineMaintainPlan(EngineMaintainPlanDTO engineMaintainPlan)
 {
     EngineMaintainPlan updateEngineMaintainPlan =
         _aunualMaintainPlanRepository.GetEngineMaintainPlan(engineMaintainPlan.Id); //获取需要更新的对象。
     AnnualMaintainPlanFactory.SetEngineMaintainPlan(updateEngineMaintainPlan,
         engineMaintainPlan.MaintainPlanType, engineMaintainPlan.DollarRate, engineMaintainPlan.CompanyLeader,
         engineMaintainPlan.DepartmentLeader, engineMaintainPlan.BudgetManager,
         engineMaintainPlan.PhoneNumber, engineMaintainPlan.AnnualId);
     UpdateEngineMaintainPlanDetails(engineMaintainPlan.EngineMaintainPlanDetails, updateEngineMaintainPlan);
     _aunualMaintainPlanRepository.Modify(updateEngineMaintainPlan);
 }
 public void InsertEngineMaintainPlan(EngineMaintainPlanDTO engineMaintainPlan)
 {
     EngineMaintainPlan newEngineMaintainPlan = AnnualMaintainPlanFactory.CreatEngineMaintainPlan();
     AnnualMaintainPlanFactory.SetEngineMaintainPlan(newEngineMaintainPlan, engineMaintainPlan.MaintainPlanType,
         engineMaintainPlan.DollarRate, engineMaintainPlan.CompanyLeader, engineMaintainPlan.DepartmentLeader,
         engineMaintainPlan.BudgetManager,
         engineMaintainPlan.PhoneNumber, engineMaintainPlan.AnnualId);
     if (engineMaintainPlan.EngineMaintainPlanDetails != null)
     {
         foreach (
             EngineMaintainPlanDetailDTO engineMaintainPlanLine in engineMaintainPlan.EngineMaintainPlanDetails)
         {
             EngineMaintainPlanDetail newEngineMaintainPlanLine =
                 AnnualMaintainPlanFactory.CreatEngineMaintainPlanDetail();
             AnnualMaintainPlanFactory.SetEngineMaintainPlanDetail(newEngineMaintainPlanLine,
                 engineMaintainPlanLine.ChangeLlpFee, engineMaintainPlanLine.ChangeLlpNumber,
                 engineMaintainPlanLine.CustomsTax, engineMaintainPlanLine.EngineNumber,
                 engineMaintainPlanLine.FreightFee, engineMaintainPlanLine.InMaintainDate,
                 engineMaintainPlanLine.MaintainLevel, engineMaintainPlanLine.NonFhaFee,
                 engineMaintainPlanLine.Note, engineMaintainPlanLine.OutMaintainDate,
                 engineMaintainPlanLine.PartFee,
                 engineMaintainPlanLine.TsnCsn, engineMaintainPlanLine.TsrCsr,
                 engineMaintainPlanLine.FeeLittleSum, engineMaintainPlanLine.FeeTotalSum,
                 engineMaintainPlanLine.BudgetToalSum);
             newEngineMaintainPlan.EngineMaintainPlanDetails.Add(newEngineMaintainPlanLine);
         }
     }
     _aunualMaintainPlanRepository.Add(newEngineMaintainPlan);
 }