Esempio n. 1
0
 public IActionResult DeleteDay([FromBody] DTO.Day dataDay)
 {
     try
     {
         _userPrograms.DeleteDay(dataDay.Id);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Esempio n. 2
0
 public IActionResult EditDay([FromBody] DTO.Day day)
 {
     try
     {
         _userPrograms.EditDay(day.Id, day.Name);
         return(Ok());
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Esempio n. 3
0
        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));
            }
        }