public IActionResult GetAlternativeAppointmentsForMergeRenovation(MergeRenovationDTO mergeRenovationDTO) { List <RenovationPeriodDTO> alternativeAppointments = new List <RenovationPeriodDTO>(); try { _renovationService.GetMergeRenovationAlternativeAppointmets(MergeRenovationMapper.MergeRenovationDTOToMergeRenovation(mergeRenovationDTO)).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 AddMergeRenovation(MergeRenovationDTO mergeRenovationDTO) { MergeRenovation addedBaseRenovation = (MergeRenovation)_renovationService.AddMergeRenovation(MergeRenovationMapper.MergeRenovationDTOToMergeRenovation(mergeRenovationDTO)); if (addedBaseRenovation == null) { return(NotFound("NotFound")); } return(Ok()); }