Ejemplo n.º 1
0
 /// <summary>
 ///     更新适用飞机集合
 /// </summary>
 /// <param name="sourceApplicableAircrafts">客户端集合</param>
 /// <param name="dstScn">数据库集合</param>
 private void UpdateApplicableAircrafts(IEnumerable<ApplicableAircraftDTO> sourceApplicableAircrafts, Scn dstScn)
 {
     var applicableAircrafts = new List<ApplicableAircraft>();
     foreach (ApplicableAircraftDTO sourceApplicableAircraft in sourceApplicableAircrafts)
     {
         ApplicableAircraft result =
             dstScn.ApplicableAircrafts.FirstOrDefault(p => p.Id == sourceApplicableAircraft.Id);
         if (result == null)
         {
             result = ScnFactory.CreateApplicableAircraft();
             result.ChangeCurrentIdentity(sourceApplicableAircraft.Id);
         }
         ScnFactory.SetApplicableAircraft(result, sourceApplicableAircraft.CompleteDate,
             sourceApplicableAircraft.Cost, sourceApplicableAircraft.ContractAircraftId);
         applicableAircrafts.Add(result);
     }
     dstScn.ApplicableAircrafts.ToList().ForEach(p =>
     {
         if (applicableAircrafts.FirstOrDefault(t => t.Id == p.Id) == null)
         {
             _scnRepository.RemoveApplicableAircraft(p);
         }
     });
     dstScn.ApplicableAircrafts = applicableAircrafts;
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     设置Scn属性
 /// </summary>
 /// <param name="scn">Scn</param>
 /// <param name="title">标题</param>
 /// <param name="type">SCN类型</param>
 /// <param name="checkDate">确认日期</param>
 /// <param name="cscNumber">批次号</param>
 /// <param name="modNumber">MOD号</param>
 /// <param name="rfcNumber">RFC号</param>
 /// <param name="validDate">有效期</param>
 /// <param name="cost">费用</param>
 /// <param name="scnNumber">SCN号</param>
 /// <param name="scnType">SCN适用类型</param>
 /// <param name="scnStatus">SCN状态</param>
 /// <param name="description">描述</param>
 /// <param name="scnDocName">Scn文档名称</param>
 /// <param name="scnDocumentId">SCN文件</param>
 /// <param name="receiveDate">接收日期</param>
 /// <param name="auditOrganization">审核部门</param>
 /// <param name="auditor">审核人</param>
 /// <param name="auditTime">审核时间</param>
 /// <param name="auditNotes">审核意见</param>
 public static void SetScn(Scn scn,string title, int type, DateTime checkDate, string cscNumber, string modNumber,string rfcNumber,
     string validDate, decimal cost, string scnNumber, int scnType, int scnStatus, string description, string scnDocName, Guid scnDocumentId,
    DateTime receiveDate, string auditOrganization, string auditor, DateTime? auditTime, string auditNotes)
 {
     scn.Title = title;
     scn.SetType((ScnType)type);
     scn.SetCheckDate(checkDate);
     scn.SetCscNumber(cscNumber);
     scn.SetModNumber(modNumber, rfcNumber);
     scn.SetValidDate(validDate);
     scn.SetCost(cost);
     scn.SetScnNumber(scnNumber);
     scn.SetScnType((ScnApplicableType)scnType);
     scn.SetScnStatus((ScnStatus)scnStatus);
     scn.SetDescription(description);
     scn.SetScnDocument(scnDocName, scnDocumentId);
     scn.SetReceiveDate(receiveDate);
     scn.SetAuditMsg(auditOrganization, auditor, auditTime, auditNotes);
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     插入适用飞机
 /// </summary>
 /// <param name="scn">SCN</param>
 /// <param name="applicableAircraftDto">适用飞机DTO</param>
 private void InsertApplicableAircraft(Scn scn, ApplicableAircraftDTO applicableAircraftDto)
 {
     // 添加基本构型
     ApplicableAircraft newApplicableAircraft = scn.AddNewApplicableAircraft();
     ScnFactory.SetApplicableAircraft(newApplicableAircraft, applicableAircraftDto.CompleteDate,
         applicableAircraftDto.Cost, applicableAircraftDto.ContractAircraftId);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 创建Scn。
 /// </summary>
 ///  <returns>Scn</returns>
 public static Scn CreateScn()
 {
     var scn = new Scn();
     scn.GenerateNewIdentity();
     return scn;
 }