/// <summary> /// 创建租赁发动机接收 /// </summary> /// <returns>租赁发动机接收</returns> public static EngineLeaseReception CreateEngineLeaseReception(DateTime startDate, DateTime? endDate, Guid sourceId, string description) { var engineLeaseReception = new EngineLeaseReception { CreateDate = DateTime.Now, StartDate = startDate, EndDate = endDate, SourceId = sourceId, Description = description, }; return engineLeaseReception; }
/// <summary> /// 插入新接机日程 /// </summary> /// <param name="reception">接机项目</param> /// <param name="schedule">接机行DTO</param> private void InsertReceptionSchedule(EngineLeaseReception 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(EngineLeaseReception reception, EngineLeaseReceptionLineDTO line) { //获取合同发动机 LeaseContractEngine leaseConEngine = _contractEngineRepository.GetFiltered(p => p.Id == line.ContractEngineId) .OfType<LeaseContractEngine>().FirstOrDefault(); // 添加接机行 EngineLeaseReceptionLine newRecepitonLine = reception.AddNewEngineLeaseReceptionLine(line.ReceivedAmount); newRecepitonLine.AcceptedAmount = line.AcceptedAmount; newRecepitonLine.SetCompleted(); newRecepitonLine.DeliverDate = line.DeliverDate; newRecepitonLine.DeliverPlace = line.DeliverPlace; newRecepitonLine.SetContractEngine(leaseConEngine); newRecepitonLine.Note = line.Note; }