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.WebUserControls { public partial class cmp_jumper : BaseUserControl { #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"); bool isFinito = false; string ArtCod = ""; string ArtDesc = ""; string CliCod = ""; string CliDescr = ""; string OrdRifExt = ""; int QtaOdl = 0; string Lotto = ""; string CodPost = IdxMacchina; // recupero dati da tab LOTTI var tabLotti = MagDataLayerObj.taEL.getByOdl(IdxODL); if (tabLotti.Rows.Count > 0) { ArtCod = tabLotti[0].CodArt; Lotto = tabLotti[0].Lotto; var tabOdl = DataLayerObj.taODL.getByIdx(IdxODL, false); var tabArt = MagDataLayerObj.taAA.getByKey(ArtCod); if (tabArt.Rows.Count > 0) { isFinito = tabArt[0].CodStato == "FIN"; ArtCod = tabArt[0].CodArt; ArtDesc = tabArt[0].DescrArt; QtaOdl = tabOdl[0].NumPezzi; var tabAA2C = MagDataLayerObj.taAA2C.getByCodArt(ArtCod); if (tabAA2C.Rows.Count > 0) { CliCod = tabAA2C[0].CodCliente; } } } MagData.prodPrintData newProdPrintData = new MagData.prodPrintData(MatrOpr, IdxODL, IdxMacchina, QtaUdc, isFinito, ArtCod, ArtDesc, CliCod, CliDescr, OrdRifExt, QtaOdl, Lotto, CodPost); // salvo in oggetto dedicato... MagData.MagDataLayer.man.currProdPrintData = newProdPrintData; string tgtPage = ""; // se l'operatore in sessione è DIVERSO da quello appena inviato --> effettuo NUOVO login if (MatrOpr == memLayer.ML.IntSessionObj("MatrOpr")) { #if false // rimando a pagina di stampa.. secondo tipo finiti / semilavorati tgtPage = newProdPrintData.isProdFinito ? "prtFiniti" : "prtSemilav"; #endif // rimando a pagina di stampax ODL tgtPage = "printCartOdl"; } 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... tgtPage = "tryLogin"; } } Response.Redirect($"~/SMART/{tgtPage}"); } #endregion Protected Methods } }