public IActionResult DeleteDay([FromBody] DTO.Day dataDay) { try { _userPrograms.DeleteDay(dataDay.Id); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult EditDay([FromBody] DTO.Day day) { try { _userPrograms.EditDay(day.Id, day.Name); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult AddDay([FromBody] DTO.Day dataDay) { try { Day day = _userPrograms.CreateDay(dataDay.Program, dataDay.Name); return(Ok(new { day.Id, day.Name, ProgramId = day.Program.Id })); } catch (Exception e) { return(BadRequest(e.Message)); } }