Пример #1
0
 public IActionResult Post(Automation auto)
 {
     try
     {
         if (SystemStatus.RsvSvc == false)
         {
             if (auto.Command == "start")
             {
                 reserve.DayChecker(auto.Command);
                 SystemStatus.RsvSvc = true;
                 return(Ok("Starting service..."));
             }
             return(BadRequest("Service can not start"));
         }
         return(Conflict("Service already started"));
     } catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }