Aggiunta classe descr materiali e relativo WebAPI controller

This commit is contained in:
Samuele E. Locatelli
2019-11-13 19:38:36 +01:00
parent 773869c370
commit ffce73f47a
3 changed files with 81 additions and 1 deletions
+15 -1
View File
@@ -135,7 +135,21 @@ namespace NKC_SDK
/// </summary>
public List<NestSheet> SheetList { get; set; }
}
/// <summary>
/// Definizione classe x materiali
/// </summary>
public class Material
{
public int MatID { get; set; } = 0;
public int MatExtCode { get; set; } = 0;
public string MatDesc { get; set; } = "";
public DateTime ApprovDate { get; set; } = DateTime.Now;
public string ApprovUser { get; set; } = "";
public decimal L_mm { get; set; } = 0;
public decimal W_mm { get; set; } = 0;
public decimal T_mm { get; set; } = 0;
public string MatDtmx { get; set; } = "";
}
/// <summary>
/// Classe che rappresenta stato ordine ricevuto via REDIS da NESTING
/// </summary>
+64
View File
@@ -0,0 +1,64 @@
using AppData;
using NKC_SDK;
using System.Collections.Generic;
using System.Web.Http;
namespace NKC_WF.Controllers
{
public class MaterialController : ApiController
{
/// <summary>
/// Restituisce ELENCO materiali
/// </summary>
/// <returns></returns>
// GET: api/Bunk
[HttpGet]
public List<Material> Get()
{
List<Material> answ = new List<Material>();
var table = DataLayer.man.taMat.GetData();
Material currMat = new Material();
foreach (var item in table)
{
currMat = new Material()
{
MatID = item.MatID,
MatDesc = item.MatDesc,
MatExtCode = item.MatExtCode,
MatDtmx = item.MatDtmx,
ApprovDate = item.ApprovDate,
ApprovUser = item.ApprovUser,
L_mm = item.L_mm,
W_mm = item.W_mm,
T_mm = item.T_mm
};
answ.Add(currMat);
}
return answ;
}
#if false
// GET: api/Barch/5
public string Get(int id)
{
return "value";
}
// POST: api/Barch
public void Post([FromBody]string value)
{
}
// PUT: api/Barch/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE: api/Barch/5
public void Delete(int id)
{
}
#endif
}
}
+2
View File
@@ -381,9 +381,11 @@
<Compile Include="Contact.aspx.designer.cs">
<DependentUpon>Contact.aspx</DependentUpon>
</Compile>
<Compile Include="Controllers\BatchController.cs" />
<Compile Include="Controllers\getMUCssRevController.cs" />
<Compile Include="Controllers\getMUCssController.cs" />
<Compile Include="Controllers\BunkController.cs" />
<Compile Include="Controllers\MaterialController.cs" />
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>