From f8d7530b63c9e72ffc60ec7818a005b1066b43f5 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 2 Jan 2021 10:38:44 +0100 Subject: [PATCH] revisione jumper x MAG (NON completata) --- MP-MAG/BaseUserControl.cs | 1 + MP-MAG/MP-MAG.csproj | 16 ++ MP-MAG/SMART/jumper.ascx | 1 + MP-MAG/SMART/jumper.ascx.cs | 57 ++++++ MP-MAG/SMART/jumper.ascx.designer.cs | 16 ++ MP-MAG/SMART/tryLogin.aspx | 19 ++ MP-MAG/SMART/tryLogin.aspx.cs | 20 +++ MP-MAG/SMART/tryLogin.aspx.designer.cs | 35 ++++ MagData/MagDataLayer.cs | 22 +++ MagData/Objects.cs | 240 ++++++++++++++++++------- 10 files changed, 366 insertions(+), 61 deletions(-) create mode 100644 MP-MAG/SMART/jumper.ascx create mode 100644 MP-MAG/SMART/jumper.ascx.cs create mode 100644 MP-MAG/SMART/jumper.ascx.designer.cs create mode 100644 MP-MAG/SMART/tryLogin.aspx create mode 100644 MP-MAG/SMART/tryLogin.aspx.cs create mode 100644 MP-MAG/SMART/tryLogin.aspx.designer.cs diff --git a/MP-MAG/BaseUserControl.cs b/MP-MAG/BaseUserControl.cs index 144c415e..1ec3c643 100644 --- a/MP-MAG/BaseUserControl.cs +++ b/MP-MAG/BaseUserControl.cs @@ -244,6 +244,7 @@ namespace MP_MAG /// /// Dati correnti di produzione + /// FixMe Todo !!! : DA RIVEDERE: NON Può essere a livello redis condiviso se diverse postazioni... /// public prodData currProdData { diff --git a/MP-MAG/MP-MAG.csproj b/MP-MAG/MP-MAG.csproj index 6d3548cb..2aace609 100644 --- a/MP-MAG/MP-MAG.csproj +++ b/MP-MAG/MP-MAG.csproj @@ -306,6 +306,13 @@ EnrollDevice.aspx + + jumper.ascx + ASPXCodeBehind + + + jumper.ascx + login.aspx ASPXCodeBehind @@ -334,6 +341,13 @@ SmartStarter.aspx + + tryLogin.aspx + ASPXCodeBehind + + + tryLogin.aspx + cmp_activeParams.ascx ASPXCodeBehind @@ -726,10 +740,12 @@ + + diff --git a/MP-MAG/SMART/jumper.ascx b/MP-MAG/SMART/jumper.ascx new file mode 100644 index 00000000..440af664 --- /dev/null +++ b/MP-MAG/SMART/jumper.ascx @@ -0,0 +1 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="jumper.ascx.cs" Inherits="MP_MAG.SMART.jumper" %> diff --git a/MP-MAG/SMART/jumper.ascx.cs b/MP-MAG/SMART/jumper.ascx.cs new file mode 100644 index 00000000..b1aab259 --- /dev/null +++ b/MP-MAG/SMART/jumper.ascx.cs @@ -0,0 +1,57 @@ +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MP_MAG.SMART +{ + public partial class jumper : System.Web.UI.UserControl + { + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + int MatrOpr = memLayer.ML.QSI("MatrOpr"); + // salvo in cookie i dati idxODL, idxMacchina e QtaUdc x successivo impiego + int IdxODL = memLayer.ML.QSI("IdxODL"); + string IdxMacchina = memLayer.ML.QSS("IdxMacchina"); + int QtaUdc = memLayer.ML.QSI("QtaUdc"); + MagData.prodPrintData newProdPrintData = new MagData.prodPrintData(MatrOpr, IdxODL, IdxMacchina, QtaUdc); + // salvo in oggetto dedicato... + MagData.MagDataLayer.man.currProdPrintData = newProdPrintData; + + // se l'operatore in sessione è DIVERSO da quello appena inviato --> effettuo NUOVO login + if (MatrOpr == memLayer.ML.IntSessionObj("MatrOpr")) + { + // rimando a pagina di stampa.. secondo tipo finiti / semilavorati + // FARE!!! verifica SL/FI (NON E' ancora implementato davvero + string tgtPage = newProdPrintData.isProdFinito ? "prtFiniti" : "prtSemilav"; + Response.Redirect(tgtPage); + } + else + { + // elimino precedenti cookie e valori utente... + memLayer.ML.emptySessionVal("MatrOpr"); + memLayer.ML.emptySessionVal("UserAuthKey"); + string UserAuthKey = memLayer.ML.QSS("UserAuthKey"); + user_std.UtSn.logOffUtente(); + memLayer.ML.emptyCookieVal(memLayer.ML.CRS("cookieName")); + + // salvo in sessione i dati x successivo impiego login... + if (MatrOpr >= 0 && !string.IsNullOrEmpty(UserAuthKey)) + { + // salvo in sessione + memLayer.ML.setSessionVal("MatrOpr", MatrOpr); + memLayer.ML.setSessionVal("UserAuthKey", UserAuthKey); + } + // redirect x login... + Response.Redirect("tryLogin"); + } + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP-MAG/SMART/jumper.ascx.designer.cs b/MP-MAG/SMART/jumper.ascx.designer.cs new file mode 100644 index 00000000..7ef40fc1 --- /dev/null +++ b/MP-MAG/SMART/jumper.ascx.designer.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + + +namespace MP_MAG.SMART +{ + public partial class jumper + { + } +} diff --git a/MP-MAG/SMART/tryLogin.aspx b/MP-MAG/SMART/tryLogin.aspx new file mode 100644 index 00000000..edc94293 --- /dev/null +++ b/MP-MAG/SMART/tryLogin.aspx @@ -0,0 +1,19 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="tryLogin.aspx.cs" Inherits="MP_MAG.SMART.tryLogin" %> + +<%@ Register Src="~/WebUserControls/mod_enrollByJumperAuthKey.ascx" TagPrefix="uc1" TagName="mod_enrollByJumperAuthKey" %> + + + + + + + + + +
+
+ +
+
+ + \ No newline at end of file diff --git a/MP-MAG/SMART/tryLogin.aspx.cs b/MP-MAG/SMART/tryLogin.aspx.cs new file mode 100644 index 00000000..78a6cd65 --- /dev/null +++ b/MP-MAG/SMART/tryLogin.aspx.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MP_MAG.SMART +{ + public partial class tryLogin : System.Web.UI.Page + { + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP-MAG/SMART/tryLogin.aspx.designer.cs b/MP-MAG/SMART/tryLogin.aspx.designer.cs new file mode 100644 index 00000000..e7371ab0 --- /dev/null +++ b/MP-MAG/SMART/tryLogin.aspx.designer.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace MP_MAG.SMART +{ + + + public partial class tryLogin + { + + /// + /// Controllo form1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Controllo mod_enrollByJumperAuthKey. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::MP_MAG.WebUserControls.mod_enrollByJumperAuthKey mod_enrollByJumperAuthKey; + } +} diff --git a/MagData/MagDataLayer.cs b/MagData/MagDataLayer.cs index 1b5c7760..713aaed4 100644 --- a/MagData/MagDataLayer.cs +++ b/MagData/MagDataLayer.cs @@ -56,6 +56,28 @@ namespace MagData #region Public Properties + /// + /// Dati Prod e Print correnti x sessione utente salvati come cookie + /// + public prodPrintData currProdPrintData + { + set + { + string rawData = JsonConvert.SerializeObject(value); + memLayer.ML.setSessionVal("currProdPrintData", rawData, true); + } + get + { + prodPrintData answ = new prodPrintData(); + string rawData = memLayer.ML.StringSessionObj("currProdPrintData"); + if (!string.IsNullOrEmpty(rawData)) + { + answ = JsonConvert.DeserializeObject(rawData); + } + return answ; + } + } + /// /// Restituisce un array JSon x le conf delle code di stampa leggendo dal file /// diff --git a/MagData/Objects.cs b/MagData/Objects.cs index f87bc05a..159d097f 100644 --- a/MagData/Objects.cs +++ b/MagData/Objects.cs @@ -6,69 +6,187 @@ using System.Threading.Tasks; namespace MagData { + /// + /// Valori decodificati + /// + public class decodedData + { + #region Public Properties + + /// + /// Codice decodificato + /// + public string code { get; set; } = ""; + + /// + /// Codice decodificato in formato INT + /// + public int codeInt { get; set; } = 0; + + /// + /// Tipo codice decodificato + /// + public codeType codeType { get; set; } = codeType.UNK; + + /// + /// Descrizione associata + /// + public string description { get; set; } = ""; + + /// + /// Dato letto RAW + /// + public string rawData { get; set; } = ""; + + #endregion Public Properties + } - /// - /// Valori decodificati - /// - public class decodedData - { /// - /// Tipo codice decodificato + /// Oggetto dei dati di produzione attuali (per serializzazione json) /// - public codeType codeType { get; set; } = codeType.UNK; + public class prodData + { + #region Public Properties + + /// + /// Cod Cliente corrente + /// + public string CodCli { get; set; } = ""; + + /// + /// Cod operatore corrente + /// + public string CodOpr { get; set; } = ""; + + /// + /// Cod Postazione corrente + /// + public string CodPost { get; set; } = ""; + + /// + /// Cod Articolo corrente + /// + public string CurrArtCod { get; set; } = ""; + + /// + /// Descrizione Articolo corrente + /// + public string CurrArtDesc { get; set; } = ""; + + /// + /// Codice ODL corrente + /// + public string CurrODL { get; set; } = ""; + + /// + /// Coda di stampa attiva + /// + public string PrintQueue { get; set; } = ""; + + /// + /// Codice riferimento esterno produzione + /// + public string RifExt { get; set; } = ""; + + #endregion Public Properties + } + /// - /// Codice decodificato + /// Oggetto dei dati di produzione e stampa attuali (per serializzazione json) /// - public string code { get; set; } = ""; - /// - /// Codice decodificato in formato INT - /// - public int codeInt { get; set; } = 0; - /// - /// Descrizione associata - /// - public string description { get; set; } = ""; - /// - /// Dato letto RAW - /// - public string rawData { get; set; } = ""; - } - /// - /// Oggetto dei dati di produzione attuali (per serializzazione json) - /// - public class prodData - { - /// - /// Cod Cliente corrente - /// - public string CodCli { get; set; } = ""; - /// - /// Cod operatore corrente - /// - public string CodOpr { get; set; } = ""; - /// - /// Cod Postazione corrente - /// - public string CodPost { get; set; } = ""; - /// - /// Cod Articolo corrente - /// - public string CurrArtCod { get; set; } = ""; - /// - /// Descrizione Articolo corrente - /// - public string CurrArtDesc { get; set; } = ""; - /// - /// Codice ODL corrente - /// - public string CurrODL { get; set; } = ""; - /// - /// Codice riferimento esterno produzione - /// - public string RifExt { get; set; } = ""; - /// - /// Coda di stampa attiva - /// - public string PrintQueue { get; set; } = ""; - } -} + public class prodPrintData + { +#if false + /// + /// Cod operatore corrente + /// + public string CodOpr { get; set; } = ""; + /// + /// Cod Postazione corrente + /// + public string CodPost { get; set; } = ""; + /// + /// Codice ODL corrente + /// + public string CurrODL { get; set; } = ""; + /// + /// Cod Articolo corrente + /// + public string CurrArtCod { get; set; } = "ToDo"; + /// + /// Descrizione Articolo corrente + /// + public string CurrArtDesc { get; set; } = "ToDo"; + /// + /// Cod Cliente corrente + /// + public string CodCli { get; set; } = "ToDo"; + /// + /// Codice riferimento esterno produzione + /// + public string RifExt { get; set; } = "ToDo"; +#endif + + #region Public Constructors + + /// + /// Inizializzazione oggetto + /// + /// + /// + /// + /// + public prodPrintData(int MatrOpr, int IdxOdl, string IdxMacchina, int QtaUdc) + { + this.MatrOpr = MatrOpr; + this.IdxOdl = IdxOdl; + this.IdxMacchina = IdxMacchina; + this.QtaUdc = QtaUdc; + } + + public prodPrintData() + { + this.MatrOpr = 0; + this.IdxOdl = 0; + this.IdxMacchina = ""; + this.QtaUdc = 1; + } + + #endregion Public Constructors + + #region Public Properties + + /// + /// Codice macchina selezionata + /// + public string IdxMacchina { get; set; } + + /// + /// Codice ODL corrente + /// + public int IdxOdl { get; set; } + + /// + /// Indica se si tratta di un FINITO (cs semilavorato) + /// FIXME TODO FARE !!!! + /// + public bool isProdFinito { get; set; } = true; + + /// + /// Matricola Operatore + /// + public int MatrOpr { get; set; } + + /// + /// Coda di stampa attiva + /// + public string PrintQueue { get; set; } = ""; + + /// + /// Quantità standard x stampa UDC + /// + public int QtaUdc { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file