コード例 #1
0
ファイル: LeaveService.cs プロジェクト: Voltage825/DDD_Dojo
        public void CreateLeave(LeaveInputModel input)
        {
            LeaveEntry leave = new LeaveEntry
            {
                EmployeeId  = input.EmployeeId,
                StartDate   = input.StartDate,
                EndDate     = input.EndDate,
                LeaveType   = input.LeaveType,
                LeaveStatus = LeaveStatus.Pending,
            };
            var escalationList = this.GetApprovers(input.EmployeeId, input.LeaveType);

            leave.Approvers.AddRange(escalationList);
            leave.CurrentApprover = leave.Approvers.First();
            this.leaveRepository.Insert(leave);
        }
コード例 #2
0
 public void CreateLeave(LeaveInputModel input)
 {
     LeaveEntry leave = new LeaveEntry
                            {
                                EmployeeId = input.EmployeeId,
                                StartDate = input.StartDate,
                                EndDate = input.EndDate,
                                LeaveType = input.LeaveType,
                                LeaveStatus = LeaveStatus.Pending,
                             };
     var escalationList = this.GetApprovers(input.EmployeeId, input.LeaveType);
     leave.Approvers.AddRange(escalationList);
     leave.CurrentApprover = leave.Approvers.First();
     this.leaveRepository.Insert(leave);
 }