/// <summary>
        ///     插入新接机行
        /// </summary>
        /// <param name="reception">接机项目</param>
        /// <param name="line">接机行DTO</param>
        private void InsertReceptionLine(EnginePurchaseReception reception, EnginePurchaseReceptionLineDTO line)
        {
            //获取合同发动机
            PurchaseContractEngine purchaseConEngine =
                _contractEngineRepository.GetFiltered(p => p.Id == line.ContractEngineId)
                    .OfType<PurchaseContractEngine>().FirstOrDefault();

            // 添加接机行
            EnginePurchaseReceptionLine newRecepitonLine =
                reception.AddNewEnginePurchaseReceptionLine(line.ReceivedAmount);
            newRecepitonLine.AcceptedAmount = line.AcceptedAmount;
            newRecepitonLine.SetCompleted();
            newRecepitonLine.DeliverDate = line.DeliverDate;
            newRecepitonLine.DeliverPlace = line.DeliverPlace;
            newRecepitonLine.SetContractEngine(purchaseConEngine);
            newRecepitonLine.Note = line.Note;
        }
 /// <summary>
 ///     插入新接机日程
 /// </summary>
 /// <param name="reception">接机项目</param>
 /// <param name="schedule">接机行DTO</param>
 private void InsertReceptionSchedule(EnginePurchaseReception 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);
 }
示例#3
0
        /// <summary>
        ///     创建购买发动机接收
        /// </summary>
        /// <returns>购买发动机接收</returns>
        public static EnginePurchaseReception CreateEnginePurchaseReception(DateTime startDate, DateTime? endDate, Guid sourceId, string description)
        {
            var enginePurchaseReception = new EnginePurchaseReception
            {
                CreateDate = DateTime.Now,
                StartDate = startDate,
                EndDate = endDate,
                SourceId = sourceId,
                Description = description,
            };

            return enginePurchaseReception;
        }