69 lines
1.8 KiB
C#
69 lines
1.8 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Configuration;
|
|
using MP.Data.DatabaseModels;
|
|
using MP.Data.Services;
|
|
using NLog;
|
|
using NLog.Fluent;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace MP_TAB.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class ODLController : ControllerBase
|
|
{
|
|
#region Public Constructors
|
|
|
|
public ODLController(IConfiguration configuration, OrderDataSrv DataService)
|
|
{
|
|
Log.Info("Starting ODLController");
|
|
_configuration = configuration;
|
|
CtrDataServ = DataService;
|
|
Log.Trace("Avviato ODLController");
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Methods
|
|
|
|
// GET: api/ListSelect
|
|
[HttpGet]
|
|
public string Get()
|
|
{
|
|
return "OK";
|
|
}
|
|
|
|
[HttpGet("GetODL")]
|
|
public async Task<List<ODLExpModel>> GetODL(string CodArt, string IdxMacchina)
|
|
{
|
|
List<ODLExpModel> answ = new List<ODLExpModel>();
|
|
await Task.Delay(1);
|
|
try
|
|
{
|
|
answ = await CtrDataServ.ListODLFilt(CodArt, IdxMacchina);
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
Log.Error($"Eccezione in GetODL | CodArt: {CodArt} | IdxMacchina: {IdxMacchina}{Environment.NewLine}{exc}");
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Private Fields
|
|
|
|
private static IConfiguration _configuration = null!;
|
|
|
|
private static Logger Log = LogManager.GetCurrentClassLogger();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
private OrderDataSrv CtrDataServ { get; set; } = null!;
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |