97 lines
3.9 KiB
C#
97 lines
3.9 KiB
C#
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 QtaConf = 0;
|
|
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;
|
|
if (tabOdl.Rows.Count > 0)
|
|
{
|
|
QtaOdl = tabOdl[0].NumPezzi;
|
|
}
|
|
|
|
// cerco qta confermata
|
|
var tabDatiProdAct = DataLayerObj.taStatoProd.GetData(IdxMacchina, DateTime.Now);
|
|
if (tabDatiProdAct.Rows.Count > 0)
|
|
{
|
|
QtaConf = tabDatiProdAct[0].PzConfBuoni;
|
|
}
|
|
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, QtaConf, 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"))
|
|
{
|
|
// rimando a pagina di stampa x 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
|
|
}
|
|
} |