Added api to modify offsets
And magazine signalR
This commit is contained in:
@@ -233,6 +233,41 @@ namespace Step.Controllers.WebApi
|
||||
|
||||
#endregion Tools
|
||||
|
||||
#region Offsets
|
||||
|
||||
[Route("offset/{offsetId:int}"), HttpPut]
|
||||
public IHttpActionResult UpdateOffset(short offsetId, OffsetModel offsetData)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError cmsError = ncHandler.UpdateOffset(offsetId, offsetData);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
|
||||
offsetData.Id = offsetId;
|
||||
return Ok(offsetData);
|
||||
}
|
||||
}
|
||||
|
||||
[Route("tool/{toolId:int}/position/{positionId:int}/offset/{offsetId:int}"), HttpPut]
|
||||
public IHttpActionResult UpdateToolOffset(int toolId, int positionId, short offsetId)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError cmsError = ncHandler.UpdateToolOffsetId(toolId, positionId, offsetId, out DTONcToolModel tool);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
|
||||
return Ok(tool);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Shanks
|
||||
|
||||
[Route("shanks"), HttpGet]
|
||||
@@ -673,21 +708,5 @@ namespace Step.Controllers.WebApi
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("offset/{offsetId:int}"), HttpPut]
|
||||
public IHttpActionResult UpdateOffset(short offsetId, OffsetModel offsetData)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
|
||||
CmsError cmsError = ncHandler.UpdateOffset(offsetId, offsetData);
|
||||
if (cmsError.IsError())
|
||||
return BadRequest(cmsError.localizationKey);
|
||||
|
||||
offsetData.Id = offsetId;
|
||||
return Ok(offsetData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user