Exemple #1
0
 /// <summary>
 ///     新增审批历史(申请明细)
 /// </summary>
 /// <returns></returns>
 public ApprovalHistory AddNewApprovalHistory(Guid id,int seatingCapacity, decimal carryingCapacity,
     int requestDeliverMonth, string note,
     Guid requestId, Guid planAircraftId, Guid importCategoryId, Guid requestDeliverAnnualId, Guid airlinesId)
 {
     var approvalHistory = new ApprovalHistory();
     approvalHistory.SetSeatingCapacity(seatingCapacity);
     approvalHistory.SetCarryingCapacity(carryingCapacity);
     approvalHistory.SetRequest(requestId);
     approvalHistory.SetNote(note);
     approvalHistory.SetDeliverDate(requestDeliverAnnualId, requestDeliverMonth);
     approvalHistory.SetRequest(requestId);
     approvalHistory.SetPlanAircraft(planAircraftId);
     approvalHistory.SetImportCategory(importCategoryId);
     approvalHistory.SetAirlines(airlinesId);
     approvalHistory.SetId(id);
     ApprovalHistories.Add(approvalHistory);
     return approvalHistory;
 }
Exemple #2
0
 /// <summary>
 ///     删除申请明细时的记录
 /// </summary>
 /// <param name="request">申请明细</param>
 /// <param name="approvalHistory">申请明细</param>
 private void DeleteLog(Request request, ApprovalHistory approvalHistory)
 {
     string log = "删除申请明细:" + approvalHistory.RequestDeliverAnnual.Year + "/" +
                  approvalHistory.RequestDeliverMonth + "|" + approvalHistory.ImportCategory.ActionType + ":" +
                  approvalHistory.ImportCategory.ActionName + "|" +
                  approvalHistory.PlanAircraft.AircraftType.Name;
     request.SetNote(log);
 }
Exemple #3
0
 /// <summary>
 ///     修改申请明细
 /// </summary>
 /// <param name="approvalHistory"></param>
 /// <param name="pesistApprovalHistory"></param>
 private void ModifyApprovalHistory(ApprovalHistoryDTO approvalHistory, ApprovalHistory pesistApprovalHistory)
 {
     if (pesistApprovalHistory.SeatingCapacity != approvalHistory.SeatingCapacity)
     {
         pesistApprovalHistory.SetSeatingCapacity(approvalHistory.SeatingCapacity);
     }
     if (pesistApprovalHistory.CarryingCapacity != approvalHistory.CarryingCapacity)
     {
         pesistApprovalHistory.SetCarryingCapacity(approvalHistory.CarryingCapacity);
     }
     if (pesistApprovalHistory.RequestDeliverMonth != approvalHistory.RequestDeliverMonth)
     {
         pesistApprovalHistory.SetDeliverDate(approvalHistory.RequestDeliverMonth);
     }
     if (pesistApprovalHistory.Note != approvalHistory.Note)
     {
         pesistApprovalHistory.SetNote(approvalHistory.Note);
     }
     if (pesistApprovalHistory.RequestId != approvalHistory.RequestId)
     {
         pesistApprovalHistory.SetRequest(approvalHistory.RequestId);
     }
     if (pesistApprovalHistory.RequestId != approvalHistory.RequestId)
     {
         pesistApprovalHistory.SetRequest(approvalHistory.RequestId);
     }
     if (pesistApprovalHistory.PlanAircraftId != approvalHistory.PlanAircraftId)
     {
         pesistApprovalHistory.SetPlanAircraft(approvalHistory.PlanAircraftId);
     }
     if (pesistApprovalHistory.ImportCategoryId != approvalHistory.ImportCategoryId)
     {
         pesistApprovalHistory.SetImportCategory(approvalHistory.ImportCategoryId);
     }
     if (pesistApprovalHistory.RequestDeliverAnnualId != approvalHistory.RequestDeliverAnnualId)
     {
         pesistApprovalHistory.SetDeliverDate(approvalHistory.RequestDeliverAnnualId);
     }
     if (pesistApprovalHistory.IsApproved != approvalHistory.IsApproved)
     {
         pesistApprovalHistory.SetIsApproved(approvalHistory.IsApproved);
     }
     PlanAircraft persistPlanAircraft = _planAircraftRepository.Get(approvalHistory.PlanAircraftId);
     if (persistPlanAircraft.Status != (ManageStatus) approvalHistory.PlanAircraftStatus)
     {
         if (pesistApprovalHistory.PlanAircraft.Status == ManageStatus.申请
             && approvalHistory.PlanAircraftStatus == (int) ManageStatus.批文)
         {
             pesistApprovalHistory.PlanAircraft.SetManageStatus(ManageStatus.批文); //修改计划飞机为批文状态
         }
         if (pesistApprovalHistory.PlanAircraft.Status == ManageStatus.批文
             && approvalHistory.PlanAircraftStatus == (int) ManageStatus.申请)
         {
             pesistApprovalHistory.PlanAircraft.SetManageStatus(ManageStatus.申请);
         }
     }
 }
Exemple #4
0
 /// <summary>
 ///     删除申请明细
 /// </summary>
 /// <param name="approvalHistory">申请明细</param>
 private void DeleteApprovalHistory(ApprovalHistory approvalHistory)
 {
     _requestRepository.DelApprovalHistory(approvalHistory);
 }