diff --git a/AppData/ProdLib.cs b/AppData/ProdLib.cs index bd5b8c3..733973c 100644 --- a/AppData/ProdLib.cs +++ b/AppData/ProdLib.cs @@ -1,4 +1,5 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -238,6 +239,26 @@ namespace AppData } } } + /// + /// Helper x serializzare l'oggetto + /// + /// + /// + public static string serializeTakt(Takt currData) + { + string answ = JsonConvert.SerializeObject(currData); + return answ; + } + /// + /// Helper x deserializzare l'oggetto + /// + /// + /// + public static Takt deserializeTakt(string rawData) + { + Takt answ = JsonConvert.DeserializeObject(rawData); + return answ; + } #endregion diff --git a/NKC_WF/Utility.aspx b/NKC_WF/Utility.aspx index 8771e49..1aae83a 100644 --- a/NKC_WF/Utility.aspx +++ b/NKC_WF/Utility.aspx @@ -13,8 +13,8 @@
- Max Panels per stack:
- + Num Panels per stack:
+

diff --git a/NKC_WF/Utility.aspx.cs b/NKC_WF/Utility.aspx.cs index 930bbc9..da1eee9 100644 --- a/NKC_WF/Utility.aspx.cs +++ b/NKC_WF/Utility.aspx.cs @@ -17,7 +17,7 @@ namespace NKC_WF { txtCodTakt.Text = $"{DateTime.Now:yyyyMMdd}.1"; txtNumStaks.Text = "3"; - txtMaxPanels.Text = "10"; + txtNumPanels.Text = "5"; } } @@ -30,15 +30,12 @@ namespace NKC_WF return answ; } } - protected int maxNumPanels + protected int numPanels { get { int answ = 0; - Int32.TryParse(txtMaxPanels.Text, out answ); - // randomizzo da 1 a max... - Random rand = new Random(); - answ = rand.Next(1, answ); + Int32.TryParse(txtNumPanels.Text, out answ); return answ; } } @@ -59,7 +56,7 @@ namespace NKC_WF { // devo creare fino a maxNumPanels panelList = new List(); - for (int j = 1; j <= maxNumPanels; j++) + for (int j = 1; j <= numPanels; j++) { currMaterial = new ProdLib.MaterialData() { @@ -107,12 +104,14 @@ namespace NKC_WF Status = ProdLib.CStatus.Programmed, StackList = stackList }; - // salvo serializzato su etichetta - string jsonData = JsonConvert.SerializeObject(currTakt); + // serializzo + //string jsonData = JsonConvert.SerializeObject(currTakt); + string jsonData = ProdLib.serializeTakt(currTakt); + // scrivo su label lblOut.Text = jsonData; - // salvo in redis / DB + } } } \ No newline at end of file diff --git a/NKC_WF/Utility.aspx.designer.cs b/NKC_WF/Utility.aspx.designer.cs index d5ca84f..6d228ac 100644 --- a/NKC_WF/Utility.aspx.designer.cs +++ b/NKC_WF/Utility.aspx.designer.cs @@ -31,13 +31,13 @@ namespace NKC_WF { protected global::System.Web.UI.WebControls.TextBox txtNumStaks; /// - /// Controllo txtMaxPanels. + /// Controllo txtNumPanels. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::System.Web.UI.WebControls.TextBox txtMaxPanels; + protected global::System.Web.UI.WebControls.TextBox txtNumPanels; /// /// Controllo lbtMakeSim.