示例#1
0
 public IActionResult DeleteProgram([FromBody] DTO.ExProgram dataExProgram)
 {
     try
     {
         _userPrograms.DeleteProgram(dataExProgram.Id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
示例#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));
     }
 }
示例#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));
     }
 }