using System; using System.Collections.Generic; using System.Linq; using System.Text; using SteamWare; namespace GMW_data { public class UserControlBCodeMan : GMW_data.UserControl { /// /// IDX cella associata alla linea corrente /// 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); } } /// /// Codice AL associato alla cella corrente... /// 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; } } /// /// Richiesta (ri)stampa UDC /// /// Tipo Udc (x messaggio log/SAO) /// Codice UDC 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); } /// /// udc da stampare /// protected string udcReq { get { return memLayer.ML.StringSessionObj("udcSelSAO"); } } /// /// indica il codice articolo correntemente selezionato /// 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")); } } /// /// indica il codice articolo "originale" in caso di trascodifica GRZ/GRZ o GRZ/LVT o LVT/LVT /// 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")); } } /// /// Recupera descrizione e disegno dato un particolare /// /// /// /// 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 { } } } }