10dbc626b1
variabili e inizializzazione pagina e parametri
228 lines
7.6 KiB
C#
228 lines
7.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using SteamWare;
|
|
|
|
namespace GMW_data
|
|
{
|
|
public class UserControlBCodeMan : GMW_data.UserControl
|
|
{
|
|
|
|
/// <summary>
|
|
/// flusso associato (hard coded) a sterrati
|
|
/// </summary>
|
|
public string flusso = "";
|
|
/// <summary>
|
|
/// stato associato (hard coded) a sterrati
|
|
/// </summary>
|
|
public string statoUDC = "";
|
|
/// <summary>
|
|
/// tipo di evento associato alla creazione dell'UDC
|
|
/// </summary>
|
|
public string eventoUDC = "";
|
|
/// <summary>
|
|
/// tipo di evento associato alla modifica qta dell'UDC
|
|
/// </summary>
|
|
public string eventoUDC_qta = "";
|
|
/// <summary>
|
|
/// dati x verifica CodSoggetto / matricola
|
|
/// </summary>
|
|
public string preCodSogg = memLayer.ML.CRS("prefCodSogg");
|
|
/// <summary>
|
|
/// Codice linea non utilizzabile ("00" finale = Select...)
|
|
/// </summary>
|
|
public string codLineaKo = "";
|
|
/// <summary>
|
|
/// Parte variabile messaggio ristampa
|
|
/// </summary>
|
|
public string tipoUdcRist = "";
|
|
|
|
/// <summary>
|
|
/// IDX cella associata alla linea corrente
|
|
/// </summary>
|
|
protected int idxCella
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
if (memLayer.ML.isInSessionObject(string.Format("IdxCella_{0}", uid)))
|
|
{
|
|
answ = memLayer.ML.IntSessionObj(string.Format("IdxCella_{0}", uid));
|
|
}
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal(string.Format("IdxCella_{0}", uid), value);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Codice AL associato alla cella corrente...
|
|
/// </summary>
|
|
protected string AlByCella
|
|
{
|
|
get
|
|
{
|
|
string answ = "";
|
|
try
|
|
{
|
|
// tolto 2015.06.25
|
|
//// se avesse perso codice cella rimando a pagina default...
|
|
//if (Postazione.currCodCella == "") Response.Redirect("Default.aspx");
|
|
answ = string.Format("ALF00{0}", Postazione.currCodCella);
|
|
// controllo se esista AL sennò lo creo...
|
|
if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0)
|
|
{
|
|
MagClass.magazzino.taEA.Insert(answ, true, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, "", "");
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
return answ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Richiesta (ri)stampa UDC
|
|
/// </summary>
|
|
/// <param name="tipoUdc">Tipo Udc (x messaggio log/SAO)</param>
|
|
/// <param name="udcReq">Codice UDC</param>
|
|
public void ristampaUdc(string tipoUdc, string udcReq)
|
|
{
|
|
bool fatto = false;
|
|
// registro ri-stampa UDC
|
|
DateTime adesso = DateTime.Now;
|
|
// calcolo particolare...
|
|
DS_magazzino.ElencoCartelliniRow rigaUDC;
|
|
string particolare = "";
|
|
try
|
|
{
|
|
rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0];
|
|
particolare = rigaUDC.Particolare;
|
|
fatto = MagClass.magazzino.ristampaUdc(udcReq, Postazione.printer, Request.UserHostName);
|
|
}
|
|
catch
|
|
{
|
|
logger.lg.scriviLog(string.Format("Errore recupero particolare UDC {0} {1}", tipoUdc, udcReq), tipoLog.EXCEPTION);
|
|
}
|
|
if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", string.Format("Ri-Stampato UDC {0}", tipoUdc));
|
|
raiseEvent(ucEvType.ReqUpdateParent);
|
|
}
|
|
/// <summary>
|
|
/// udc da stampare
|
|
/// </summary>
|
|
protected string udcReq
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj("udcSelSAO");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// indica il codice articolo correntemente selezionato
|
|
/// </summary>
|
|
protected string currParticolare
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid));
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// indica il codice articolo "originale" in caso di trascodifica GRZ/GRZ o GRZ/LVT o LVT/LVT
|
|
/// </summary>
|
|
protected string origParticolare
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj(string.Format("origParticolare_{0}", uid));
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal(string.Format("origParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// indica UDC correntemente selezionato
|
|
/// </summary>
|
|
protected string currUDC
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj(string.Format("UDC_{0}", uid));
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal(string.Format("UDC_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Recupera descrizione e disegno dato un particolare
|
|
/// </summary>
|
|
/// <param name="CodParticolare"></param>
|
|
/// <param name="descr"></param>
|
|
/// <param name="disegno"></param>
|
|
public void getDescrDisegnoParticolare(string CodParticolare, ref string descr, ref string disegno)
|
|
{
|
|
try
|
|
{
|
|
DS_magazzino.AnagParticolariRow riga = MagClass.magazzino.taAnagPart.likeSearch(CodParticolare, CodCs)[0];
|
|
descr = riga.DescParticolare;
|
|
disegno = string.Format("( {0} )", riga.DisegnoGrezzo);
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
/// <summary>
|
|
/// effettua controlli visibilità
|
|
/// </summary>
|
|
public virtual void doChecks()
|
|
{
|
|
checkBarcode();
|
|
checkStampa();
|
|
checkParticolare();
|
|
}
|
|
/// <summary>
|
|
/// controlla se ci sia un barcode
|
|
/// </summary>
|
|
public virtual void checkBarcode()
|
|
{ }
|
|
/// <summary>
|
|
/// controllo l'abilitazione alla stampa UDC:
|
|
/// - particolare ok
|
|
/// - qta > 0
|
|
/// - udc da consumo totale/parziale
|
|
/// altrimenti disabilito btn stampa
|
|
/// </summary>
|
|
public virtual void checkStampa()
|
|
{ }
|
|
/// <summary>
|
|
/// controlla particolare selezionato
|
|
/// </summary>
|
|
public virtual void checkParticolare()
|
|
{ }
|
|
/// <summary>
|
|
/// Impostazione variabili specifiche
|
|
/// </summary>
|
|
public virtual void setupVariabili()
|
|
{ }
|
|
|
|
/// <summary>
|
|
/// caricamento pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
public virtual void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
setupVariabili();
|
|
}
|
|
}
|
|
}
|
|
}
|