Files
NKC/NKC_WF/Controllers/BunkController.cs
T

91 lines
1.8 KiB
C#

using AppData;
using NKC_SDK;
using System.Web.Http;
namespace NKC_WF.Controllers
{
public class BunkController : ApiController
{
/// <summary>
/// Restituisce il FIRST BUNK da lavorare
/// </summary>
/// <returns></returns>
// GET: api/Bunk
[HttpGet]
public ProdBunk Get()
{
ProdBunk answ = null;
try
{
answ = ComLib.prodGetFirstBunk();
}
catch
{ }
return answ;
}
/// <summary>
/// Ottengo NEXT BUNK
/// </summary>
/// <param name="id"></param>
/// <param name="showNext"></param>
/// <returns></returns>
// GET: api/GetNext/5
[HttpGet]
public ProdBunk Get(int id, bool showNext)
{
ProdBunk answ = null;
try
{
if (showNext)
{
answ = ComLib.prodGetNextBunk(id);
}
else
{
answ = ComLib.prodGetBunk(id);
}
}
catch
{ }
return answ;
}
/// <summary>
/// Effettua la chaimata di update
/// </summary>
/// <param name="id"></param>
/// <param name="value"></param>
// PUT: api/Bunk/5
[HttpPut]
public void Put(ProdBunk currBunk)
{
// se non nullo...
if (currBunk != null)
{
foreach (var item in currBunk.SheetList)
{
DataLayer.man.taSHL.updateDate(item.SheetId, item.Printing.DtStart, item.Printing.DtEnd, item.Machining.DtStart, item.Machining.DtEnd, item.Unloading.DtStart, item.Unloading.DtEnd);
}
}
// INVALIDO eventuale valore BUNK in REDIS...
ComLib.resetRedisBunkData();
}
#if false
// POST: api/Bunk
[HttpPost]
public void Post([FromBody]string value)
{
}
// DELETE: api/Bunk/5
[HttpDelete]
public void Delete(int id)
{
}
#endif
}
}