public IActionResult DeleteProgram([FromBody] DTO.ExProgram dataExProgram) { try { _userPrograms.DeleteProgram(dataExProgram.Id); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult EditProgram([FromBody] DTO.ExProgram dataProgram) { try { _userPrograms.EditProgram(dataProgram.Id, dataProgram.Name); return(Ok()); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult AddProgram([FromBody] DTO.ExProgram dataProgram) { try { ExProgram program = _userPrograms.CreateProgram(dataProgram.Name); return(Ok(new { program.Id })); } catch (Exception e) { return(BadRequest(e.Message)); } }