public IActionResult GetAlternativeAppointmentsForDivideRenovation(DivideRenovationDTO divideRenovationDTO) { List <RenovationPeriodDTO> alternativeAppointments = new List <RenovationPeriodDTO>(); try { _renovationService.GetDivideRenovationAlternativeAppointmets(DivideRenovationMapper.DivideRenovationDTOToDivideRenovation(divideRenovationDTO)).ToList().ForEach(x => alternativeAppointments.Add(new RenovationPeriodDTO(x.BeginDate, x.EndDate))); if (alternativeAppointments.Count == 0) { return(NotFound("NotFound")); } return(Ok(alternativeAppointments)); } catch (Exception e) { return(NotFound(e.Message)); } }
public ActionResult AddDivideRenovation(DivideRenovationDTO divideRenovationDTO) { DivideRenovation addedBaseRenovation = (DivideRenovation)_renovationService.AddDivideRenovation(DivideRenovationMapper.DivideRenovationDTOToDivideRenovation(divideRenovationDTO)); if (addedBaseRenovation == null) { return(NotFound("NotFound")); } return(Ok()); }