Added:
- Delete tool - Delete shank - Delete family Demo api
This commit is contained in:
@@ -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