Exemplo n.º 1
0
 public void Post([FromBody] Vacation.Contract.Vacation.Command.CreateVacation vacation)
 {
     _vacationRepository.AddVacation(new Model.Vacation
     {
         Id = vacation.EmployeeId.ToString() //todo
     });
 }
 public Guid RequestVacation(VacationModel request)
 {
     if (request.From >= request.To)
     {
         throw new ArgumentException("Dates invalid");
     }
     return(_vacationRepository.AddVacation(request));
 }
        public void AddVacation(Vacation vacation)
        {
            _vacationRepo.AddVacation(vacation);

            List <Employee> employees = _employeeRepo.GetAllEmployees();

            foreach (Employee employee in employees)
            {
                EmployeeBalance employeeBalance = new EmployeeBalance
                {
                    Employee = employee,
                    Vacation = vacation,
                    Balance  = vacation.Balance
                };
                _employeeBalanceRepo.AddEmployeeBalance(employeeBalance);
            }
        }