Ejemplo n.º 1
0
 public IActionResult DeleteProgram([FromBody] DTO.ExProgram dataExProgram)
 {
     try
     {
         _userPrograms.DeleteProgram(dataExProgram.Id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 2
0
 public IActionResult EditProgram([FromBody] DTO.ExProgram dataProgram)
 {
     try
     {
         _userPrograms.EditProgram(dataProgram.Id, dataProgram.Name);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Ejemplo n.º 3
0
 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));
     }
 }