Added active program management

This commit is contained in:
Lucio Maranta
2018-07-30 17:30:19 +02:00
parent 861726005d
commit 019939a616
10 changed files with 140 additions and 3 deletions
+17 -1
View File
@@ -1,4 +1,5 @@
using Step.NC;
using Step.Model.DTOModels;
using Step.NC;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -45,5 +46,20 @@ namespace Step.Controllers.WebApi
return Ok(fileInfo);
}
}
[Route("file/active"), HttpPut]
public IHttpActionResult SetActiveProgram([FromUri]string filePath)
{
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError cmsError = ncHandler.SetActiveProgramInfo(filePath, out DTOActiveProgramDataModel fileInfo);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
return Ok(fileInfo);
}
}
}
}