public async Task <IActionResult> GlobalRestrict([FromBody] GlobalRestrictionRequestModel requestModel) { try { var employees = await _restrictionRepository.GetAll(); foreach (var employee in employees) { if (!requestModel.GlobalDayLimit.HasValue) { return(BadRequest("Missing global day limit value")); } employee.GlobalDayLimit = requestModel.GlobalDayLimit.Value; _restrictionRepository.Update(employee); } await _restrictionRepository.SaveChanges(); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public Restriction Update(Restriction restriction) { return(_repo.Update(restriction)); }
public ReleaseProfile Update(ReleaseProfile restriction) { restriction.Preferred.Sort(_preferredComparer); return(_repo.Update(restriction)); }