Files
cms_thermo_active/Step/Controllers/WebApi/ToolTableController.cs
T
2018-04-18 17:33:51 +02:00

35 lines
1.0 KiB
C#

using Step.Database.Controllers;
using Step.Model.DTOModels;
using Step.NC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Web.Http;
using static CMS_CORE_Library.DataStructures;
using static Step.Model.Constants;
namespace Step.Controllers.WebApi
{
[RoutePrefix("api/tool_table")]
public class ToolTableController : ApiController
{
[Route("configuration"), HttpGet]
public IHttpActionResult GetToolTableConfiguration()
{
using (NcHandler ncHandler = new NcHandler())
{
ncHandler.Connect();
CmsError libraryError = ncHandler.GetToolTableConfiguration(out ToolTableConfiguration toolTableConfiguration);
if (libraryError.IsError())
if (libraryError.errorCode != CMS_ERROR_CODES.NOT_CONNECTED)
return BadRequest(libraryError.message);
return Ok(toolTableConfiguration);
}
}
}
}