Example #1
0
        /// <summary>
        ///     创建购买飞机接收
        /// </summary>
        /// <returns>购买飞机接收</returns>
        public static AircraftPurchaseReception CreateAircraftPurchaseReception(DateTime startDate, DateTime? endDate, Guid sourceId, string description)
        {
            var aircraftPurchaseReception = new AircraftPurchaseReception
            {
                CreateDate = DateTime.Now,
                StartDate = startDate,
                EndDate = endDate,
                SourceId = sourceId,
                Description = description,
            };

            return aircraftPurchaseReception;
        }
 /// <summary>
 ///     插入新接机日程
 /// </summary>
 /// <param name="reception">接机项目</param>
 /// <param name="schedule">接机行DTO</param>
 private void InsertReceptionSchedule(AircraftPurchaseReception reception, ReceptionScheduleDTO schedule)
 {
     // 添加接机行
     var newSchedule = new ReceptionSchedule();
     newSchedule.SetSchedule(schedule.Subject, schedule.Body, schedule.Importance, schedule.Tempo, schedule.Start,
         schedule.End, schedule.IsAllDayEvent);
     newSchedule.Group = schedule.Group;
     reception.ReceptionSchedules.Add(newSchedule);
 }
        /// <summary>
        ///     插入新接机行
        /// </summary>
        /// <param name="reception">接机项目</param>
        /// <param name="line">接机行DTO</param>
        private void InsertReceptionLine(AircraftPurchaseReception reception, AircraftPurchaseReceptionLineDTO line)
        {
            //获取合同飞机
            PurchaseContractAircraft purchaseConAc =
                _contractAircraftRepository.GetFiltered(p => p.Id == line.ContractAircraftId)
                    .OfType<PurchaseContractAircraft>().FirstOrDefault();

            // 添加接机行
            AircraftPurchaseReceptionLine newRecepitonLine =
                reception.AddNewAircraftPurchaseReceptionLine(line.ReceivedAmount);
            newRecepitonLine.AcceptedAmount = line.AcceptedAmount;
            newRecepitonLine.SetCompleted();
            newRecepitonLine.DeliverDate = line.DeliverDate;
            newRecepitonLine.DeliverPlace = line.DeliverPlace;
            newRecepitonLine.DailNumber = line.DailNumber;
            newRecepitonLine.FlightNumber = line.FlightNumber;
            newRecepitonLine.SetContractAircraft(purchaseConAc);
            newRecepitonLine.Note = line.Note;
        }