Added new shanks data
Added isEnabled tool field
This commit is contained in:
@@ -102,8 +102,8 @@ namespace Step.Controllers.WebApi
|
||||
IsInhibited = dtoModel.IsInhibited,
|
||||
IsInUse = dtoModel.IsInUse,
|
||||
IsMeasured = dtoModel.IsMeasured,
|
||||
ChangeTool = dtoModel.ChangeTool,
|
||||
FixedPlace = dtoModel.FixedPlace,
|
||||
InChangeTool = dtoModel.InChangeTool,
|
||||
InFixedPlace = dtoModel.InFixedPlace,
|
||||
PreAlarm = dtoModel.PreAlarm,
|
||||
|
||||
Cooling1 = dtoModel.Cooling1,
|
||||
@@ -251,12 +251,14 @@ namespace Step.Controllers.WebApi
|
||||
}
|
||||
|
||||
[Route("shank"), HttpPost]
|
||||
public IHttpActionResult AddShank()
|
||||
public IHttpActionResult AddShank([FromBody] DTOShankModel dtoShank)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ShankModel shank = (ShankModel)dtoShank;
|
||||
|
||||
ncHandler.Connect();
|
||||
CmsError libraryError = ncHandler.AddShank(out ShankModel shank);
|
||||
CmsError libraryError = ncHandler.AddShank(ref shank);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
@@ -264,7 +266,25 @@ namespace Step.Controllers.WebApi
|
||||
return Ok(shank);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Route("shank/{shankId:int}"), HttpPut]
|
||||
public IHttpActionResult UpdateShank(int shankId, [FromBody] DTOShankModel dtoShank)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ShankModel shank = (ShankModel)dtoShank;
|
||||
shank.Id = shankId;
|
||||
|
||||
ncHandler.Connect();
|
||||
CmsError libraryError = ncHandler.UpdateShank(ref shank);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok(shank);
|
||||
}
|
||||
}
|
||||
|
||||
[Route("shank/{id:int}"), HttpDelete]
|
||||
public IHttpActionResult DeleteShank(int id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user