Added:
- Delete tool - Delete shank - Delete family Demo api
This commit is contained in:
Binary file not shown.
@@ -769,6 +769,20 @@ namespace Step.NC
|
||||
return numericalControl.TOOLS_WUpdateMagazinesPositions(magazinePosition);
|
||||
}
|
||||
|
||||
public CmsError DeleteTool(int id)
|
||||
{
|
||||
return numericalControl.TOOLS_WDeleteTool(id);
|
||||
}
|
||||
|
||||
public CmsError DeleteShank(int id)
|
||||
{
|
||||
return numericalControl.TOOLS_WDeleteShank(id);
|
||||
}
|
||||
|
||||
public CmsError DeleteFamily(string name)
|
||||
{
|
||||
return numericalControl.TOOLS_WDeleteFamily(name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion Write data
|
||||
|
||||
@@ -229,5 +229,55 @@ namespace Step.Controllers.WebApi
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("tool/{id:int}"), HttpDelete]
|
||||
public IHttpActionResult DeleteTool(int id)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.DeleteTool(id);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("shank/{id:int}"), HttpDelete]
|
||||
public IHttpActionResult DeleteShank(int id)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.DeleteShank(id);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[Route("family/{name}"), HttpDelete]
|
||||
public IHttpActionResult DeleteFamily(string name)
|
||||
{
|
||||
using (NcHandler ncHandler = new NcHandler())
|
||||
{
|
||||
ncHandler.Connect();
|
||||
// Call delete library function
|
||||
CmsError libraryError = ncHandler.DeleteFamily(name);
|
||||
if (libraryError.IsError())
|
||||
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
|
||||
return BadRequest(libraryError.message);
|
||||
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user