Modifiche oggetti x deserializzazione JSon

This commit is contained in:
Samuele E. Locatelli
2019-11-25 17:53:00 +01:00
parent 01bc02e3c6
commit c08c626324
2 changed files with 28 additions and 17 deletions
+25 -14
View File
@@ -114,7 +114,7 @@ namespace NKC_SDK
/// <summary>
/// Cod ITEM di NKC
/// </summary>
public int PartId { get; set; }
public int PartId { get; set; } = 0;
/// <summary>
/// Codice ITEM esterno da cliente (HFA)
/// </summary>
@@ -182,7 +182,18 @@ namespace NKC_SDK
/// <summary>
/// Num di fogli nello stack
/// </summary>
public int NumSheet { get; set; }
public int NumSheet
{
get
{
int answ = 0;
if (SheetList != null)
{
answ = SheetList.Count;
}
return answ;
}
}
/// <summary>
/// Elenco Sheet previsti
/// </summary>
@@ -212,39 +223,39 @@ namespace NKC_SDK
/// <summary>
/// ID univoco invio del TASK
/// </summary>
public string envNum { get; set; } = "";
public string EnvNum { get; set; } = "";
/// <summary>
/// Tipo di processing richiesto
/// 1 = stima
/// 2 = nesting
/// </summary>
public int procType { get; set; }
public int ProcType { get; set; } = 0;
/// <summary>
/// Codice della amcchina x cui si effettua richiesta
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public mType machineType { get; set; }
public mType MachineType { get; set; } = mType.Multiax;
/// <summary>
/// Tipo di ordine richiesto
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public oType orderType { get; set; }
public oType OrderType { get; set; } = oType.BatchRequest;
/// <summary>
/// Status del processo di nesting
/// </summary>
public procStatus ProcessStatus { get; set; }
public procStatus ProcessStatus { get; set; } = procStatus.waiting;
/// <summary>
/// Note libere del nesting
/// </summary>
public string ProcessNotes { get; set; }
public string ProcessNotes { get; set; } = "";
/// <summary>
/// Tempo di processing del Nesting espresso in Secondi
/// </summary>
public double ProcessingRuntime { get; set; }
public double ProcessingRuntime { get; set; } = 0;
/// <summary>
/// Tempo STIMATO di taglio calcolato dal Nesting espresso in Secondi
/// </summary>
public double EstimatedWorktime { get; set; }
public double EstimatedWorktime { get; set; } = 0;
}
/// <summary>
/// Risposta NESTING x la STIMA iniziale
@@ -254,7 +265,7 @@ namespace NKC_SDK
/// <summary>
/// Elenco Items da produrre x ordine
/// </summary>
public List<Part> Items { get; set; }
public List<Part> PartList { get; set; }
}
/// <summary>
/// Risposta NESTING x la STIMA iniziale
@@ -264,7 +275,7 @@ namespace NKC_SDK
/// <summary>
/// Elenco Stack previsti
/// </summary>
public List<NestBunk> Stacks { get; set; }
public List<NestBunk> BunkList { get; set; }
}
@@ -298,9 +309,9 @@ namespace NKC_SDK
public List<Part> Items { get; set; }
/// <summary>
/// Elenco Stack previsti
/// Elenco Bunk previsti
/// </summary>
public List<NestBunk> Stacks { get; set; }
public List<NestBunk> Bunks { get; set; }
}
#endregion
+3 -3
View File
@@ -107,9 +107,9 @@ namespace NKC_WF.Controllers
*
*************************************************/
if (currBunk.orderType == oType.BatchRequest)
if (currBunk.OrderType == oType.BatchRequest)
{
if (currBunk.procType == 1)
if (currBunk.ProcType == 1)
{
// deserializzo come BatchreqIniziale (stima)
nestReplyBatchInitial rispStima = JsonConvert.DeserializeObject<nestReplyBatchInitial>(content);
@@ -128,7 +128,7 @@ namespace NKC_WF.Controllers
answ = "OK";
}
}
else if (currBunk.orderType == oType.OfflineOrder)
else if (currBunk.OrderType == oType.OfflineOrder)
{
// deserializzo come OfflineOrder
nestReplyOffOrd rispNest = JsonConvert.DeserializeObject<nestReplyOffOrd>(content);