Example #1
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);
        }
 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);
 }