diff --git a/GMW/GlobalSuppressions.cs b/GMW/GlobalSuppressions.cs index 90f23487..e2f1634a 100644 --- a/GMW/GlobalSuppressions.cs +++ b/GMW/GlobalSuppressions.cs @@ -3132,4 +3132,7 @@ [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Build", "CA1707:Remove the underscores from type name mod_ricercaGenerica.", Justification = "", Scope = "type", Target = "~T:mod_ricercaGenerica")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Build", "CA1707:Remove the underscores from type name mod_selettore_ajax.", Justification = "", Scope = "type", Target = "~T:mod_selettore_ajax")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Build", "CA1707:Remove the underscores from type name mod_unauthorized.", Justification = "", Scope = "type", Target = "~T:mod_unauthorized")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Build", "CA1707:Remove the underscores from type name mod_vocabolario.", Justification = "", Scope = "type", Target = "~T:mod_vocabolario")] \ No newline at end of file +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Build", "CA1707:Remove the underscores from type name mod_vocabolario.", Justification = "", Scope = "type", Target = "~T:mod_vocabolario")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~M:GMW.WebUserControls.mod_sterrTaglio.checkCreaUDC(System.Boolean,System.Boolean)~System.String")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "", Scope = "member", Target = "~P:GMW.WebUserControls.mod_anagLinee.codLineaSel")] + diff --git a/GMW/POST_Finiti_IN.aspx.cs b/GMW/POST_Finiti_IN.aspx.cs index e0383b99..1fdfc58d 100644 --- a/GMW/POST_Finiti_IN.aspx.cs +++ b/GMW/POST_Finiti_IN.aspx.cs @@ -174,7 +174,7 @@ namespace GMW } catch { } - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = "W00"; } diff --git a/GMW/POST_Finiti_OUT.aspx.cs b/GMW/POST_Finiti_OUT.aspx.cs index dcef8356..88105ce9 100644 --- a/GMW/POST_Finiti_OUT.aspx.cs +++ b/GMW/POST_Finiti_OUT.aspx.cs @@ -204,7 +204,7 @@ namespace GMW } catch { } - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = "W00"; } diff --git a/GMW/WebUserControls/mod_FusiSterr.ascx.cs b/GMW/WebUserControls/mod_FusiSterr.ascx.cs index a4a6c5e8..19e9d15d 100644 --- a/GMW/WebUserControls/mod_FusiSterr.ascx.cs +++ b/GMW/WebUserControls/mod_FusiSterr.ascx.cs @@ -101,9 +101,6 @@ namespace GMW.WebUserControls 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("ALS00{0}", Postazione.currCodCella); // controllo se esista AL sennò lo creo... if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0) @@ -481,7 +478,7 @@ namespace GMW.WebUserControls { udcDest = ""; } - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { try { diff --git a/GMW/WebUserControls/mod_LiqDtAnom.ascx.cs b/GMW/WebUserControls/mod_LiqDtAnom.ascx.cs index de6f9100..8b266830 100644 --- a/GMW/WebUserControls/mod_LiqDtAnom.ascx.cs +++ b/GMW/WebUserControls/mod_LiqDtAnom.ascx.cs @@ -501,7 +501,7 @@ namespace GMW.WebUserControls NewUDC = getUdcDest(tabDtx2Udc); udcRX = currUdcTT.Replace(flussoAnc, flussoRX); // verifico se posso procedere: in caso NON ci fosse UDC di destinazione - if (NewUDC == "") + if (string.IsNullOrEmpty(NewUDC)) { // richiedo di caricare un UDC valido per il particolare richiesto... Postazione.messaggiText = ""; @@ -610,7 +610,7 @@ namespace GMW.WebUserControls currParticolare = ""; } // se non ho particolare PROVO a decodificare da codice datamatrix - if (currParticolare == "") + if (string.IsNullOrEmpty(currParticolare)) { try { @@ -704,7 +704,7 @@ namespace GMW.WebUserControls { UdcTT = ""; } - if (UdcTT == "") + if (string.IsNullOrEmpty(UdcTT)) { // se non lo trovo uso UDC e trattamento "undef" a 0000, eventualmente creando UDC annuale UdcTT = string.Format("U{0}{1}{2:yy}000000", memLayer.ML.cdv("CodCS"), flussoAnc, DateTime.Now); diff --git a/GMW/WebUserControls/mod_PostFinMultIN.ascx.cs b/GMW/WebUserControls/mod_PostFinMultIN.ascx.cs index a3e74691..833d378f 100644 --- a/GMW/WebUserControls/mod_PostFinMultIN.ascx.cs +++ b/GMW/WebUserControls/mod_PostFinMultIN.ascx.cs @@ -324,7 +324,7 @@ namespace GMW.WebUserControls } else { - if (lastBarcodeIn == "") + if (string.IsNullOrEmpty(lastBarcodeIn)) { Postazione.messaggiText = traduci("AttesaBCode"); Postazione.CssClass = "stileAttesa"; @@ -413,7 +413,7 @@ namespace GMW.WebUserControls } protected void salvaCerca() { - if (testoRicerca == "") + if (string.IsNullOrEmpty(testoRicerca)) { SteamWare.memLayer.ML.emptySessionVal("valoreCercatoFMI"); } diff --git a/GMW/WebUserControls/mod_PostFinMultOUT.ascx.cs b/GMW/WebUserControls/mod_PostFinMultOUT.ascx.cs index 595b4191..f30eec11 100644 --- a/GMW/WebUserControls/mod_PostFinMultOUT.ascx.cs +++ b/GMW/WebUserControls/mod_PostFinMultOUT.ascx.cs @@ -679,7 +679,7 @@ namespace GMW.WebUserControls codImballo = memLayer.ML.cdv("CodImballoFiniti"); } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = memLayer.ML.cdv("CodImballoFiniti"); } diff --git a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs index 2d61d143..19a5beab 100644 --- a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs @@ -150,7 +150,7 @@ namespace GMW.WebUserControls { bool showBtn = false; bool onPrinting = divImballi.Visible; - if (sourceAL != "" && currAL == "") + if (sourceAL != "" && string.IsNullOrEmpty(currAL)) { showBtn = true; fixCssAL("warning"); @@ -614,7 +614,7 @@ namespace GMW.WebUserControls { udcDest = ""; } - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { // crea UDC DEST... qta = maxQta; @@ -1006,7 +1006,7 @@ namespace GMW.WebUserControls codImballo = CodImballoStd; } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = CodImballoStd; } diff --git a/GMW/WebUserControls/mod_PostLiq_DT.ascx.cs b/GMW/WebUserControls/mod_PostLiq_DT.ascx.cs index 64fb4951..efdf7d92 100644 --- a/GMW/WebUserControls/mod_PostLiq_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostLiq_DT.ascx.cs @@ -55,7 +55,7 @@ namespace GMW.WebUserControls // cerco su controllo answ = lblAL.Text.Trim(); // se vuoto cerco in sessione (ed eventualmente aggiorno - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = memLayer.ML.StringSessionObj(string.Format("sourceAL_{0}", uid)); lblAL.Text = answ; @@ -144,7 +144,7 @@ namespace GMW.WebUserControls /// private void setDefaultVal() { - if (sourceAL == "") + if (string.IsNullOrEmpty(sourceAL)) { sourceAL = currAL != "" ? currAL : ""; } @@ -165,7 +165,7 @@ namespace GMW.WebUserControls public override void setVisibility() { bool showBtn = false; - if (sourceAL != "" && currAL == "") + if (sourceAL != "" && string.IsNullOrEmpty(currAL)) { showBtn = true; fixCssAL("warning"); @@ -273,7 +273,7 @@ namespace GMW.WebUserControls Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn); tipoCodiceBarcode tipoBC = MagClass.tipoBCode_L5(barcodeIn); // per prima cosa: SE NON HO AL SELEZIONATO e non ho sparato un AL o un imballo sollevo errore... - if (!(tipoBC == tipoCodiceBarcode.AL || tipoBC == tipoCodiceBarcode.Imballo) && currAL == "") + if (!(tipoBC == tipoCodiceBarcode.AL || tipoBC == tipoCodiceBarcode.Imballo) && string.IsNullOrEmpty(currAL)) { // sollevo errore, in primis va definito AL sorgente... Postazione.warningText = traduci("ERR-ALT-001"); @@ -395,7 +395,7 @@ namespace GMW.WebUserControls break; case tipoCodiceBarcode.AL: // se linea libera... - if (currAL == "") + if (string.IsNullOrEmpty(currAL)) { // verifico barcode valido if (checkAL(barcodeIn, "T")) @@ -482,7 +482,7 @@ namespace GMW.WebUserControls { NewUDC = ""; } - if (NewUDC == "") + if (string.IsNullOrEmpty(NewUDC)) { // CASO 01: DTX in AL sorgente, particolare OK, NON C'E' UDC dest procDtx_Caso01(ref OldUDC, ref NewUDC, adesso); @@ -559,7 +559,7 @@ namespace GMW.WebUserControls codImballo = memLayer.ML.cdv("CodImballoFiniti"); } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = memLayer.ML.cdv("CodImballoFiniti"); } diff --git a/GMW/WebUserControls/mod_PostRX_DT.ascx.cs b/GMW/WebUserControls/mod_PostRX_DT.ascx.cs index d9391056..021504f3 100644 --- a/GMW/WebUserControls/mod_PostRX_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostRX_DT.ascx.cs @@ -116,7 +116,7 @@ namespace GMW.WebUserControls catch { } //2016.01.25 se vuoto metto ND!!! - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = "ND"; } @@ -382,7 +382,7 @@ namespace GMW.WebUserControls { // vers 2.9 // controllo formato datamatrix sia impostato sulla linea (altrimenti errore linea "non battezzata") - if (FormatoDtmxLinea == "") + if (string.IsNullOrEmpty(FormatoDtmxLinea)) { // errore poiché non è stato non specificato tipo Dtmx assegnato alla linea! Postazione.messaggiText = barcodeIn; @@ -447,7 +447,7 @@ namespace GMW.WebUserControls } catch (Exception exc) { - logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{3}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); + logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{2}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); currParticolare = ""; } if (currParticolare != "") @@ -545,7 +545,7 @@ namespace GMW.WebUserControls } catch (Exception exc) { - logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{3}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); + logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{2}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); currParticolare = ""; } if (currParticolare != "") @@ -849,7 +849,7 @@ namespace GMW.WebUserControls { newUdcChild = ""; } - if (newUdcChild == "") + if (string.IsNullOrEmpty(newUdcChild)) { // controllo NON ci siano troppi UDC in posizione... da capienza ed assegnati DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga; diff --git a/GMW/WebUserControls/mod_PostRX_NT.ascx.cs b/GMW/WebUserControls/mod_PostRX_NT.ascx.cs index 912ead6d..e056d5dd 100644 --- a/GMW/WebUserControls/mod_PostRX_NT.ascx.cs +++ b/GMW/WebUserControls/mod_PostRX_NT.ascx.cs @@ -575,7 +575,7 @@ namespace GMW.WebUserControls { newUdcChild = ""; } - if (newUdcChild == "") + if (string.IsNullOrEmpty(newUdcChild)) { // controllo NON ci siano troppi UDC in posizione... da capienza ed assegnati DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga; diff --git a/GMW/WebUserControls/mod_PostTT.ascx.cs b/GMW/WebUserControls/mod_PostTT.ascx.cs index 49b108d0..77218851 100644 --- a/GMW/WebUserControls/mod_PostTT.ascx.cs +++ b/GMW/WebUserControls/mod_PostTT.ascx.cs @@ -5,433 +5,433 @@ using System.Web.UI; namespace GMW.WebUserControls { - public partial class mod_PostTT : System.Web.UI.UserControl + public partial class mod_PostTT : System.Web.UI.UserControl + { + /// + /// evento richiesta update + /// + public event EventHandler eh_reqUpdate; + /// + /// flusso associato (hard coded) a RX + /// + protected string flusso = "TT"; + /// + /// stato associato (hard coded) a Controllato RX + /// + protected string statoUDC = "Tratt"; + /// + /// codice evento dell'UDC che si crea + /// + protected string codEventoUdc = "UDC_TRATT"; + /// + /// Codice AL sorgente da avanzare RX --> TT + /// + protected string sourceAL { - /// - /// evento richiesta update - /// - public event EventHandler eh_reqUpdate; - /// - /// flusso associato (hard coded) a RX - /// - protected string flusso = "TT"; - /// - /// stato associato (hard coded) a Controllato RX - /// - protected string statoUDC = "Tratt"; - /// - /// codice evento dell'UDC che si crea - /// - protected string codEventoUdc = "UDC_TRATT"; - /// - /// Codice AL sorgente da avanzare RX --> TT - /// - protected string sourceAL - { - get - { - return lblAL.Text.Trim(); - } - set - { - lblAL.Text = value; - } - } - /// - /// Numero trattamento - /// - protected string NumTratt - { - get - { - return txtNumTratt.Text.Trim(); - } - set - { - txtNumTratt.Text = value; - } - } - /// - /// Anno trattamento - /// - protected string AnnoTratt - { - get - { - return txtAnno.Text.Trim(); - } - set - { - txtAnno.Text = value; - } - } - /// - /// Durezza (ok/ko) - /// - public bool Durezza - { - get - { - return chkDurezza.Checked; - } - set - { - chkDurezza.Checked = value; - } - } - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - resetIN(); - Postazione.messaggiText = ""; - Postazione.warningText = ""; - } - checkBarcode(); - } - /// - /// restta input - /// - private void resetIN() - { - AnnoTratt = DateTime.Now.Year.ToString(); - sourceAL = ""; - NumTratt = ""; - Durezza = false; - txtNote.Text = ""; - txtPunzone.Text = ""; - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn); - switch (MagClass.tipoBCode_L5(barcodeIn)) - { - case tipoCodiceBarcode.AL: - // verifico AL - if (checkAL(barcodeIn)) - { - resetIN(); - sourceAL = barcodeIn; - } - doUpdate(); - break; - case tipoCodiceBarcode.UDC: - // verifico UDC - if (checkUDC(barcodeIn)) - { - string AL = ""; - // recupero da UDC - try - { - AL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL; - } - catch - { - Postazione.warningText = traduci("ErroreUdcNonAl"); - Postazione.CssClass = "stileComandoKo"; - } - if (AL != "") - { - // verifico AL - if (checkAL(AL)) - { - sourceAL = AL; - } - } - } - doUpdate(); - break; - case tipoCodiceBarcode.Comando: - // se è reset cancello tutto! - if (barcodeIn == memLayer.ML.cdv("cmdReset")) - { - resetIN(); - Postazione.messaggiText = ""; - Postazione.warningText = ""; - doUpdate(); - } - Postazione.CssClass = "stileAttesa"; - break; - default: - Postazione.messaggiText = ""; - Postazione.warningText = traduci("ERR-UNK-001"); - Postazione.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; - } - else - { - Postazione.messaggiText = traduci("AttesaBCode"); - Postazione.CssClass = "stileAttesa"; - } - doUpdate(); - } - /// - /// Verifica l'AL se sia ok x procedere: - /// - Tipo "R" - /// - Attivo - /// - /// - /// - protected bool checkAL(string AL) - { - bool answ = false; - try - { - answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, "R").Rows.Count > 0; - } - catch - { } - if (!answ) - { - Postazione.warningText = traduci("ErroreAlNonRxAttivo"); - Postazione.CssClass = "stileComandoKo"; - // reimporto AL comunque.. - sourceAL = ""; - } - else - { - Postazione.warningText = ""; - Postazione.CssClass = "stileComandoOk"; - } - return answ; - } - /// - /// Verifica l'UDC se sia ok x procedere: - /// - esista e sia IdxPosizione > 0 - /// - presente in un AL - /// - /// - /// - protected bool checkUDC(string UDC) - { - bool answ = false; - //faccio 3 controlli... - bool udcOk = MagClass.magazzino.checkUDC(UDC); - bool udcMov = MagClass.magazzino.checkUDC_mov(UDC); - bool udcInAL = (MagClass.magazzino.taAL2UDC.getByUDC(UDC).Rows.Count > 0); - // condizioni tutte soddisfatte? - answ = (udcOk && udcMov && udcInAL); - if (!answ) - { - Postazione.warningText = traduci("ErroreUdcRx"); - } - else - { - Postazione.warningText = ""; - } - return answ; - } - /// - /// aggiorna componenti + focus a barcode - /// - public void doUpdate() - { - if (Durezza) - { - chkDurezza.Text = "OK"; - lblDurezza.Attributes.Remove("class"); - lblDurezza.Attributes.Add("class", "btn btn-success"); - } - else - { - chkDurezza.Text = "KO"; - lblDurezza.Attributes.Remove("class"); - lblDurezza.Attributes.Add("class", "btn btn-danger"); - } - grViewSource.DataBind(); - updateBtns(); - // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } - // controllo SE ho AL allora seleziono NumTratt o Durezza... - if (sourceAL == "") - { - txtBarcode.Focus(); - } - else - { - if (NumTratt == "") - { - txtNumTratt.Focus(); - } - else - { - if (!Durezza) - { - chkDurezza.Focus(); - } - else - { - if (txtNote.Text.Trim() == "") - { - txtNote.Focus(); - } - else - { - lbtStampaAL.Focus(); - } - } - } - } - } - /// - /// fix visibilità btnStampa - /// - private void updateBtns() - { - // posso stampare se ho AL, ho num tratt e durezza.. - bool btnVis = (sourceAL != ""); - divNumTratt.Visible = btnVis; - divDurezza.Visible = btnVis; - divPunzone.Visible = btnVis; - // posso stampare se ho AL, ho num tratt e durezza.. - btnVis = (sourceAL != "" && NumTratt != "" && Durezza); - divStampa.Visible = btnVis; - } - /// - /// richiesta (ri)stampa UDC - /// - /// - /// - public void ristampa() - { - MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName); - // registro ri-stampa UDC - MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL TT"); - Postazione.CssClass = "stileAttesa"; - } - /// - /// udc da stampare - /// - protected string udcReq - { - get - { - return memLayer.ML.StringSessionObj("udcSelSAO"); - } - } - /// - /// (ri)stampa AL - /// - /// - /// - protected void lbtStampaAL_Click(object sender, EventArgs e) - { - // verifico postazione sia valida... - if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "") - { - /* generazione e stampa AL */ - string AL = ""; - string noteTrim = txtNote.Text.Trim(); - // ricalcolo numtratt come stringa formattata (anno + num 6 cifre) - string codTratt = MagClass.magazzino.getCompTrattamenti(AnnoTratt, NumTratt); - // punzone - string punzone = txtPunzone.Text.Trim(); - // creazione AL ed associazione UDC / spostamento... - try - { - AL = MagClass.magazzino.creaAssociaAlTT(sourceAL, tipoAL.AL_TT, MagClass.magazzino.CodSoggCurrUser, noteTrim, codTratt, Convert.ToInt32(Durezza), punzone); - } - catch - { } - if (AL != "") - { - // lancio stampa - MagClass.magazzino.stampaAL(AL, Postazione.printer, Request.UserHostName); - // registro creazione AL - MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, AL, "", "creaAL", string.Format("Creato AL TT su linea {0}, note: {1} ", Postazione.currCodLinea, noteTrim)); - Postazione.CssClass = "stileAttesa"; - Postazione.warningText = ""; - Postazione.messaggiText = traduci("cartAlStampato"); - // resetto - resetIN(); - } - else - { - Postazione.CssClass = "stileComandoKo"; - Postazione.warningText = traduci("ErroreCreazioneALTT"); - Postazione.messaggiText = ""; - } - doUpdate(); - } - else - { - // ricarico che mi manca postazione! - Postazione.CssClass = "stileAttesa"; - Postazione.warningText = traduci("ERR-POS-001"); - Postazione.messaggiText = ""; - Response.Redirect(user_std.pagCorrente); - } - } - /// - /// inserito num trattamento - /// - /// - /// - protected void txtNumTratt_TextChanged(object sender, EventArgs e) - { - // controllo numero trattamento... - string codTratt = MagClass.magazzino.getCompTrattamenti(AnnoTratt, NumTratt); - // cerco se ci sia già (do errore...) - if (MagClass.magazzino.taET.getByTratt(codTratt).Rows.Count > 0) - { - Postazione.warningText = traduci("ERR-NTT-001"); - Postazione.CssClass = "stileComandoKo"; - NumTratt = ""; - } - else - { - Postazione.warningText = ""; - Postazione.CssClass = "stileComandoOk"; - } - Postazione.messaggiText = codTratt; - doUpdate(); - } - /// - /// modificata durezza - /// - /// - /// - protected void chkDurezza_CheckedChanged(object sender, EventArgs e) - { - doUpdate(); - } + get + { + return lblAL.Text.Trim(); + } + set + { + lblAL.Text = value; + } } + /// + /// Numero trattamento + /// + protected string NumTratt + { + get + { + return txtNumTratt.Text.Trim(); + } + set + { + txtNumTratt.Text = value; + } + } + /// + /// Anno trattamento + /// + protected string AnnoTratt + { + get + { + return txtAnno.Text.Trim(); + } + set + { + txtAnno.Text = value; + } + } + /// + /// Durezza (ok/ko) + /// + public bool Durezza + { + get + { + return chkDurezza.Checked; + } + set + { + chkDurezza.Checked = value; + } + } + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + resetIN(); + Postazione.messaggiText = ""; + Postazione.warningText = ""; + } + checkBarcode(); + } + /// + /// restta input + /// + private void resetIN() + { + AnnoTratt = DateTime.Now.Year.ToString(); + sourceAL = ""; + NumTratt = ""; + Durezza = false; + txtNote.Text = ""; + txtPunzone.Text = ""; + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn); + switch (MagClass.tipoBCode_L5(barcodeIn)) + { + case tipoCodiceBarcode.AL: + // verifico AL + if (checkAL(barcodeIn)) + { + resetIN(); + sourceAL = barcodeIn; + } + doUpdate(); + break; + case tipoCodiceBarcode.UDC: + // verifico UDC + if (checkUDC(barcodeIn)) + { + string AL = ""; + // recupero da UDC + try + { + AL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL; + } + catch + { + Postazione.warningText = traduci("ErroreUdcNonAl"); + Postazione.CssClass = "stileComandoKo"; + } + if (AL != "") + { + // verifico AL + if (checkAL(AL)) + { + sourceAL = AL; + } + } + } + doUpdate(); + break; + case tipoCodiceBarcode.Comando: + // se è reset cancello tutto! + if (barcodeIn == memLayer.ML.cdv("cmdReset")) + { + resetIN(); + Postazione.messaggiText = ""; + Postazione.warningText = ""; + doUpdate(); + } + Postazione.CssClass = "stileAttesa"; + break; + default: + Postazione.messaggiText = ""; + Postazione.warningText = traduci("ERR-UNK-001"); + Postazione.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + doUpdate(); + } + /// + /// Verifica l'AL se sia ok x procedere: + /// - Tipo "R" + /// - Attivo + /// + /// + /// + protected bool checkAL(string AL) + { + bool answ = false; + try + { + answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, "R").Rows.Count > 0; + } + catch + { } + if (!answ) + { + Postazione.warningText = traduci("ErroreAlNonRxAttivo"); + Postazione.CssClass = "stileComandoKo"; + // reimporto AL comunque.. + sourceAL = ""; + } + else + { + Postazione.warningText = ""; + Postazione.CssClass = "stileComandoOk"; + } + return answ; + } + /// + /// Verifica l'UDC se sia ok x procedere: + /// - esista e sia IdxPosizione > 0 + /// - presente in un AL + /// + /// + /// + protected bool checkUDC(string UDC) + { + bool answ = false; + //faccio 3 controlli... + bool udcOk = MagClass.magazzino.checkUDC(UDC); + bool udcMov = MagClass.magazzino.checkUDC_mov(UDC); + bool udcInAL = (MagClass.magazzino.taAL2UDC.getByUDC(UDC).Rows.Count > 0); + // condizioni tutte soddisfatte? + answ = (udcOk && udcMov && udcInAL); + if (!answ) + { + Postazione.warningText = traduci("ErroreUdcRx"); + } + else + { + Postazione.warningText = ""; + } + return answ; + } + /// + /// aggiorna componenti + focus a barcode + /// + public void doUpdate() + { + if (Durezza) + { + chkDurezza.Text = "OK"; + lblDurezza.Attributes.Remove("class"); + lblDurezza.Attributes.Add("class", "btn btn-success"); + } + else + { + chkDurezza.Text = "KO"; + lblDurezza.Attributes.Remove("class"); + lblDurezza.Attributes.Add("class", "btn btn-danger"); + } + grViewSource.DataBind(); + updateBtns(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + // controllo SE ho AL allora seleziono NumTratt o Durezza... + if (string.IsNullOrEmpty(sourceAL)) + { + txtBarcode.Focus(); + } + else + { + if (string.IsNullOrEmpty(NumTratt)) + { + txtNumTratt.Focus(); + } + else + { + if (!Durezza) + { + chkDurezza.Focus(); + } + else + { + if (string.IsNullOrEmpty(txtNote.Text.Trim())) + { + txtNote.Focus(); + } + else + { + lbtStampaAL.Focus(); + } + } + } + } + } + /// + /// fix visibilità btnStampa + /// + private void updateBtns() + { + // posso stampare se ho AL, ho num tratt e durezza.. + bool btnVis = (sourceAL != ""); + divNumTratt.Visible = btnVis; + divDurezza.Visible = btnVis; + divPunzone.Visible = btnVis; + // posso stampare se ho AL, ho num tratt e durezza.. + btnVis = (sourceAL != "" && NumTratt != "" && Durezza); + divStampa.Visible = btnVis; + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName); + // registro ri-stampa UDC + MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL TT"); + Postazione.CssClass = "stileAttesa"; + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// (ri)stampa AL + /// + /// + /// + protected void lbtStampaAL_Click(object sender, EventArgs e) + { + // verifico postazione sia valida... + if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "") + { + /* generazione e stampa AL */ + string AL = ""; + string noteTrim = txtNote.Text.Trim(); + // ricalcolo numtratt come stringa formattata (anno + num 6 cifre) + string codTratt = MagClass.magazzino.getCompTrattamenti(AnnoTratt, NumTratt); + // punzone + string punzone = txtPunzone.Text.Trim(); + // creazione AL ed associazione UDC / spostamento... + try + { + AL = MagClass.magazzino.creaAssociaAlTT(sourceAL, tipoAL.AL_TT, MagClass.magazzino.CodSoggCurrUser, noteTrim, codTratt, Convert.ToInt32(Durezza), punzone); + } + catch + { } + if (AL != "") + { + // lancio stampa + MagClass.magazzino.stampaAL(AL, Postazione.printer, Request.UserHostName); + // registro creazione AL + MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, AL, "", "creaAL", string.Format("Creato AL TT su linea {0}, note: {1} ", Postazione.currCodLinea, noteTrim)); + Postazione.CssClass = "stileAttesa"; + Postazione.warningText = ""; + Postazione.messaggiText = traduci("cartAlStampato"); + // resetto + resetIN(); + } + else + { + Postazione.CssClass = "stileComandoKo"; + Postazione.warningText = traduci("ErroreCreazioneALTT"); + Postazione.messaggiText = ""; + } + doUpdate(); + } + else + { + // ricarico che mi manca postazione! + Postazione.CssClass = "stileAttesa"; + Postazione.warningText = traduci("ERR-POS-001"); + Postazione.messaggiText = ""; + Response.Redirect(user_std.pagCorrente); + } + } + /// + /// inserito num trattamento + /// + /// + /// + protected void txtNumTratt_TextChanged(object sender, EventArgs e) + { + // controllo numero trattamento... + string codTratt = MagClass.magazzino.getCompTrattamenti(AnnoTratt, NumTratt); + // cerco se ci sia già (do errore...) + if (MagClass.magazzino.taET.getByTratt(codTratt).Rows.Count > 0) + { + Postazione.warningText = traduci("ERR-NTT-001"); + Postazione.CssClass = "stileComandoKo"; + NumTratt = ""; + } + else + { + Postazione.warningText = ""; + Postazione.CssClass = "stileComandoOk"; + } + Postazione.messaggiText = codTratt; + doUpdate(); + } + /// + /// modificata durezza + /// + /// + /// + protected void chkDurezza_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs b/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs index c5e16f30..396641b5 100644 --- a/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs +++ b/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs @@ -346,7 +346,7 @@ namespace GMW.WebUserControls { udcDest = ""; } - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { try { diff --git a/GMW/WebUserControls/mod_SterrTagIN.ascx.cs b/GMW/WebUserControls/mod_SterrTagIN.ascx.cs index ff856713..74ca16f8 100644 --- a/GMW/WebUserControls/mod_SterrTagIN.ascx.cs +++ b/GMW/WebUserControls/mod_SterrTagIN.ascx.cs @@ -6,462 +6,462 @@ using System.Web.UI.WebControls; namespace GMW.WebUserControls { - public partial class mod_SterrTagIN : System.Web.UI.UserControl + public partial class mod_SterrTagIN : System.Web.UI.UserControl + { + public event EventHandler eh_nuovaRicerca; + public event EventHandler eh_reqUpdate; + /// + /// stringa UID univoca + /// + public string uid { - public event EventHandler eh_nuovaRicerca; - public event EventHandler eh_reqUpdate; - /// - /// stringa UID univoca - /// - public string uid + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + fixRicercaUdc(); + traduciObj(); + idxCella = Postazione.currIdxCella; + } + doChecks(); + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + get + { + int answ = 0; + if (memLayer.ML.isInSessionObject("IdxCellaLineaST_IN")) { - get - { - return this.UniqueID.Replace("$", "_").Replace("-", "_"); - } + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_IN"); } - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaST_IN", value); + } + } + /// + /// verifica se si debab mostrare un campo ricerca UDC attivo... + /// + private void fixRicercaUdc() + { + if (memLayer.ML.isInSessionObject("valoreCercatoSTI")) + { + testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoSTI"); + } + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + 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 Sterrato IN {0}", udcReq), tipoLog.EXCEPTION); + } + if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Sterrato IN"); + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + btnCerca.Text = traduci("btnSearch"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + if (barcodeIn.StartsWith(preCmd)) { - if (!Page.IsPostBack) - { - fixRicercaUdc(); - traduciObj(); - idxCella = Postazione.currIdxCella; - } - doChecks(); + answ = tipoCodiceBarcode.Comando; } - /// - /// IDX cella associata alla linea corrente - /// - protected int idxCella + else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima... { - get - { - int answ = 0; - if (memLayer.ML.isInSessionObject("IdxCellaLineaST_IN")) - { - answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_IN"); - } - return answ; - } - set - { - memLayer.ML.setSessionVal("IdxCellaLineaST_IN", value); - } + answ = tipoCodiceBarcode.Particolare; } - /// - /// verifica se si debab mostrare un campo ricerca UDC attivo... - /// - private void fixRicercaUdc() + else { - if (memLayer.ML.isInSessionObject("valoreCercatoSTI")) + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) { - testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoSTI"); + answ = tipoCodiceBarcode.UDC; } + } + catch + { + } } - /// - /// richiesta (ri)stampa UDC - /// - /// - /// - public void ristampa() + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) { - bool fatto = false; - // registro ri-stampa UDC - DateTime adesso = DateTime.Now; - // calcolo particolare... - DS_magazzino.ElencoCartelliniRow rigaUDC; - string particolare = ""; - try + case tipoCodiceBarcode.UDC: + // se linea non selezionata ERRORE!!! + if (Postazione.currCodLinea == "W1000") { - 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 Sterrato IN {0}", udcReq), tipoLog.EXCEPTION); - } - if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Sterrato IN"); - } - /// - /// udc da stampare - /// - protected string udcReq - { - get - { - return memLayer.ML.StringSessionObj("udcSelSAO"); - } - } - /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - } - /// - /// sistemo labels oggetti - /// - private void traduciObj() - { - btnCerca.Text = traduci("btnSearch"); - } - /// - /// restituisce il nome della pagina corrente - /// - protected string PagCorrente - { - get - { - string answ = ""; - Uri MyUrl = Request.Url; - string delimStr = "/"; - char[] delimiter = delimStr.ToCharArray(); - string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); - int n = finalUrl.Length; - answ = finalUrl[n - 1].ToString(); - DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; - answ = riga.NOME; - return answ; - } - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// indica se i caratteri vadano forzati a maiuscoli - /// - public bool forceUppercase - { - get - { - return memLayer.ML.confReadBool("forceUppercase"); - } - } - /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.AppConf["prefComandi"]; - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima... - { - answ = tipoCodiceBarcode.Particolare; - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) - { - case tipoCodiceBarcode.UDC: - // se linea non selezionata ERRORE!!! - if (Postazione.currCodLinea == "W1000") - { - Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; - Postazione.CssClass = "stileComandoKo"; - } - else - { - // procedo solo se UDC esistente - if (MagClass.magazzino.checkUDC(barcodeIn)) - { - // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x fusi (pre sterratura/taglio) - int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; - if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneFusi")) - { - int idxCellaCurr = 0; - try - { - idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; - } - catch - { } - // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc - if (idxCellaCurr == Postazione.currIdxCella) - { - Postazione.messaggiText += " - Attenzione, UDC già caricato!"; - Postazione.CssClass = "stileComandoKo"; - } - else - { - // altrimenti procedo... - string codSogg = ""; - string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; - decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta; - string noteTrim = ""; - try - { - codSogg = MagClass.magazzino.CodSoggCurrUser; - } - catch - { } - try - { - noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim(); - } - catch - { - noteTrim = ""; - } - DateTime adesso = DateTime.Now; - // se ho cod cella sposto! - MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); - // registro sposstamento UDC - MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Fusi su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); - Postazione.CssClass = "stileComandoOk"; - } - } - else - { - // udc NON corretto, mostro errore... - Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!"; - Postazione.CssClass = "stileComandoKo"; - } - } - } - - break; - default: - Postazione.messaggiText += " - codice non riconosciuto!"; - Postazione.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; + Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; + Postazione.CssClass = "stileComandoKo"; } else { - Postazione.messaggiText = traduci("AttesaBCode"); - Postazione.CssClass = "stileAttesa"; - } - doUpdate(); - } - /// - /// aggiorna tabella + focus a barcode - /// - public void doUpdate() - { - idxCella = Postazione.currIdxCella; - grView.DataBind(); - txtBarcode.Focus(); - // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } - } - /// - /// wrapper per log con salvataggio dell'IP del chiamante - /// - /// - /// - public bool httpLog(string _testoPre) - { - bool answ = false; - logger.lg.scriviLog(Postazione.IP + _testoPre); - return answ; - } - /// - /// wrapper per log con salvataggio dell'IP del chiamante - /// - /// - /// - public bool httpLog(string testoLog, tipoLog tipo) - { - bool answ = false; - logger.lg.scriviLog(Postazione.IP + testoLog, tipo); - return answ; - } - /// - /// effettua reset dati - /// - public void doResetData() - { - // resetto i dati QtaTot e particolare... - testoRicerca = ""; - doChecks(); - } - /// - /// passo alla modalità OUT - /// - /// - /// - protected void btnOut_Click(object sender, EventArgs e) - { - Response.Redirect("SterrTaglioOUT.aspx"); - } - /// - /// cambiato valore in ricerca - /// - /// - /// - protected void txtCerca_TextChanged(object sender, EventArgs e) - { - salvaCerca(); - } - /// - /// effettuato reset - /// - /// - /// - protected void lnkReset_Click(object sender, EventArgs e) - { - testoRicerca = ""; - salvaCerca(); - } - /// - /// pressione del button di ricerca - /// - /// - /// - protected void btnCerca_Click(object sender, EventArgs e) - { - salvaCerca(); - } - - /// - /// testo ricerca trimmato da spazi - /// - protected string testoRicerca - { - get - { - return txtCerca.Text.Trim(); - } - set - { - txtCerca.Text = value; - } - } - protected void salvaCerca() - { - if (testoRicerca == "") - { - SteamWare.memLayer.ML.emptySessionVal("valoreCercatoSTI"); - } - else - { - SteamWare.memLayer.ML.setSessionVal("valoreCercatoSTI", testoRicerca); - } - // raise dell'evento - if (eh_nuovaRicerca != null) - { - eh_nuovaRicerca(this, new EventArgs()); - } - doUpdate(); - } - protected void grView_PageIndexChanged(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - protected void grView_Sorted(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - /// - /// aggiorno ods al binding.. - /// - /// - /// - protected void ods_DataBinding(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - /// - /// verifica se attivo filtro company e imposta ods di conseguenza... - /// - private void checkFixOds() - { - } - /// - /// traduce gli header delle colonne - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) - { - if (grView.Rows.Count > 0) - { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x fusi (pre sterratura/taglio) + int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; + if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneFusi")) { + int idxCellaCurr = 0; + try + { + idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; + } + catch + { } + // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc + if (idxCellaCurr == Postazione.currIdxCella) + { + Postazione.messaggiText += " - Attenzione, UDC già caricato!"; + Postazione.CssClass = "stileComandoKo"; + } + else + { + // altrimenti procedo... + string codSogg = ""; + string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; + decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta; + string noteTrim = ""; try { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); + codSogg = MagClass.magazzino.CodSoggCurrUser; } catch { } + try + { + noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim(); + } + catch + { + noteTrim = ""; + } + DateTime adesso = DateTime.Now; + // se ho cod cella sposto! + MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); + // registro sposstamento UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Fusi su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); + Postazione.CssClass = "stileComandoOk"; + } } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); - } - else - { - lblNumRec.Text = ""; + else + { + // udc NON corretto, mostro errore... + Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!"; + Postazione.CssClass = "stileComandoKo"; + } + } } + + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + Postazione.CssClass = "stileComandoND"; + break; } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + doUpdate(); } + /// + /// aggiorna tabella + focus a barcode + /// + public void doUpdate() + { + idxCella = Postazione.currIdxCella; + grView.DataBind(); + txtBarcode.Focus(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string _testoPre) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + _testoPre); + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string testoLog, tipoLog tipo) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + testoLog, tipo); + return answ; + } + /// + /// effettua reset dati + /// + public void doResetData() + { + // resetto i dati QtaTot e particolare... + testoRicerca = ""; + doChecks(); + } + /// + /// passo alla modalità OUT + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.Redirect("SterrTaglioOUT.aspx"); + } + /// + /// cambiato valore in ricerca + /// + /// + /// + protected void txtCerca_TextChanged(object sender, EventArgs e) + { + salvaCerca(); + } + /// + /// effettuato reset + /// + /// + /// + protected void lnkReset_Click(object sender, EventArgs e) + { + testoRicerca = ""; + salvaCerca(); + } + /// + /// pressione del button di ricerca + /// + /// + /// + protected void btnCerca_Click(object sender, EventArgs e) + { + salvaCerca(); + } + + /// + /// testo ricerca trimmato da spazi + /// + protected string testoRicerca + { + get + { + return txtCerca.Text.Trim(); + } + set + { + txtCerca.Text = value; + } + } + protected void salvaCerca() + { + if (string.IsNullOrEmpty(testoRicerca)) + { + memLayer.ML.emptySessionVal("valoreCercatoSTI"); + } + else + { + memLayer.ML.setSessionVal("valoreCercatoSTI", testoRicerca); + } + // raise dell'evento + if (eh_nuovaRicerca != null) + { + eh_nuovaRicerca(this, new EventArgs()); + } + doUpdate(); + } + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + protected void grView_Sorted(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// aggiorno ods al binding.. + /// + /// + /// + protected void ods_DataBinding(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// verifica se attivo filtro company e imposta ods di conseguenza... + /// + private void checkFixOds() + { + } + /// + /// traduce gli header delle colonne + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs b/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs index 723f0977..b592b2c7 100644 --- a/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs +++ b/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs @@ -801,7 +801,7 @@ namespace GMW.WebUserControls /// protected void salvaCerca() { - if (testoRicerca == "") + if (string.IsNullOrEmpty(testoRicerca)) { SteamWare.memLayer.ML.emptySessionVal("valoreCercatoSTO"); udcSelC = ""; diff --git a/GMW/WebUserControls/mod_UdcCella.ascx.cs b/GMW/WebUserControls/mod_UdcCella.ascx.cs index 65c00a3b..5bba8699 100644 --- a/GMW/WebUserControls/mod_UdcCella.ascx.cs +++ b/GMW/WebUserControls/mod_UdcCella.ascx.cs @@ -7,357 +7,357 @@ using System.Web.UI.WebControls; namespace GMW.WebUserControls { - public partial class mod_UdcCella : SteamWare.ApplicationUserControl + public partial class mod_UdcCella : SteamWare.ApplicationUserControl + { + #region area da NON modificare + + #region area protected + + protected string _idxGridView; + protected string _idxGridViewExt; + protected string _tabCache; + protected bool _showNewBtn = false; + + + /// + /// traduce gli header delle colonne + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) { - #region area da NON modificare - - #region area protected - - protected string _idxGridView; - protected string _idxGridViewExt; - protected string _tabCache; - protected bool _showNewBtn = false; - - - /// - /// traduce gli header delle colonne - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) { - if (grView.Rows.Count > 0) - { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) - { - try - { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); - } - catch - { } - } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); - } - else - { - lblNumRec.Text = ""; - } + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } } - - - /// - /// collega i controlli - /// - protected override void bindControlli() - { - base.bindControlli(); - caricaTabelle(); - } - - #endregion - - #region gestione eventi - - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; - public event EventHandler eh_selValore; - - #endregion - - #region public - - /// - /// effettua update del modulo - /// - public void doUpdate() - { - resetSelezione(); - checkFixOds(); - grView.DataBind(); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); - grView.SelectedIndex = -1; - lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } - } - - #endregion - - #endregion - - #region area codice variabile - - public event EventHandler eh_nuovaRicerca; - - /// - /// aggiorna controlli datagrid e numero righe in pagina - /// - protected override void aggiornaControlliDataGL() - { - base.aggiornaControlliDataGL(); - grView.PageSize = _righeDataGridShort; - } - /// - /// carico le tabelle - /// - private void caricaTabelle() - { - } - /// - /// elenco colonne del datagrid - /// - /// - protected DataColumnCollection colonneObj() - { - DS_magazzino.v_UdcDetailDataTable tabella = new DS_magazzino.v_UdcDetailDataTable(); - DataColumnCollection colonne = tabella.Columns; - return colonne; - } - /// - /// inizializzazione valori di default - /// - /// - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - if (!Page.IsPostBack) - { - traduzione(); - azzeraPostUpdate(); - updateText(); - } - _idxGridView = "UDC2edit"; - } - /// - /// traduzioni - /// - protected void traduzione() - { - // sistemo labels e buttons - lblQta.Text = traduci("lblQta"); - lblNewPos.Text = traduci("lblNewPos"); - lblErrore.Text = traduci("ErroreCellaDestOccupata"); - btnQta.Text = traduci("btnQta"); - btnSposta.Text = traduci("btnSposta"); - } - /// - /// verifica se attivo filtro company e imposta ods di conseguenza... - /// - private void checkFixOds() - { - } - /// - /// aggiorno ods al binding.. - /// - /// - /// - protected void ods_DataBinding(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - - protected void grView_PageIndexChanged(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - protected void grView_Sorted(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - - protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - - /// - /// chiama procedura x spostamento tra celle di un UDC - /// - /// - /// - protected void btnSposta_Click1(object sender, EventArgs e) - { - // ricavo il valore dell'UDC cliccato... - string UDC = memLayer.ML.StringSessionObj(string.Format("{0}_sel", _idxGridView)); - int IdxCellaTo = 0; - bool cellaToOk = false; - try - { - DS_magazzino.CelleRow rowCella = MagClass.magazzino.taCelle.getByCodCella(txtNewCella.Text)[0]; - IdxCellaTo = rowCella.IdxCella; - // controllo che la cella di destinazione NON sia bloccata - cellaToOk = rowCella.Attiva; - } - catch - { } - if (cellaToOk) - { - // controllo che sia valido x fare l'operazione - if (IdxCellaTo > 0) - { - MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), UDC, IdxCellaTo, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); - } - azzeraPostUpdate(); - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - else - { - // la cella è bloccata, nn devo permettere spostamento - lblErrore.Visible = true; - } - } - /// - /// aggiorna la qta pezzi dell'UDC indicato - /// - /// - /// - protected void btnQta_Click(object sender, EventArgs e) - { - string UDC = memLayer.ML.StringSessionObj(string.Format("{0}_sel", _idxGridView)); - decimal qta = -1; - try - { - qta = Convert.ToDecimal(txtQta.Text); - } - catch - { } - if (qta >= 0) - { - MagClass.magazzino.rettificaQtaUDC(UDC, qta, Request.UserHostName); - } - azzeraPostUpdate(); - } - - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - azzeraPostUpdate(); - } - /// - /// reset controlli post aggiornamento - /// - private void azzeraPostUpdate() - { - lblErrore.Visible = false; - grView.DataBind(); - resetSelezione(); - txtNewCella.Text = ""; - txtQta.Text = ""; - doShowPanels(false); - } - /// - /// gestione cambio selezione valore - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in session il valore selezionato... - memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, true); - // fix panels - doShowPanels(true); - // sollevo evento nuovo valore... - if (eh_selValore != null) - { - eh_selValore(this, new EventArgs()); - } - } - /// - /// determina visibilità panels correzione valori - /// - /// - private void doShowPanels(bool p) - { - pnlQta.Visible = p; - pnlSposta.Visible = p; - } - - - /// - /// cambiato valore in ricerca - /// - /// - /// - protected void txtCerca_TextChanged(object sender, EventArgs e) - { - salvaCerca(); - } - /// - /// pressione del button di ricerca - /// - /// - /// - protected void btnCerca_Click(object sender, EventArgs e) - { - salvaCerca(); - } - - /// - /// testo ricerca trimmato da spazi - /// - protected string testoRicerca - { - get - { - return txtCerca.Text.Trim(); - } - set - { - txtCerca.Text = value; - } - } - protected void salvaCerca() - { - if (testoRicerca == "") - { - SteamWare.memLayer.ML.emptySessionVal("valoreCercatoCella"); - } - else - { - SteamWare.memLayer.ML.setSessionVal("valoreCercatoCella", testoRicerca); - } - // raise dell'evento - if (eh_nuovaRicerca != null) - { - eh_nuovaRicerca(this, new EventArgs()); - } - } - /// - /// aggiorna il testo cercato - /// - public void updateText() - { - if (SteamWare.memLayer.ML.StringSessionObj("valoreCercatoCella") != "" && !Page.IsPostBack) - { - testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercatoCella"); - } - } - - #endregion - + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } } + + + /// + /// collega i controlli + /// + protected override void bindControlli() + { + base.bindControlli(); + caricaTabelle(); + } + + #endregion + + #region gestione eventi + + public event EventHandler eh_resetSelezione; + public event EventHandler eh_nuovoValore; + public event EventHandler eh_selValore; + + #endregion + + #region public + + /// + /// effettua update del modulo + /// + public void doUpdate() + { + resetSelezione(); + checkFixOds(); + grView.DataBind(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + grView.SelectedIndex = -1; + lblWarning.Visible = false; + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + + #endregion + + #endregion + + #region area codice variabile + + public event EventHandler eh_nuovaRicerca; + + /// + /// aggiorna controlli datagrid e numero righe in pagina + /// + protected override void aggiornaControlliDataGL() + { + base.aggiornaControlliDataGL(); + grView.PageSize = _righeDataGridShort; + } + /// + /// carico le tabelle + /// + private void caricaTabelle() + { + } + /// + /// elenco colonne del datagrid + /// + /// + protected DataColumnCollection colonneObj() + { + DS_magazzino.v_UdcDetailDataTable tabella = new DS_magazzino.v_UdcDetailDataTable(); + DataColumnCollection colonne = tabella.Columns; + return colonne; + } + /// + /// inizializzazione valori di default + /// + /// + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + if (!Page.IsPostBack) + { + traduzione(); + azzeraPostUpdate(); + updateText(); + } + _idxGridView = "UDC2edit"; + } + /// + /// traduzioni + /// + protected void traduzione() + { + // sistemo labels e buttons + lblQta.Text = traduci("lblQta"); + lblNewPos.Text = traduci("lblNewPos"); + lblErrore.Text = traduci("ErroreCellaDestOccupata"); + btnQta.Text = traduci("btnQta"); + btnSposta.Text = traduci("btnSposta"); + } + /// + /// verifica se attivo filtro company e imposta ods di conseguenza... + /// + private void checkFixOds() + { + } + /// + /// aggiorno ods al binding.. + /// + /// + /// + protected void ods_DataBinding(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + protected void grView_Sorted(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + + protected void grView_RowUpdated(object sender, GridViewUpdatedEventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + + /// + /// chiama procedura x spostamento tra celle di un UDC + /// + /// + /// + protected void btnSposta_Click1(object sender, EventArgs e) + { + // ricavo il valore dell'UDC cliccato... + string UDC = memLayer.ML.StringSessionObj(string.Format("{0}_sel", _idxGridView)); + int IdxCellaTo = 0; + bool cellaToOk = false; + try + { + DS_magazzino.CelleRow rowCella = MagClass.magazzino.taCelle.getByCodCella(txtNewCella.Text)[0]; + IdxCellaTo = rowCella.IdxCella; + // controllo che la cella di destinazione NON sia bloccata + cellaToOk = rowCella.Attiva; + } + catch + { } + if (cellaToOk) + { + // controllo che sia valido x fare l'operazione + if (IdxCellaTo > 0) + { + MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), UDC, IdxCellaTo, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); + } + azzeraPostUpdate(); + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } + } + else + { + // la cella è bloccata, nn devo permettere spostamento + lblErrore.Visible = true; + } + } + /// + /// aggiorna la qta pezzi dell'UDC indicato + /// + /// + /// + protected void btnQta_Click(object sender, EventArgs e) + { + string UDC = memLayer.ML.StringSessionObj(string.Format("{0}_sel", _idxGridView)); + decimal qta = -1; + try + { + qta = Convert.ToDecimal(txtQta.Text); + } + catch + { } + if (qta >= 0) + { + MagClass.magazzino.rettificaQtaUDC(UDC, qta, Request.UserHostName); + } + azzeraPostUpdate(); + } + + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + azzeraPostUpdate(); + } + /// + /// reset controlli post aggiornamento + /// + private void azzeraPostUpdate() + { + lblErrore.Visible = false; + grView.DataBind(); + resetSelezione(); + txtNewCella.Text = ""; + txtQta.Text = ""; + doShowPanels(false); + } + /// + /// gestione cambio selezione valore + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session il valore selezionato... + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, true); + // fix panels + doShowPanels(true); + // sollevo evento nuovo valore... + if (eh_selValore != null) + { + eh_selValore(this, new EventArgs()); + } + } + /// + /// determina visibilità panels correzione valori + /// + /// + private void doShowPanels(bool p) + { + pnlQta.Visible = p; + pnlSposta.Visible = p; + } + + + /// + /// cambiato valore in ricerca + /// + /// + /// + protected void txtCerca_TextChanged(object sender, EventArgs e) + { + salvaCerca(); + } + /// + /// pressione del button di ricerca + /// + /// + /// + protected void btnCerca_Click(object sender, EventArgs e) + { + salvaCerca(); + } + + /// + /// testo ricerca trimmato da spazi + /// + protected string testoRicerca + { + get + { + return txtCerca.Text.Trim(); + } + set + { + txtCerca.Text = value; + } + } + protected void salvaCerca() + { + if (string.IsNullOrEmpty(testoRicerca)) + { + SteamWare.memLayer.ML.emptySessionVal("valoreCercatoCella"); + } + else + { + SteamWare.memLayer.ML.setSessionVal("valoreCercatoCella", testoRicerca); + } + // raise dell'evento + if (eh_nuovaRicerca != null) + { + eh_nuovaRicerca(this, new EventArgs()); + } + } + /// + /// aggiorna il testo cercato + /// + public void updateText() + { + if (SteamWare.memLayer.ML.StringSessionObj("valoreCercatoCella") != "" && !Page.IsPostBack) + { + testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercatoCella"); + } + } + + #endregion + + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_autocomplete.ascx.cs b/GMW/WebUserControls/mod_autocomplete.ascx.cs index ad87ca49..1918fe37 100644 --- a/GMW/WebUserControls/mod_autocomplete.ascx.cs +++ b/GMW/WebUserControls/mod_autocomplete.ascx.cs @@ -5,263 +5,263 @@ using System.Web.UI.WebControls; namespace GMW.WebUserControls { - public partial class mod_autocomplete : System.Web.UI.UserControl + public partial class mod_autocomplete : System.Web.UI.UserControl + { + /// + /// evento valore selezionato + /// + public event EventHandler eh_valSelezionato; + /// + /// evento valore selezionato + /// + public event EventHandler eh_reset; + /// + /// segnaposto x casella testuale autocomplete + /// + public string placeholder { get; set; } + + /// + /// UID formattato con "_" + /// + public string uid { - /// - /// evento valore selezionato - /// - public event EventHandler eh_valSelezionato; - /// - /// evento valore selezionato - /// - public event EventHandler eh_reset; - /// - /// segnaposto x casella testuale autocomplete - /// - public string placeholder { get; set; } - - /// - /// UID formattato con "_" - /// - public string uid - { - get - { - // fix brutale: nelle pagine master c'è un ctl00_ iniziale di troppo... - return this.UniqueID.Replace("$", "_").Replace("ctl00_", "").Replace("ctl01_", ""); - } - } - - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - defaultVal = ""; - txtSel.Attributes["placeholder"] = placeholder; - } - } - - protected void txtSel_TextChanged(object sender, EventArgs e) - { - if (txtSel.Text.Trim() == "") - { - hiddenFieldID.Text = defaultVal; - _valore = defaultVal; - if (eh_valSelezionato != null) - { - eh_valSelezionato(this, new EventArgs()); - } - } - } - - /// - /// salvo valore selezionato! - /// - /// - /// - protected void hiddenFieldID_TextChanged(object sender, EventArgs e) - { - _valore = hiddenFieldID.Text; - if (eh_valSelezionato != null) - { - eh_valSelezionato(this, new EventArgs()); - } - } - /// - /// valore selezionato dal controllo (RW local) - /// - protected string _valore - { - get - { - return memLayer.ML.StringSessionObj(uid + "_sel"); - } - set - { - memLayer.ML.setSessionVal(uid + "_sel", value); - } - } - /// - /// salva evento selezione - /// - /// - /// - protected void btnPost_Click(object sender, EventArgs e) - { - _valore = hiddenFieldID.Text; - if (eh_valSelezionato != null) - { - eh_valSelezionato(this, new EventArgs()); - } - } - - /// - /// valore (chiave) selezionato dal controllo (R public) - /// - public string valore - { - get - { - return hiddenFieldID.Text; - } - set - { - hiddenFieldID.Text = value; - } - } - /// - /// label selezionato dal controllo (R public) - /// - public string selezione - { - get - { - return txtSel.Text; - } - set - { - txtSel.Text = value; - } - } - /// - /// label dell'etichetta di ricerca - /// - public string labelRicerca - { - set - { - lblField.Text = value; - } - } - /// - /// num minimo caratteri x autocomplete - /// - public Int32 minCharAutocomplete - { - get - { - return Convert.ToInt32(txtMinCharAutoCom.Text); - } - set - { - txtMinCharAutoCom.Text = value.ToString(); - } - } - /// - /// path del webservice (compreso metodo) - /// nb: DI NORMA fornisce risultati nel formato label#valore - /// - public string ServicePath - { - get - { - return txtServiceUrl.Text; - } - set - { - txtServiceUrl.Text = value; - } - } - /// - /// imposta visibilità della textBox delle chiavi - /// - public bool showKey - { - set - { - if (!value) - { - hiddenFieldID.Width = Unit.Pixel(0); - } - } - } - /// - /// imposta la stringa tooltip - /// - public string toolTip - { - set - { - txtSel.ToolTip = value; - } - } - - /// - /// larghezza textbox in unità EM - /// - public int textEmWidht - { - set - { - txtSel.Width = Unit.Parse(string.Format("{0}em", value)); - } - } - /// - /// larghezza textbox in unità % - /// - public int textEmPerc - { - set - { - txtSel.Width = Unit.Parse(string.Format("{0}%", value)); - } - } - /// - /// imposta il focus sulla textBox - /// - public void setFocus() - { - txtSel.Focus(); - } - /// - /// permette di passare altri parametri di contesto al metodo invocato x autocomplete - /// - public string contextKey - { - get - { - return txtSel.AccessKey; - } - set - { - txtSel.AccessKey = value; - } - } - /// - /// tabIndex del controllo - /// - public short TabIndex - { - set - { - txtSel.TabIndex = value; - } - } - /// - /// valore di default (x reset) - /// - public string defaultVal { get; set; } - - /// - /// effettuato reset - /// - /// - /// - protected void lnkReset_Click(object sender, EventArgs e) - { - // resetto selezione e ricerca! - txtSel.Text = ""; - hiddenFieldID.Text = defaultVal; - _valore = defaultVal; - if (eh_reset != null) - { - eh_reset(this, new EventArgs()); - } - } + get + { + // fix brutale: nelle pagine master c'è un ctl00_ iniziale di troppo... + return this.UniqueID.Replace("$", "_").Replace("ctl00_", "").Replace("ctl01_", ""); + } } + + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + defaultVal = ""; + txtSel.Attributes["placeholder"] = placeholder; + } + } + + protected void txtSel_TextChanged(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(txtSel.Text.Trim())) + { + hiddenFieldID.Text = defaultVal; + _valore = defaultVal; + if (eh_valSelezionato != null) + { + eh_valSelezionato(this, new EventArgs()); + } + } + } + + /// + /// salvo valore selezionato! + /// + /// + /// + protected void hiddenFieldID_TextChanged(object sender, EventArgs e) + { + _valore = hiddenFieldID.Text; + if (eh_valSelezionato != null) + { + eh_valSelezionato(this, new EventArgs()); + } + } + /// + /// valore selezionato dal controllo (RW local) + /// + protected string _valore + { + get + { + return memLayer.ML.StringSessionObj(uid + "_sel"); + } + set + { + memLayer.ML.setSessionVal(uid + "_sel", value); + } + } + /// + /// salva evento selezione + /// + /// + /// + protected void btnPost_Click(object sender, EventArgs e) + { + _valore = hiddenFieldID.Text; + if (eh_valSelezionato != null) + { + eh_valSelezionato(this, new EventArgs()); + } + } + + /// + /// valore (chiave) selezionato dal controllo (R public) + /// + public string valore + { + get + { + return hiddenFieldID.Text; + } + set + { + hiddenFieldID.Text = value; + } + } + /// + /// label selezionato dal controllo (R public) + /// + public string selezione + { + get + { + return txtSel.Text; + } + set + { + txtSel.Text = value; + } + } + /// + /// label dell'etichetta di ricerca + /// + public string labelRicerca + { + set + { + lblField.Text = value; + } + } + /// + /// num minimo caratteri x autocomplete + /// + public Int32 minCharAutocomplete + { + get + { + return Convert.ToInt32(txtMinCharAutoCom.Text); + } + set + { + txtMinCharAutoCom.Text = value.ToString(); + } + } + /// + /// path del webservice (compreso metodo) + /// nb: DI NORMA fornisce risultati nel formato label#valore + /// + public string ServicePath + { + get + { + return txtServiceUrl.Text; + } + set + { + txtServiceUrl.Text = value; + } + } + /// + /// imposta visibilità della textBox delle chiavi + /// + public bool showKey + { + set + { + if (!value) + { + hiddenFieldID.Width = Unit.Pixel(0); + } + } + } + /// + /// imposta la stringa tooltip + /// + public string toolTip + { + set + { + txtSel.ToolTip = value; + } + } + + /// + /// larghezza textbox in unità EM + /// + public int textEmWidht + { + set + { + txtSel.Width = Unit.Parse(string.Format("{0}em", value)); + } + } + /// + /// larghezza textbox in unità % + /// + public int textEmPerc + { + set + { + txtSel.Width = Unit.Parse(string.Format("{0}%", value)); + } + } + /// + /// imposta il focus sulla textBox + /// + public void setFocus() + { + txtSel.Focus(); + } + /// + /// permette di passare altri parametri di contesto al metodo invocato x autocomplete + /// + public string contextKey + { + get + { + return txtSel.AccessKey; + } + set + { + txtSel.AccessKey = value; + } + } + /// + /// tabIndex del controllo + /// + public short TabIndex + { + set + { + txtSel.TabIndex = value; + } + } + /// + /// valore di default (x reset) + /// + public string defaultVal { get; set; } + + /// + /// effettuato reset + /// + /// + /// + protected void lnkReset_Click(object sender, EventArgs e) + { + // resetto selezione e ricerca! + txtSel.Text = ""; + hiddenFieldID.Text = defaultVal; + _valore = defaultVal; + if (eh_reset != null) + { + eh_reset(this, new EventArgs()); + } + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_confLinea.ascx.cs b/GMW/WebUserControls/mod_confLinea.ascx.cs index 1b045958..bcb34bea 100644 --- a/GMW/WebUserControls/mod_confLinea.ascx.cs +++ b/GMW/WebUserControls/mod_confLinea.ascx.cs @@ -8,193 +8,6 @@ namespace GMW.WebUserControls { public partial class mod_confLinea : ApplicationUserControl { -#if false - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - grView.SelectedIndex = -1; - grView.DataBind(); - raiseEvent(ucEvType.Reset); - } - /// - /// inserisce nuovo valore da footer - /// - /// - /// - protected void lblIns_click(object sender, EventArgs e) - { - // click su inserimento, chiamo il metodo insert dell'ObjectDataSource - ods.Insert(); - } - /// - /// gestione evento richiesta nuovo valore (mostra footer, ...) - /// - /// - /// - protected void btnNew_Click(object sender, EventArgs e) - { - // creo nuova riga NON ATTIVA!!! - creaNuovaLinea(); - // reset selezione... - resetSelezione(); - } - /// - /// Creo una nuova linea andando a creare prima tutte el dipendenze... - /// - private void creaNuovaLinea() - { - DS_magazzino.BlocchiRow rigaBlocco = null; - DS_magazzino.TipoCellaRow rigaTipoCella = null; - DS_magazzino.CelleDataTable tabCelle = null; - DS_magazzino.CelleRow rigaCella = null; - string codMagPost = ""; - string CodCS = memLayer.ML.CRS("CodCS"); - - // recupero blocco selezionato - try - { - rigaBlocco = MagClass.magazzino.taBlocchi.getByCodBlocco(CodBlocco)[0]; - } - catch - { } - if (rigaBlocco != null) - { - // 2016.08.04 modifica: CodMag da decodifica Blocchi: CodBlocco selezionato --> vedo quale CodMag (e NON + da web.config) - codMagPost = rigaBlocco.CodMag; - //// OLD: magazzino linee: da web config ("WIP") cerco il suo CodMag - //string codMagPost = memLayer.ML.CRS("codMagPost"); - - // recupero TipoCella - try - { - // attenzione: capienza == 1 x quelle cercate... - rigaTipoCella = ((DS_magazzino.TipoCellaRow)MagClass.magazzino.taTipoCella.getByCodMag(CodCS, codMagPost).Select(" Capienza = 1 ")[0]); - } - catch - { } - if (rigaTipoCella != null) - { - // --> +1 qta cella - MagClass.magazzino.taTipoCella.UpdateQuery(rigaTipoCella.IdxTipoCella, codMagPost, CodCS, rigaTipoCella.Quantita + 1, rigaTipoCella.Capienza, rigaTipoCella.Max_X, rigaTipoCella.Max_Y, rigaTipoCella.Max_Z, rigaTipoCella.Max_Kg, rigaTipoCella.CheckPiena, rigaTipoCella.SetMag); - // --> +1 qta blocco - MagClass.magazzino.taBlocchi.UpdateQuery(codMagPost, CodCS, rigaBlocco.CodBlocco, rigaBlocco.DescBlocco, rigaBlocco.NumX + 1, rigaBlocco.NumY, rigaBlocco.NumZ, rigaBlocco.IdxBlocco); - // creo NUOVA CELLA - utils.obj.taSTP.stp_celleCreaMancantiBlocco(CodCS, codMagPost, rigaBlocco.IdxBlocco, rigaTipoCella.IdxTipoCella); - // recupero ultima cella creata... - tabCelle = MagClass.magazzino.taCelle.getByIdxBlocco(rigaBlocco.IdxBlocco); - if (tabCelle.Rows.Count > 0) - { - try - { - rigaCella = (DS_magazzino.CelleRow)tabCelle.Select(string.Format("X = {0}", rigaBlocco.NumX + 1))[0]; - } - catch - { } - if (rigaCella != null) - { - // creo nuova linea - MagClass.magazzino.taAL.Insert(rigaCella.CodCella.Substring(0, 5), "NUOVA LINEA", "", DateTime.Now, "", "", false, false, "ND", "IO", false, memLayer.ML.CRI("minTimeDef"), memLayer.ML.CRI("maxTimeDef")); - } - } - - } - } - } - - /// - /// determina se sia eliminabile il record (=non usato) - /// - /// - /// - public bool delEnabled(object idxObj) - { - bool answ = isWritable(); - - return answ; - } - - /// - /// elenco colonne del datagrid - /// - /// - protected DataColumnCollection colonneObj() - { - DS_DataMatrix.TabSpecDtxDataTable tabella = new DS_DataMatrix.TabSpecDtxDataTable(); - DataColumnCollection colonne = tabella.Columns; - return colonne; - } - /// - /// recupera i dati di un nuovo record contenuti nel footer di un gridView; - /// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...) - /// - /// - /// - protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) - { - //recupero la riga footer... - DataColumnCollection colonne = colonneObj(); - string nomeCol; - string tipoColonna = ""; - foreach (DataColumn colonna in colonne) - { - nomeCol = colonna.ColumnName; - // cerco un textbox o quello che sia... - if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null) - { - tipoColonna = "textBox"; - } - else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null) - { - tipoColonna = "dropDownList"; - } - else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null) - { - tipoColonna = "checkBox"; - } - else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null) - { - tipoColonna = "selAjax"; - } - // in base al tipo salvo negli inputparameters dell'ODS - switch (tipoColonna) - { - case "textBox": - e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text; - break; - case "dropDownList": - e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue; - break; - case "checkBox": - e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked; - break; - case "selAjax": - e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore; - break; - default: - break; - } - tipoColonna = ""; - } - // imposto formato Dtmx - e.InputParameters["FormatoDtmx"] = ""; - } - - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - raiseEvent(ucEvType.Selected); - } -#endif public string codLinea { @@ -213,11 +26,11 @@ namespace GMW.WebUserControls /// /// /// - public string cssFromModo(object _modo) + public static string cssFromModo(object _modo) { int val = 0; string answ = ""; - int.TryParse(_modo.ToString(), out val); + bool convOk = int.TryParse(_modo.ToString(), out val); switch (val) { case 0: diff --git a/GMW/WebUserControls/mod_consKitAnime.ascx.cs b/GMW/WebUserControls/mod_consKitAnime.ascx.cs index 7b983569..6b27f291 100644 --- a/GMW/WebUserControls/mod_consKitAnime.ascx.cs +++ b/GMW/WebUserControls/mod_consKitAnime.ascx.cs @@ -26,7 +26,7 @@ namespace GMW.WebUserControls { lblALSel.Text = string.Format("AL KIT: {0}", currAL_KA); } - if (lblALSel.Text == "") + if (string.IsNullOrEmpty(lblALSel.Text)) { lblALSel.Text = "..."; } diff --git a/GMW/WebUserControls/mod_consumoAnime.ascx.cs b/GMW/WebUserControls/mod_consumoAnime.ascx.cs index 282c32c1..6b88f3c2 100644 --- a/GMW/WebUserControls/mod_consumoAnime.ascx.cs +++ b/GMW/WebUserControls/mod_consumoAnime.ascx.cs @@ -166,7 +166,7 @@ namespace GMW.WebUserControls } catch { } - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = "stileComandoND"; } @@ -478,7 +478,7 @@ namespace GMW.WebUserControls else { currMess = traduci("AttesaBCode"); - if (currUdcFrom == "") + if (string.IsNullOrEmpty(currUdcFrom)) { currCss = "stileAttesa"; } diff --git a/GMW/WebUserControls/mod_consumoFusi.ascx.cs b/GMW/WebUserControls/mod_consumoFusi.ascx.cs index df5367de..ce59b581 100644 --- a/GMW/WebUserControls/mod_consumoFusi.ascx.cs +++ b/GMW/WebUserControls/mod_consumoFusi.ascx.cs @@ -5,313 +5,313 @@ using System.Web.UI; namespace GMW.WebUserControls { - public partial class mod_consumoFusi : System.Web.UI.UserControl + public partial class mod_consumoFusi : System.Web.UI.UserControl + { + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - disableConfirm = false; - traduciObj(); - } - doChecks(); - lblGitterBoxAttivo.Text = ""; - if (currUdcFrom != "") - { - lblGitterBoxAttivo.Text += string.Format("UDC FROM: {0}", currUdcFrom); - } - if (lblGitterBoxAttivo.Text == "") - { - lblGitterBoxAttivo.Text = "..."; - } - } - /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - checkConsuma(); - } - /// - /// sistemo labels oggetti - /// - private void traduciObj() - { - // buttons - btnConsuma.Text = traduci("btnConsumaUdc"); - // fix button gestione disabilitazione conferme - fixBtnDisableConf(); - } - /// - /// ssitema btn abilitazione/disabilitazione conferma comandi - /// - private void fixBtnDisableConf() - { - if (disableConfirm) - { - btnDisableConf.Text = traduci("confirmDisabled"); - btnDisableConf.CssClass = "btn btn-danger"; - } - else - { - btnDisableConf.Text = traduci("confirmEnabled"); - btnDisableConf.CssClass = "btn btn-success"; - } - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// indica UDC FROM (F10) selezionato - /// - protected string currUdcFrom - { - get - { - return memLayer.ML.StringSessionObj("currUdcFrom"); - } - set - { - memLayer.ML.setSessionVal("currUdcFrom", value, false); - } - } - /// - /// indica se i caratteri vadano forzati a maiuscoli - /// - public bool forceUppercase - { - get - { - return memLayer.ML.confReadBool("forceUppercase"); - } - } - /// - /// indica se siano disabilitate le conferme x avere operazioni veloci - /// - public bool disableConfirm - { - get - { - return memLayer.ML.BoolSessionObj("disableConfirm"); - } - set - { - memLayer.ML.setSessionVal("disableConfirm", value); - fixBtnDisableConf(); - } - } - /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.AppConf["prefComandi"]; - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - // controllo se sia un particolare Tipo P - else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... - { - answ = tipoCodiceBarcode.Particolare; - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - DS_Applicazione.ElencoCartelliniRow rigaCart; - string tipoImballo = ""; - lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn); - Postazione.warningText = ""; - switch (tipoBCode) - { - case tipoCodiceBarcode.UDC: - // procedo solo se UDC esistente - if (MagClass.magazzino.checkUDC(barcodeIn)) - { - // controllo se NON ci siano NC "pending" - if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc) - { - // cerco di recuperare riga UDC - try - { - rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; - tipoImballo = rigaCart.CodImballo; - } - catch - { } - // salvo UDC from - currUdcFrom = barcodeIn; - pnlAll.CssClass = "stileAttesa"; - // controllo: se sono in fast mode SCARICO! - if (disableConfirm) - { - scaricaUdcFrom(); - } - // controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG... - if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc) - { - Postazione.CssClass = "stileComandoKo"; - Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); - // recupero l'NC associata... - Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); - } - } - else - { - Postazione.CssClass = "stileComandoKo"; - Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); - // recupero l'NC associata... - Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); - } - } - break; - case tipoCodiceBarcode.Comando: - // se richiesto scarico rapido lo gestisco - if (barcodeIn.ToUpper() == memLayer.ML.cdv("cmdFast").ToUpper()) - { - disableConfirm = !disableConfirm; - lblMessaggi.Text = traduci("enDisFastMode"); - } - break; - default: - lblMessaggi.Text += " - codice non riconosciuto!"; - pnlAll.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; - } - else - { - lblMessaggi.Text = traduci("AttesaBCode"); - pnlAll.CssClass = "stileAttesa"; - } - //grView.DataBind(); - txtBarcode.Focus(); - } - /// - /// controllo abilitazione consumo - /// - private void checkConsuma() - { - bool consumaOk = false; - if (!disableConfirm) - { - if (currUdcFrom != "") - { - consumaOk = true; - } - } - btnConsuma.Enabled = consumaOk; - } - /// - /// genera i barcode di - /// - trattamenti - /// - nuovo x pezzi liquidi - /// e lancia la relativa stampa - /// - /// - /// - protected void btnConsuma_Click(object sender, EventArgs e) - { - scaricaUdcFrom(); - } - /// - /// effettua scaricamento UDC FROM - /// - private void scaricaUdcFrom() - { - if (currUdcFrom != "") - { - // controllo se UDC non sia già consumato... - if (MagClass.magazzino.udcMpIsConsumabile(currUdcFrom)) - { - // controllo UDC sia corretto (in giusta posizione...) - if (MagClass.magazzino.IdxPosizioneUdc(currUdcFrom) == memLayer.ML.cdvi("IdxPosizioneFusi")) - { - // consumo UDC - MagClass.magazzino.scaricaUdcMpWip(currUdcFrom, Request.UserHostName); - // indico UDC consumato! - lblMessaggi.Text = string.Format("{0} {1}", traduci("effettuatoConsumoUDC"), currUdcFrom); - currUdcFrom = ""; - pnlAll.CssClass = "stileComandoOk"; - } - else - { - // indico UDC sbagliato! - lblMessaggi.Text = string.Format("{0} {1}", traduci("UDC_tipoSbagliato"), currUdcFrom); - pnlAll.CssClass = "stileComandoKo"; - } - } - else - { - // indico UDC consumato! - lblMessaggi.Text = string.Format("{0} {1}", traduci("UDC_giaConsumato"), currUdcFrom); - pnlAll.CssClass = "stileComandoKo"; - } - lblGitterBoxAttivo.Text = ""; - } - } - /// - /// cambia la modalità di scarico UDC dis/abilitando conferme - /// - /// - /// - protected void btnDisableConf_Click(object sender, EventArgs e) - { - disableConfirm = !disableConfirm; - } + if (!Page.IsPostBack) + { + disableConfirm = false; + traduciObj(); + } + doChecks(); + lblGitterBoxAttivo.Text = ""; + if (currUdcFrom != "") + { + lblGitterBoxAttivo.Text += string.Format("UDC FROM: {0}", currUdcFrom); + } + if (string.IsNullOrEmpty(lblGitterBoxAttivo.Text)) + { + lblGitterBoxAttivo.Text = "..."; + } } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkConsuma(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + // buttons + btnConsuma.Text = traduci("btnConsumaUdc"); + // fix button gestione disabilitazione conferme + fixBtnDisableConf(); + } + /// + /// ssitema btn abilitazione/disabilitazione conferma comandi + /// + private void fixBtnDisableConf() + { + if (disableConfirm) + { + btnDisableConf.Text = traduci("confirmDisabled"); + btnDisableConf.CssClass = "btn btn-danger"; + } + else + { + btnDisableConf.Text = traduci("confirmEnabled"); + btnDisableConf.CssClass = "btn btn-success"; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// indica UDC FROM (F10) selezionato + /// + protected string currUdcFrom + { + get + { + return memLayer.ML.StringSessionObj("currUdcFrom"); + } + set + { + memLayer.ML.setSessionVal("currUdcFrom", value, false); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// indica se siano disabilitate le conferme x avere operazioni veloci + /// + public bool disableConfirm + { + get + { + return memLayer.ML.BoolSessionObj("disableConfirm"); + } + set + { + memLayer.ML.setSessionVal("disableConfirm", value); + fixBtnDisableConf(); + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + // controllo se sia un particolare Tipo P + else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + DS_Applicazione.ElencoCartelliniRow rigaCart; + string tipoImballo = ""; + lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn); + Postazione.warningText = ""; + switch (tipoBCode) + { + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // controllo se NON ci siano NC "pending" + if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc) + { + // cerco di recuperare riga UDC + try + { + rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; + tipoImballo = rigaCart.CodImballo; + } + catch + { } + // salvo UDC from + currUdcFrom = barcodeIn; + pnlAll.CssClass = "stileAttesa"; + // controllo: se sono in fast mode SCARICO! + if (disableConfirm) + { + scaricaUdcFrom(); + } + // controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG... + if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc) + { + Postazione.CssClass = "stileComandoKo"; + Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); + // recupero l'NC associata... + Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); + } + } + else + { + Postazione.CssClass = "stileComandoKo"; + Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); + // recupero l'NC associata... + Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); + } + } + break; + case tipoCodiceBarcode.Comando: + // se richiesto scarico rapido lo gestisco + if (barcodeIn.ToUpper() == memLayer.ML.cdv("cmdFast").ToUpper()) + { + disableConfirm = !disableConfirm; + lblMessaggi.Text = traduci("enDisFastMode"); + } + break; + default: + lblMessaggi.Text += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + lblMessaggi.Text = traduci("AttesaBCode"); + pnlAll.CssClass = "stileAttesa"; + } + //grView.DataBind(); + txtBarcode.Focus(); + } + /// + /// controllo abilitazione consumo + /// + private void checkConsuma() + { + bool consumaOk = false; + if (!disableConfirm) + { + if (currUdcFrom != "") + { + consumaOk = true; + } + } + btnConsuma.Enabled = consumaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnConsuma_Click(object sender, EventArgs e) + { + scaricaUdcFrom(); + } + /// + /// effettua scaricamento UDC FROM + /// + private void scaricaUdcFrom() + { + if (currUdcFrom != "") + { + // controllo se UDC non sia già consumato... + if (MagClass.magazzino.udcMpIsConsumabile(currUdcFrom)) + { + // controllo UDC sia corretto (in giusta posizione...) + if (MagClass.magazzino.IdxPosizioneUdc(currUdcFrom) == memLayer.ML.cdvi("IdxPosizioneFusi")) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(currUdcFrom, Request.UserHostName); + // indico UDC consumato! + lblMessaggi.Text = string.Format("{0} {1}", traduci("effettuatoConsumoUDC"), currUdcFrom); + currUdcFrom = ""; + pnlAll.CssClass = "stileComandoOk"; + } + else + { + // indico UDC sbagliato! + lblMessaggi.Text = string.Format("{0} {1}", traduci("UDC_tipoSbagliato"), currUdcFrom); + pnlAll.CssClass = "stileComandoKo"; + } + } + else + { + // indico UDC consumato! + lblMessaggi.Text = string.Format("{0} {1}", traduci("UDC_giaConsumato"), currUdcFrom); + pnlAll.CssClass = "stileComandoKo"; + } + lblGitterBoxAttivo.Text = ""; + } + } + /// + /// cambia la modalità di scarico UDC dis/abilitando conferme + /// + /// + /// + protected void btnDisableConf_Click(object sender, EventArgs e) + { + disableConfirm = !disableConfirm; + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_filtro.ascx.cs b/GMW/WebUserControls/mod_filtro.ascx.cs index 5b3e2a2f..f3b99030 100644 --- a/GMW/WebUserControls/mod_filtro.ascx.cs +++ b/GMW/WebUserControls/mod_filtro.ascx.cs @@ -5,383 +5,383 @@ using System.Web.UI.WebControls; public partial class mod_filtro : ApplicationUserControl { - protected ObjectDataSource _ods; - protected string _valore + protected ObjectDataSource _ods; + protected string _valore + { + get { - get - { - return memLayer.ML.StringSessionObj(string.Format("valFiltro_{0}", this.ID)); - } - set - { - memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), value, false); - } + return memLayer.ML.StringSessionObj(string.Format("valFiltro_{0}", this.ID)); } - protected bool _changeCheckEnabled = true; - protected bool _changeCheckVisible = true; - protected bool _changeSelEnabled = true; - protected string _where = ""; - protected string _showFiltered + set { - get - { - return memLayer.ML.StringSessionObj(string.Format("_showFiltered_{0}", this.ID)); - } - set - { - memLayer.ML.setSessionVal(string.Format("_showFiltered_{0}", this.ID), value); - traduciObj(); - } + memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), value, false); } - protected string _showAll + } + protected bool _changeCheckEnabled = true; + protected bool _changeCheckVisible = true; + protected bool _changeSelEnabled = true; + protected string _where = ""; + protected string _showFiltered + { + get { - get - { - return memLayer.ML.StringSessionObj(string.Format("_showAll_{0}", this.ID)); - } - set - { - memLayer.ML.setSessionVal(string.Format("_showAll_{0}", this.ID), value); - traduciObj(); - } + return memLayer.ML.StringSessionObj(string.Format("_showFiltered_{0}", this.ID)); } + set + { + memLayer.ML.setSessionVal(string.Format("_showFiltered_{0}", this.ID), value); + traduciObj(); + } + } + protected string _showAll + { + get + { + return memLayer.ML.StringSessionObj(string.Format("_showAll_{0}", this.ID)); + } + set + { + memLayer.ML.setSessionVal(string.Format("_showAll_{0}", this.ID), value); + traduciObj(); + } + } - protected override void OnInit(EventArgs e) + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + if (!Page.IsPostBack) { - base.OnInit(e); - if (!Page.IsPostBack) - { - if (_showFiltered == "") _showFiltered = "mostraSoloSelez"; - if (_showAll == "") _showAll = "mostraTutti"; - } + if (string.IsNullOrEmpty(_showFiltered)) _showFiltered = "mostraSoloSelez"; + if (string.IsNullOrEmpty(_showAll)) _showAll = "mostraTutti"; } + } - /// - /// traduzione oggetti - /// - protected override void traduciObj() + /// + /// traduzione oggetti + /// + protected override void traduciObj() + { + if (_changeCheckVisible) { - if (_changeCheckVisible) - { - if (!chkFilt.Checked) - { - chkFilt.Text = traduci(_showFiltered); - } - else - { - chkFilt.Text = traduci(_showAll); - } - } + if (!chkFilt.Checked) + { + chkFilt.Text = traduci(_showFiltered); + } + else + { + chkFilt.Text = traduci(_showAll); + } } - /// - /// get/set messaggio di attivazione filtraggio - /// - public string filterChekText + } + /// + /// get/set messaggio di attivazione filtraggio + /// + public string filterChekText + { + get { - get - { - return _showFiltered; - } - set - { - _showFiltered = value; - } + return _showFiltered; } - /// - /// get/set messaggio di disattivazione filtraggio - /// - public string filterUnchekText + set { - get - { - return _showAll; - } - set - { - _showAll = value; - } + _showFiltered = value; } - protected void chkFilt_CheckedChanged(object sender, EventArgs e) + } + /// + /// get/set messaggio di disattivazione filtraggio + /// + public string filterUnchekText + { + get { - // cambio modalità visualizzazione del filtro... - dlFiltr.Visible = !dlFiltr.Visible; - raiseSelEvent(); + return _showAll; } + set + { + _showAll = value; + } + } + protected void chkFilt_CheckedChanged(object sender, EventArgs e) + { + // cambio modalità visualizzazione del filtro... + dlFiltr.Visible = !dlFiltr.Visible; + raiseSelEvent(); + } - protected void raiseSelEvent() + protected void raiseSelEvent() + { + if (!dlFiltr.Visible) { - if (!dlFiltr.Visible) - { - memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), "", false); - } - else - { - _valore = dlFiltr.SelectedValue; - } - if (eh_selValore != null) - { - eh_selValore(this, new EventArgs()); - } + memLayer.ML.setSessionVal(string.Format("valFiltro_{0}", this.ID), "", false); } - protected void updateChk() + else { - chkFilt.Enabled = _changeCheckEnabled; - if (!_changeCheckEnabled) - { - chkFilt.Checked = true; - dlFiltr.Visible = true; - } + _valore = dlFiltr.SelectedValue; } - protected void updateSel() + if (eh_selValore != null) { - dlFiltr.Enabled = _changeSelEnabled; + eh_selValore(this, new EventArgs()); } - protected void updateChkLbl() + } + protected void updateChk() + { + chkFilt.Enabled = _changeCheckEnabled; + if (!_changeCheckEnabled) { - chkFilt.Visible = _changeCheckVisible; - } - protected override void bindControlli() - { - updateChk(); - fixValore(); - where.Text = _where; - traduciObj(); - } - protected SteamWare.tipoVistaMod _modo = SteamWare.tipoVistaMod.editing; - protected void dlFiltr_SelectedIndexChanged(object sender, EventArgs e) - { - raiseSelEvent(); + chkFilt.Checked = true; + dlFiltr.Visible = true; } + } + protected void updateSel() + { + dlFiltr.Enabled = _changeSelEnabled; + } + protected void updateChkLbl() + { + chkFilt.Visible = _changeCheckVisible; + } + protected override void bindControlli() + { + updateChk(); + fixValore(); + where.Text = _where; + traduciObj(); + } + protected SteamWare.tipoVistaMod _modo = SteamWare.tipoVistaMod.editing; + protected void dlFiltr_SelectedIndexChanged(object sender, EventArgs e) + { + raiseSelEvent(); + } - /// - /// condizione where per ridurre elementi mostrati in selettore - /// - public string condizione + /// + /// condizione where per ridurre elementi mostrati in selettore + /// + public string condizione + { + get { - get - { - return _where; - } - set - { - _where = value; - } + return _where; } + set + { + _where = value; + } + } - /// - /// fornisce il valore scelto o "*" se nulla selezionato - /// - public string valore + /// + /// fornisce il valore scelto o "*" se nulla selezionato + /// + public string valore + { + get { - get - { - string answ = "*"; - if (chkFilt.Checked) - { - answ = dlFiltr.SelectedValue; - } - return answ; - } - set - { - _valore = value; - fixValore(); - } + string answ = "*"; + if (chkFilt.Checked) + { + answ = dlFiltr.SelectedValue; + } + return answ; } + set + { + _valore = value; + fixValore(); + } + } - /// - /// primo valore di una chiave multicampo - /// - public string val_1 + /// + /// primo valore di una chiave multicampo + /// + public string val_1 + { + get { - get + string answ = ""; + if (chkFilt.Checked) + { + try { - string answ = ""; - if (chkFilt.Checked) - { - try - { - string[] _dataKey = dlFiltr.SelectedValue.Split('#'); - answ = _dataKey[0]; - } - catch - { } - } - else - { - answ = "*"; - } - return answ; + string[] _dataKey = dlFiltr.SelectedValue.Split('#'); + answ = _dataKey[0]; } + catch + { } + } + else + { + answ = "*"; + } + return answ; } - /// - /// secondo valore di una chiave multicampo - /// - public string val_2 + } + /// + /// secondo valore di una chiave multicampo + /// + public string val_2 + { + get { - get + string answ = ""; + if (chkFilt.Checked) + { + try { - string answ = ""; - if (chkFilt.Checked) - { - try - { - string[] _dataKey = dlFiltr.SelectedValue.Split('#'); - answ = _dataKey[1]; - } - catch - { } - } - else - { - answ = "*"; - } - return answ; + string[] _dataKey = dlFiltr.SelectedValue.Split('#'); + answ = _dataKey[1]; } + catch + { } + } + else + { + answ = "*"; + } + return answ; } - /// - /// fornisce il valore scelto o "0" se nulla selezionato o non valido - /// - public int valoreInt + } + /// + /// fornisce il valore scelto o "0" se nulla selezionato o non valido + /// + public int valoreInt + { + get { - get + int answ = -1; + try + { + if (chkFilt.Checked) { - int answ = -1; - try - { - if (chkFilt.Checked) - { - answ = Convert.ToInt32(dlFiltr.SelectedValue); - } - } - catch - { } - return answ; + answ = Convert.ToInt32(dlFiltr.SelectedValue); } + } + catch + { } + return answ; } - protected void fixValore() + } + protected void fixValore() + { + if (_ods != null) { - if (_ods != null) + try + { + dlFiltr.DataSource = _ods; + dlFiltr.DataBind(); + if (_valore != "") { - try - { - dlFiltr.DataSource = _ods; - dlFiltr.DataBind(); - if (_valore != "") - { - dlFiltr.SelectedValue = _valore; - dlFiltr.Visible = true; - chkFilt.Checked = true; - } - } - catch - { } + dlFiltr.SelectedValue = _valore; + dlFiltr.Visible = true; + chkFilt.Checked = true; } + } + catch + { } } + } - public event EventHandler eh_selValore; + public event EventHandler eh_selValore; - /// - /// determina se sia possibile (de)selezionare il check di filtraggio, altrimenti sempre attivo - /// - public bool changeCheckEnabled + /// + /// determina se sia possibile (de)selezionare il check di filtraggio, altrimenti sempre attivo + /// + public bool changeCheckEnabled + { + get { - get - { - return _changeCheckEnabled; - } - set - { - _changeCheckEnabled = value; - updateChk(); - } + return _changeCheckEnabled; } - /// - /// determina se sia possibile modificare la selezione - /// - public bool changeSelEnabled + set { - get - { - return _changeSelEnabled; - } - set - { - _changeSelEnabled = value; - updateSel(); - } + _changeCheckEnabled = value; + updateChk(); } - /// - /// determina se sia possibile visibile il check di filtraggio - /// - public bool changeCheckVisible + } + /// + /// determina se sia possibile modificare la selezione + /// + public bool changeSelEnabled + { + get { - get - { - return _changeCheckVisible; - } - set - { - _changeCheckVisible = value; - updateChkLbl(); - } + return _changeSelEnabled; } - /// - /// get/set della checkbox - /// - public bool isChecked + set { - get - { - return chkFilt.Checked; - } - set - { - chkFilt.Checked = value; - dlFiltr.Visible = value; - updateChkLbl(); - } + _changeSelEnabled = value; + updateSel(); } + } + /// + /// determina se sia possibile visibile il check di filtraggio + /// + public bool changeCheckVisible + { + get + { + return _changeCheckVisible; + } + set + { + _changeCheckVisible = value; + updateChkLbl(); + } + } + /// + /// get/set della checkbox + /// + public bool isChecked + { + get + { + return chkFilt.Checked; + } + set + { + chkFilt.Checked = value; + dlFiltr.Visible = value; + updateChkLbl(); + } + } - /// - /// oggetto ODS con cui popolare il selettore, VINCOLO abbia campi value(key) / label - /// - public ObjectDataSource ods + /// + /// oggetto ODS con cui popolare il selettore, VINCOLO abbia campi value(key) / label + /// + public ObjectDataSource ods + { + get { - get - { - return _ods; - } - set - { - _ods = value; - bindControlli(); - } + return _ods; } - /// - /// resetta il controllo (un-checked) - /// - public void reset() + set { - chkFilt.Checked = false; - dlFiltr.Visible = false; - memLayer.ML.emptySessionVal(string.Format("valFiltro_{0}", this.ID)); + _ods = value; + bindControlli(); } - /// - /// get/set per la larghezza della combo dropdown - /// - public int comboWidth + } + /// + /// resetta il controllo (un-checked) + /// + public void reset() + { + chkFilt.Checked = false; + dlFiltr.Visible = false; + memLayer.ML.emptySessionVal(string.Format("valFiltro_{0}", this.ID)); + } + /// + /// get/set per la larghezza della combo dropdown + /// + public int comboWidth + { + get { - get - { - return Convert.ToInt32(dlFiltr.Width); - } - set - { - dlFiltr.Width = value; - } + return Convert.ToInt32(dlFiltr.Width); } + set + { + dlFiltr.Width = value; + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_finitiFc.ascx.cs b/GMW/WebUserControls/mod_finitiFc.ascx.cs index 7413f24c..16fea793 100644 --- a/GMW/WebUserControls/mod_finitiFc.ascx.cs +++ b/GMW/WebUserControls/mod_finitiFc.ascx.cs @@ -633,7 +633,7 @@ namespace GMW.WebUserControls codImballo = memLayer.ML.cdv("CodImballoFiniti"); } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = memLayer.ML.cdv("CodImballoFiniti"); } diff --git a/GMW/WebUserControls/mod_fusiTK.ascx.cs b/GMW/WebUserControls/mod_fusiTK.ascx.cs index 0bae9e87..42f35b35 100644 --- a/GMW/WebUserControls/mod_fusiTK.ascx.cs +++ b/GMW/WebUserControls/mod_fusiTK.ascx.cs @@ -491,7 +491,7 @@ namespace GMW.WebUserControls if (OpAuth.isAuth || !OpAuth.opAuthReq) { // se linea non selezionata ERRORE!!! - if (Postazione.currCodLinea == "W3000" || Postazione.currCodLinea == "") + if (Postazione.currCodLinea == "W3000" || string.IsNullOrEmpty(Postazione.currCodLinea)) { Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; Postazione.CssClass = "stileComandoKo"; diff --git a/GMW/WebUserControls/mod_lavMeccIN.ascx.cs b/GMW/WebUserControls/mod_lavMeccIN.ascx.cs index 14c22b9e..fb84c3d0 100644 --- a/GMW/WebUserControls/mod_lavMeccIN.ascx.cs +++ b/GMW/WebUserControls/mod_lavMeccIN.ascx.cs @@ -6,423 +6,423 @@ using System.Web.UI.WebControls; namespace GMW.WebUserControls { - public partial class mod_lavMeccIN : GMW_data.UserControl + public partial class mod_lavMeccIN : GMW_data.UserControl + { + public event EventHandler eh_nuovaRicerca; + public event EventHandler eh_reqUpdate; + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { - public event EventHandler eh_nuovaRicerca; - public event EventHandler eh_reqUpdate; - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) + if (!Page.IsPostBack) + { + fixRicercaUdc(); + traduciObj(); + idxCella = Postazione.currIdxCella; + } + doChecks(); + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + get + { + int answ = 0; + if (memLayer.ML.isInSessionObject("IdxCellaLineaLM_IN")) { - if (!Page.IsPostBack) - { - fixRicercaUdc(); - traduciObj(); - idxCella = Postazione.currIdxCella; - } - doChecks(); + answ = memLayer.ML.IntSessionObj("IdxCellaLineaLM_IN"); } - /// - /// IDX cella associata alla linea corrente - /// - protected int idxCella + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaLM_IN", value); + } + } + /// + /// verifica se si debab mostrare un campo ricerca UDC attivo... + /// + private void fixRicercaUdc() + { + if (memLayer.ML.isInSessionObject("valoreCercatoLMI")) + { + testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoLMI"); + } + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + 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 Finito LM IN {0}", udcReq), tipoLog.EXCEPTION); + } + if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Finito LM IN"); + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + btnCerca.Text = traduci("btnSearch"); + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + if (barcodeIn.StartsWith(preCmd)) { - get - { - int answ = 0; - if (memLayer.ML.isInSessionObject("IdxCellaLineaLM_IN")) - { - answ = memLayer.ML.IntSessionObj("IdxCellaLineaLM_IN"); - } - return answ; - } - set - { - memLayer.ML.setSessionVal("IdxCellaLineaLM_IN", value); - } + answ = tipoCodiceBarcode.Comando; } - /// - /// verifica se si debab mostrare un campo ricerca UDC attivo... - /// - private void fixRicercaUdc() + else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima... { - if (memLayer.ML.isInSessionObject("valoreCercatoLMI")) - { - testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoLMI"); - } + answ = tipoCodiceBarcode.Particolare; } - /// - /// richiesta (ri)stampa UDC - /// - /// - /// - public void ristampa() + else { - bool fatto = false; - // registro ri-stampa UDC - DateTime adesso = DateTime.Now; - // calcolo particolare... - DS_magazzino.ElencoCartelliniRow rigaUDC; - string particolare = ""; - try + try + { + // cerco tra UDC + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) { - rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0]; - particolare = rigaUDC.Particolare; - fatto = MagClass.magazzino.ristampaUdc(udcReq, Postazione.printer, Request.UserHostName); + answ = tipoCodiceBarcode.UDC; } - catch - { - logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Finito LM IN {0}", udcReq), tipoLog.EXCEPTION); - } - if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Finito LM IN"); + } + catch + { + } } - /// - /// udc da stampare - /// - protected string udcReq + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// valore barcode + /// + public string lastBarcodeIn + { + get + { + return hfLastBCode.Value; + } + set + { + hfLastBCode.Value = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + Postazione.warningText = ""; + switch (tipoBCode) { - get + case tipoCodiceBarcode.UDC: + // se linea non selezionata ERRORE!!! + if (Postazione.currCodLinea == "W2000") { - return memLayer.ML.StringSessionObj("udcSelSAO"); - } - } - /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - } - /// - /// sistemo labels oggetti - /// - private void traduciObj() - { - btnCerca.Text = traduci("btnSearch"); - } - /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.AppConf["prefComandi"]; - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare) && TermClass.Ter.isAnima(barcodeIn)) // è un particolare... ed un anima... - { - answ = tipoCodiceBarcode.Particolare; - } - else - { - try - { - // cerco tra UDC - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// valore barcode - /// - public string lastBarcodeIn - { - get - { - return hfLastBCode.Value; - } - set - { - hfLastBCode.Value = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - Postazione.warningText = ""; - switch (tipoBCode) - { - case tipoCodiceBarcode.UDC: - // se linea non selezionata ERRORE!!! - if (Postazione.currCodLinea == "W2000") - { - Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; - Postazione.CssClass = "stileComandoKo"; - } - else - { - // procedo solo se UDC esistente - if (MagClass.magazzino.checkUDC(barcodeIn)) - { - // controllo se NON ci siano NC "pending" - if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc) - { - // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x trattati (pre lavorazioni meccaniche) - int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; - if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneTrattati")) - { - int idxCellaCurr = 0; - try - { - idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; - } - catch - { } - // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc - if (idxCellaCurr == Postazione.currIdxCella) - { - Postazione.messaggiText += " - Attenzione, UDC già caricato!"; - Postazione.CssClass = "stileComandoKo"; - } - else - { - // altrimenti procedo... - string codSogg = ""; - string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; - decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta; - string noteTrim = ""; - try - { - codSogg = MagClass.magazzino.CodSoggCurrUser; - } - catch - { } - try - { - noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim(); - } - catch - { - noteTrim = ""; - } - DateTime adesso = DateTime.Now; - // se ho cod cella sposto! - MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); - // registro spostamento UDC - MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Trattati su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); - Postazione.CssClass = "stileComandoOk"; - } - } - else - { - // udc NON corretto, mostro errore... - Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!"; - Postazione.CssClass = "stileComandoKo"; - } - - // controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG... - if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc) - { - Postazione.CssClass = "stileComandoKo"; - Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); - // recupero l'NC associata... - Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); - } - } - else - { - Postazione.CssClass = "stileComandoKo"; - Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); - // recupero l'NC associata... - Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); - } - } - } - - break; - default: - Postazione.messaggiText += " - codice non riconosciuto!"; - Postazione.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; - lastBarcodeIn = "-"; + Postazione.messaggiText += " - Attenzione, IMPOSTARE LINEA!"; + Postazione.CssClass = "stileComandoKo"; } else { - if (lastBarcodeIn == "") - { - Postazione.messaggiText = traduci("AttesaBCode"); - Postazione.CssClass = "stileAttesa"; - } - lastBarcodeIn = ""; - } - doUpdate(); - } - /// - /// aggiorna tabella + focus a barcode - /// - public void doUpdate() - { - idxCella = Postazione.currIdxCella; - grView.DataBind(); - txtBarcode.Focus(); - // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } - } - /// - /// effettua reset dati - /// - public void doResetData() - { - // resetto i dati QtaTot e particolare... - testoRicerca = ""; - doChecks(); - } - /// - /// cambiato valore in ricerca - /// - /// - /// - protected void txtCerca_TextChanged(object sender, EventArgs e) - { - salvaCerca(); - } - /// - /// effettuato reset - /// - /// - /// - protected void lnkReset_Click(object sender, EventArgs e) - { - testoRicerca = ""; - salvaCerca(); - } - /// - /// pressione del button di ricerca - /// - /// - /// - protected void btnCerca_Click(object sender, EventArgs e) - { - salvaCerca(); - } - - /// - /// testo ricerca trimmato da spazi - /// - protected string testoRicerca - { - get - { - return txtCerca.Text.Trim(); - } - set - { - txtCerca.Text = value; - } - } - protected void salvaCerca() - { - if (testoRicerca == "") - { - SteamWare.memLayer.ML.emptySessionVal("valoreCercatoLMI"); - } - else - { - SteamWare.memLayer.ML.setSessionVal("valoreCercatoLMI", testoRicerca); - } - // raise dell'evento - if (eh_nuovaRicerca != null) - { - eh_nuovaRicerca(this, new EventArgs()); - } - doUpdate(); - } - protected void grView_PageIndexChanged(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - protected void grView_Sorted(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - /// - /// aggiorno ods al binding.. - /// - /// - /// - protected void ods_DataBinding(object sender, EventArgs e) - { - // fix dell'ODS - checkFixOds(); - } - /// - /// verifica se attivo filtro company e imposta ods di conseguenza... - /// - private void checkFixOds() - { - } - /// - /// traduce gli header delle colonne - /// - /// - /// - protected void grView_DataBound(object sender, EventArgs e) - { - if (grView.Rows.Count > 0) - { - LinkButton lb; - // aggiorno gli headers - foreach (TableCell cella in grView.HeaderRow.Cells) + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // controllo se NON ci siano NC "pending" + if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc) { + // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x trattati (pre lavorazioni meccaniche) + int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; + if (IdxPosizione == memLayer.ML.cdvi("IdxPosizioneTrattati")) + { + int idxCellaCurr = 0; try { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); + idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; } catch { } + // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc + if (idxCellaCurr == Postazione.currIdxCella) + { + Postazione.messaggiText += " - Attenzione, UDC già caricato!"; + Postazione.CssClass = "stileComandoKo"; + } + else + { + // altrimenti procedo... + string codSogg = ""; + string particolare = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; + decimal qta = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta; + string noteTrim = ""; + try + { + codSogg = MagClass.magazzino.CodSoggCurrUser; + } + catch + { } + try + { + noteTrim = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Note.Trim(); + } + catch + { + noteTrim = ""; + } + DateTime adesso = DateTime.Now; + // se ho cod cella sposto! + MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); + // registro spostamento UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, barcodeIn, particolare, "spostaUDC", string.Format("Caricato UDC Trattati su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); + Postazione.CssClass = "stileComandoOk"; + } + } + else + { + // udc NON corretto, mostro errore... + Postazione.messaggiText += " - Attenzione, UDC NON VALIDO (IdxPosizione)!"; + Postazione.CssClass = "stileComandoKo"; + } + + // controllo SE PER CASO ci fosse NC e ci sia stata deroga, cambio MSG... + if (MagClass.magazzino.checkUDC_NC(barcodeIn) == checkUdcNc.ChkDis_HasNc) + { + Postazione.CssClass = "stileComandoKo"; + Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); + // recupero l'NC associata... + Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); + } } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); - } - else - { - lblNumRec.Text = ""; + else + { + Postazione.CssClass = "stileComandoKo"; + Postazione.messaggiText += string.Format("
{0}", traduci("ERR-NC-001")); + // recupero l'NC associata... + Postazione.warningText += string.Format("
{0}", MagClass.magazzino.getDescrNc2Udc(barcodeIn)); + } + } } + + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + Postazione.CssClass = "stileComandoND"; + break; } + barcodeIn = ""; + lastBarcodeIn = "-"; + } + else + { + if (string.IsNullOrEmpty(lastBarcodeIn)) + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + lastBarcodeIn = ""; + } + doUpdate(); } + /// + /// aggiorna tabella + focus a barcode + /// + public void doUpdate() + { + idxCella = Postazione.currIdxCella; + grView.DataBind(); + txtBarcode.Focus(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// effettua reset dati + /// + public void doResetData() + { + // resetto i dati QtaTot e particolare... + testoRicerca = ""; + doChecks(); + } + /// + /// cambiato valore in ricerca + /// + /// + /// + protected void txtCerca_TextChanged(object sender, EventArgs e) + { + salvaCerca(); + } + /// + /// effettuato reset + /// + /// + /// + protected void lnkReset_Click(object sender, EventArgs e) + { + testoRicerca = ""; + salvaCerca(); + } + /// + /// pressione del button di ricerca + /// + /// + /// + protected void btnCerca_Click(object sender, EventArgs e) + { + salvaCerca(); + } + + /// + /// testo ricerca trimmato da spazi + /// + protected string testoRicerca + { + get + { + return txtCerca.Text.Trim(); + } + set + { + txtCerca.Text = value; + } + } + protected void salvaCerca() + { + if (string.IsNullOrEmpty(testoRicerca)) + { + SteamWare.memLayer.ML.emptySessionVal("valoreCercatoLMI"); + } + else + { + SteamWare.memLayer.ML.setSessionVal("valoreCercatoLMI", testoRicerca); + } + // raise dell'evento + if (eh_nuovaRicerca != null) + { + eh_nuovaRicerca(this, new EventArgs()); + } + doUpdate(); + } + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + protected void grView_Sorted(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// aggiorno ods al binding.. + /// + /// + /// + protected void ods_DataBinding(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// verifica se attivo filtro company e imposta ods di conseguenza... + /// + private void checkFixOds() + { + } + /// + /// traduce gli header delle colonne + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs b/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs index 969ee106..db6df0da 100644 --- a/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs +++ b/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs @@ -694,7 +694,7 @@ namespace GMW.WebUserControls codImballo = memLayer.ML.cdv("CodImballoFiniti"); } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = memLayer.ML.cdv("CodImballoFiniti"); } @@ -1028,7 +1028,7 @@ namespace GMW.WebUserControls /// protected void salvaCerca() { - if (testoRicerca == "") + if (string.IsNullOrEmpty(testoRicerca)) { SteamWare.memLayer.ML.emptySessionVal("valoreCercatoLMO"); udcSelC = ""; diff --git a/GMW/WebUserControls/mod_nuovaListaPrelievo.ascx.cs b/GMW/WebUserControls/mod_nuovaListaPrelievo.ascx.cs index 43a1ba16..ab02194b 100644 --- a/GMW/WebUserControls/mod_nuovaListaPrelievo.ascx.cs +++ b/GMW/WebUserControls/mod_nuovaListaPrelievo.ascx.cs @@ -5,310 +5,310 @@ using System.Web.UI; namespace GMW.WebUserControls { - public partial class mod_nuovaListaPrelievo : System.Web.UI.UserControl + public partial class mod_nuovaListaPrelievo : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) { - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - // traduco! - lblTipo.Text = traduci("TipoLista"); - lblParticolare.Text = traduci("Particolare"); - lblEsponente.Text = traduci("Esponente"); - lblFigura.Text = traduci("Figura"); - lblQta.Text = traduci("Qta"); - lblImballo.Text = traduci("Imballo"); - lblDestinatario.Text = traduci("Destinatario"); - // all'avvio disabilito ricerca x campi "avanzati..." - setFullControlsVisibility(false); - btnCreaNuova.Text = traduci("CreaNuovaListaPrelievo"); - // // sistema il tipo oggetto dell'autocompletamento... - // fixAutocomplete(); - } - checkParticolare(); + if (!Page.IsPostBack) + { + // traduco! + lblTipo.Text = traduci("TipoLista"); + lblParticolare.Text = traduci("Particolare"); + lblEsponente.Text = traduci("Esponente"); + lblFigura.Text = traduci("Figura"); + lblQta.Text = traduci("Qta"); + lblImballo.Text = traduci("Imballo"); + lblDestinatario.Text = traduci("Destinatario"); + // all'avvio disabilito ricerca x campi "avanzati..." + setFullControlsVisibility(false); + btnCreaNuova.Text = traduci("CreaNuovaListaPrelievo"); + // // sistema il tipo oggetto dell'autocompletamento... + // fixAutocomplete(); + } + checkParticolare(); #if false acParticolare.eh_valSelezionato += acParticolare_eh_valSelezionato; acParticolare.eh_reset += acParticolare_eh_reset; #endif - } - - private void acParticolare_eh_reset(object sender, EventArgs e) - { - checkParticolare(); - } - - void acParticolare_eh_valSelezionato(object sender, EventArgs e) - { - checkParticolare(); - } - // /// - // /// imposta il corretto autocompletamento del particolare - // /// - // private void fixAutocomplete() - // { - // // quale tipo lista? - // string tipoLista = ddlTipoLista.SelectedValue; - // string tipoObj = ""; - // try - // { - // tipoObj = GMW_data.utils.obj.taSelTipoLista.getByValue(tipoLista)[0].conditio; - // } - // catch - // { } - // switch (tipoObj) - // { - // case "A": - // //aceParticolare.ServiceMethod = "elencoAnime"; - - // // acParticolare.ServicePath = "../WS/DataFeed.asmx/anime"; - // break; - // case "P": - // //aceParticolare.ServiceMethod = "elencoParticolari"; - // // acParticolare.ServicePath = "../WS/DataFeed.asmx/particolari"; - // break; - // default: - // break; - // } - // } - - private void setFullControlsVisibility(bool completeVisible) - { - lblEsponente.Visible = completeVisible; - ddlEsponente.Visible = completeVisible; - lblFigura.Visible = completeVisible; - ddlFigura.Visible = completeVisible; - lblQta.Visible = completeVisible; - txtQta.Visible = completeVisible; - lblDestinatario.Visible = completeVisible; - ddlDestin.Visible = completeVisible; - lblImballo.Visible = completeVisible; - ddlImballo.Visible = completeVisible; - btnCreaNuova.Visible = completeVisible; - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// verifico se il codice particolare sia conforme - /// - /// - /// - protected bool particolareOk(string particolare) - { - bool answ = false; - answ = DataProxy.obj.taAnagParticolari.getByParticolare(particolare).Rows.Count > 0; - return answ; - } - /// - /// completata selezione particoalre, avanzo - /// - /// - /// - protected void txtParticolare_TextChanged(object sender, EventArgs e) - { - checkParticolare(); - } - /// - /// controlla il particolare se sia valido - /// - private void checkParticolare() - { - // calcolo ed aggiorno conteggio pezzi disponibili... - int numPezziDisp = 0; - try - { - string codEsponente = ddlEsponente.SelectedValue; - if (codEsponente == "") codEsponente = "*"; - string codFigura = ddlFigura.SelectedValue; - if (codFigura == "") codFigura = "*"; - string CodImballo = ddlImballo.SelectedValue; - if (CodImballo == "") CodImballo = "*"; - string codTipoLista = ddlTipoLista.SelectedValue; - numPezziDisp = MagClass.magazzino.numUdcDaPart(memLayer.ML.cdv("CodCS"), ParticolareRichiesto, codEsponente, codFigura, CodImballo, codTipoLista); - // sottraggo quelli - lblTotPz.Text = string.Format("{0} UDC ", numPezziDisp); - } - catch (Exception e) - { - httpLog(string.Format("Eccezione in verifica pezzi disponibili per il particolare {0}: eccezione {1}", ParticolareRichiesto, e), tipoLog.EXCEPTION); - } - // controllo se cod particolare è valido... - //if (particolareOk(txtParticolare.Text.Trim())) - if (particolareOk(ParticolareRichiesto)) - { - // abilito ricerca esponente figura... - setFullControlsVisibility(true); - // setto ddl a "*" - ddlEsponente.SelectedValue = "*"; - ddlFigura.SelectedValue = "*"; - ddlImballo.SelectedValue = "*"; - // verifico - if (numPezziDisp > 0) - { - btnCreaNuova.Visible = true; - } - else - { - btnCreaNuova.Visible = false; - } - } - else - { - // disabilito ricerce esponenti figure - ddlEsponente.Visible = false; - ddlFigura.Visible = false; - txtQta.Visible = false; - ddlDestin.Visible = false; - ddlImballo.Visible = false; - btnCreaNuova.Visible = false; - } - } - /// - /// wrapper per log con salvataggio dell'IP del chiamante - /// - /// - /// - public bool httpLog(string _testoPre) - { - bool answ = false; - string postazione_IP = ""; - try - { - postazione_IP = string.Format(" | {0} | ", Request.UserHostName); - } - catch - { } - logger.lg.scriviLog(postazione_IP + _testoPre); - return answ; - } - /// - /// wrapper per log con salvataggio dell'IP del chiamante - /// - /// - /// - public bool httpLog(string testoLog, tipoLog tipo) - { - bool answ = false; - string postazione_IP = ""; - try - { - postazione_IP = string.Format(" | {0} | ", Request.UserHostName); - } - catch - { } - logger.lg.scriviLog(postazione_IP + testoLog, tipo); - return answ; - } - /// - /// crea nuova lista di prelievo - /// - /// - /// - protected void btnCreaNuova_Click(object sender, EventArgs e) - { - // controllo se qta != 0... - decimal qta = 0; - string destinatario = ""; - string destinatarioDescr = ""; - try - { - // calcolo il dato del destinatario... - GMW_data.DS_Utility.v_selDestinatariListePrelievoRow riga = utils.obj.taDestListePre.getByValue(ddlDestin.SelectedValue)[0]; - destinatario = riga.value.Trim(); - destinatarioDescr = riga.label.Trim(); - } - catch - { } - try - { - qta = Convert.ToDecimal(txtQta.Text); - } - catch - { } - if (qta > 0 && destinatario != "") - { - MagClass.magazzino.creaListaPrelievo(memLayer.ML.cdv("CodCS"), ddlTipoLista.SelectedValue, ParticolareRichiesto, ddlEsponente.SelectedValue, ddlFigura.SelectedValue, qta, ddlImballo.SelectedValue, destinatario, destinatarioDescr); - // sollevo evento nuovo valore... - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - } - /// - /// evento nuovo valore - /// - public event EventHandler eh_nuovoValore; - /// - /// valore del aprticolare della lsita prelievo get/set - /// - public string ParticolareRichiesto - { - get - { - return txtParticolare.Text; - } - set - { - txtParticolare.Text = value; - //acParticolare.valore = value; - checkParticolare(); - } - } - /// - /// blocca il tipo lista selezionabile che non può essere cambiata - /// - public bool bloccaTipoLista - { - set - { - if (value) - { - ddlTipoLista.Enabled = false; - } - } - } - /// - /// (pre)imposta il valore del tipo lista di prelievo - /// - public string valoreTipoLista - { - get - { - return ddlTipoLista.SelectedValue; - } - set - { - ddlTipoLista.SelectedValue = value; - } - } - - protected void ddlTipoLista_SelectedIndexChanged(object sender, EventArgs e) - { - // fixAutocomplete(); - checkParticolare(); - } - - protected void ddlEsponente_SelectedIndexChanged(object sender, EventArgs e) - { - checkParticolare(); - } - - protected void ddlFigura_SelectedIndexChanged(object sender, EventArgs e) - { - checkParticolare(); - } - - protected void ddlImballo_SelectedIndexChanged(object sender, EventArgs e) - { - checkParticolare(); - } - } + + private void acParticolare_eh_reset(object sender, EventArgs e) + { + checkParticolare(); + } + + void acParticolare_eh_valSelezionato(object sender, EventArgs e) + { + checkParticolare(); + } + // /// + // /// imposta il corretto autocompletamento del particolare + // /// + // private void fixAutocomplete() + // { + // // quale tipo lista? + // string tipoLista = ddlTipoLista.SelectedValue; + // string tipoObj = ""; + // try + // { + // tipoObj = GMW_data.utils.obj.taSelTipoLista.getByValue(tipoLista)[0].conditio; + // } + // catch + // { } + // switch (tipoObj) + // { + // case "A": + // //aceParticolare.ServiceMethod = "elencoAnime"; + + // // acParticolare.ServicePath = "../WS/DataFeed.asmx/anime"; + // break; + // case "P": + // //aceParticolare.ServiceMethod = "elencoParticolari"; + // // acParticolare.ServicePath = "../WS/DataFeed.asmx/particolari"; + // break; + // default: + // break; + // } + // } + + private void setFullControlsVisibility(bool completeVisible) + { + lblEsponente.Visible = completeVisible; + ddlEsponente.Visible = completeVisible; + lblFigura.Visible = completeVisible; + ddlFigura.Visible = completeVisible; + lblQta.Visible = completeVisible; + txtQta.Visible = completeVisible; + lblDestinatario.Visible = completeVisible; + ddlDestin.Visible = completeVisible; + lblImballo.Visible = completeVisible; + ddlImballo.Visible = completeVisible; + btnCreaNuova.Visible = completeVisible; + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// verifico se il codice particolare sia conforme + /// + /// + /// + protected bool particolareOk(string particolare) + { + bool answ = false; + answ = DataProxy.obj.taAnagParticolari.getByParticolare(particolare).Rows.Count > 0; + return answ; + } + /// + /// completata selezione particoalre, avanzo + /// + /// + /// + protected void txtParticolare_TextChanged(object sender, EventArgs e) + { + checkParticolare(); + } + /// + /// controlla il particolare se sia valido + /// + private void checkParticolare() + { + // calcolo ed aggiorno conteggio pezzi disponibili... + int numPezziDisp = 0; + try + { + string codEsponente = ddlEsponente.SelectedValue; + if (string.IsNullOrEmpty(codEsponente)) codEsponente = "*"; + string codFigura = ddlFigura.SelectedValue; + if (string.IsNullOrEmpty(codFigura)) codFigura = "*"; + string CodImballo = ddlImballo.SelectedValue; + if (string.IsNullOrEmpty(CodImballo)) CodImballo = "*"; + string codTipoLista = ddlTipoLista.SelectedValue; + numPezziDisp = MagClass.magazzino.numUdcDaPart(memLayer.ML.cdv("CodCS"), ParticolareRichiesto, codEsponente, codFigura, CodImballo, codTipoLista); + // sottraggo quelli + lblTotPz.Text = string.Format("{0} UDC ", numPezziDisp); + } + catch (Exception e) + { + httpLog(string.Format("Eccezione in verifica pezzi disponibili per il particolare {0}: eccezione {1}", ParticolareRichiesto, e), tipoLog.EXCEPTION); + } + // controllo se cod particolare è valido... + //if (particolareOk(txtParticolare.Text.Trim())) + if (particolareOk(ParticolareRichiesto)) + { + // abilito ricerca esponente figura... + setFullControlsVisibility(true); + // setto ddl a "*" + ddlEsponente.SelectedValue = "*"; + ddlFigura.SelectedValue = "*"; + ddlImballo.SelectedValue = "*"; + // verifico + if (numPezziDisp > 0) + { + btnCreaNuova.Visible = true; + } + else + { + btnCreaNuova.Visible = false; + } + } + else + { + // disabilito ricerce esponenti figure + ddlEsponente.Visible = false; + ddlFigura.Visible = false; + txtQta.Visible = false; + ddlDestin.Visible = false; + ddlImballo.Visible = false; + btnCreaNuova.Visible = false; + } + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string _testoPre) + { + bool answ = false; + string postazione_IP = ""; + try + { + postazione_IP = string.Format(" | {0} | ", Request.UserHostName); + } + catch + { } + logger.lg.scriviLog(postazione_IP + _testoPre); + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string testoLog, tipoLog tipo) + { + bool answ = false; + string postazione_IP = ""; + try + { + postazione_IP = string.Format(" | {0} | ", Request.UserHostName); + } + catch + { } + logger.lg.scriviLog(postazione_IP + testoLog, tipo); + return answ; + } + /// + /// crea nuova lista di prelievo + /// + /// + /// + protected void btnCreaNuova_Click(object sender, EventArgs e) + { + // controllo se qta != 0... + decimal qta = 0; + string destinatario = ""; + string destinatarioDescr = ""; + try + { + // calcolo il dato del destinatario... + GMW_data.DS_Utility.v_selDestinatariListePrelievoRow riga = utils.obj.taDestListePre.getByValue(ddlDestin.SelectedValue)[0]; + destinatario = riga.value.Trim(); + destinatarioDescr = riga.label.Trim(); + } + catch + { } + try + { + qta = Convert.ToDecimal(txtQta.Text); + } + catch + { } + if (qta > 0 && destinatario != "") + { + MagClass.magazzino.creaListaPrelievo(memLayer.ML.cdv("CodCS"), ddlTipoLista.SelectedValue, ParticolareRichiesto, ddlEsponente.SelectedValue, ddlFigura.SelectedValue, qta, ddlImballo.SelectedValue, destinatario, destinatarioDescr); + // sollevo evento nuovo valore... + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } + } + } + /// + /// evento nuovo valore + /// + public event EventHandler eh_nuovoValore; + /// + /// valore del aprticolare della lsita prelievo get/set + /// + public string ParticolareRichiesto + { + get + { + return txtParticolare.Text; + } + set + { + txtParticolare.Text = value; + //acParticolare.valore = value; + checkParticolare(); + } + } + /// + /// blocca il tipo lista selezionabile che non può essere cambiata + /// + public bool bloccaTipoLista + { + set + { + if (value) + { + ddlTipoLista.Enabled = false; + } + } + } + /// + /// (pre)imposta il valore del tipo lista di prelievo + /// + public string valoreTipoLista + { + get + { + return ddlTipoLista.SelectedValue; + } + set + { + ddlTipoLista.SelectedValue = value; + } + } + + protected void ddlTipoLista_SelectedIndexChanged(object sender, EventArgs e) + { + // fixAutocomplete(); + checkParticolare(); + } + + protected void ddlEsponente_SelectedIndexChanged(object sender, EventArgs e) + { + checkParticolare(); + } + + protected void ddlFigura_SelectedIndexChanged(object sender, EventArgs e) + { + checkParticolare(); + } + + protected void ddlImballo_SelectedIndexChanged(object sender, EventArgs e) + { + checkParticolare(); + } + + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_part2kit.ascx.cs b/GMW/WebUserControls/mod_part2kit.ascx.cs index dce31471..f3177d05 100644 --- a/GMW/WebUserControls/mod_part2kit.ascx.cs +++ b/GMW/WebUserControls/mod_part2kit.ascx.cs @@ -97,7 +97,7 @@ namespace GMW.WebUserControls DataColumnCollection colonne = tabella.Columns; return colonne; } - + protected void grView_SelectedIndexChanged(object sender, EventArgs e) { raiseEvent(ucEvType.Selected); @@ -111,7 +111,7 @@ namespace GMW.WebUserControls } set { - if (value == "" || value == null) value = "###"; + if (string.IsNullOrEmpty(value)) value = "###"; hfCodKIT.Value = value; } } diff --git a/GMW/WebUserControls/mod_postRX_DT_LIST.ascx b/GMW/WebUserControls/mod_postRX_DT_LIST.ascx index 5245de8c..8f1f30e8 100644 --- a/GMW/WebUserControls/mod_postRX_DT_LIST.ascx +++ b/GMW/WebUserControls/mod_postRX_DT_LIST.ascx @@ -1,186 +1,186 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_postRX_DT_LIST.ascx.cs" Inherits="GMW.WebUserControls.mod_postRX_DT_LIST" %> <%if (false) - { %> + { %> <%} %>
-
-
-
-
- <%: traduci("DtxLetti") %> -
-
- - - - - - - - - - - - - - - - <%: traduci("Reset") %> - - - - - - - - - - - - -
- -
-
- -
-
-
- - - - - - - - - - - - - - -
-
- - - - - - - - - - -
-
-
-
- <%: traduci("ParticolariCaricati") %> -
-
- - - - - - - - - - - - - - -
-
+
+
+
+
+ <%: traduci("DtxLetti") %>
-
-
-
- -
-
- -
- -
-
-
- - - -
-
-
- <%: traduci("lblElencoPart") %> -
- - - - - - - - - -
-
-
-
- <%: traduci("lblDataMatrix") %> -
- -
-
-
-
- <%: traduci("Note") %> -
-
- -
-
- <%: traduci("lbtCreaUdcAl") %> - <%: traduci("lbtStampaAL") %> -
-
-
-
-
-
-
-
- <%: traduci("lblQtaPart") %> -
-
- <%--disabilitati in maschera dtx--%> - -
-
-
-
- <%: traduci("DataFusione") %> -
-
- -
+
+ + + + + + + + + + + + + + + + <%: traduci("Reset") %> + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + + - -
-
-
-
- <%: traduci("lblCesta") %> -
-
- -
-
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ <%: traduci("ParticolariCaricati") %> +
+
+ + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+ +
+ +
+
+
+ + + +
+
+
+ <%: traduci("lblElencoPart") %> +
+ + + + + + + + + +
+
+
+
+ <%: traduci("lblDataMatrix") %> +
+ +
+
+
+
+ <%: traduci("Note") %> +
+
+ +
+
+ <%: traduci("lbtCreaUdcAl") %> + <%: traduci("lbtStampaAL") %> +
+
+
+
+
+
+
+
+ <%: traduci("lblQtaPart") %> +
+
+ <%--disabilitati in maschera dtx--%> + +
+
+
+
+ <%: traduci("DataFusione") %> +
+
+ +
+ + +
+
+
+
+ <%: traduci("lblCesta") %> +
+
+ +
+
+
+
diff --git a/GMW/WebUserControls/mod_postRX_DT_LIST.ascx.cs b/GMW/WebUserControls/mod_postRX_DT_LIST.ascx.cs index 1cc1d4eb..0ed827c1 100644 --- a/GMW/WebUserControls/mod_postRX_DT_LIST.ascx.cs +++ b/GMW/WebUserControls/mod_postRX_DT_LIST.ascx.cs @@ -119,7 +119,7 @@ namespace GMW.WebUserControls catch { } //2016.01.25 se vuoto metto ND!!! - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = "ND"; } @@ -401,7 +401,7 @@ namespace GMW.WebUserControls { // vers 2.9 // controllo formato datamatrix sia impostato sulla linea (altrimenti errore linea "non battezzata") - if (FormatoDtmxLinea == "") + if (string.IsNullOrEmpty(FormatoDtmxLinea)) { // errore poiché non è stato non specificato tipo Dtmx assegnato alla linea! Postazione.messaggiText = barcodeIn; @@ -435,7 +435,7 @@ namespace GMW.WebUserControls } catch (Exception exc) { - logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{3}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); + logger.lg.scriviLog(string.Format("Errore in decodifica particolare da DataMatrix:{0}dtx:{1}{0}Formato Linea:{2}{0}Eccezione:{0}{2}", Environment.NewLine, barcodeIn, exc), tipoLog.EXCEPTION); currParticolare = ""; } if (currParticolare != "") diff --git a/GMW/WebUserControls/mod_post_B48.ascx.cs b/GMW/WebUserControls/mod_post_B48.ascx.cs index 6c2a180b..83bac243 100644 --- a/GMW/WebUserControls/mod_post_B48.ascx.cs +++ b/GMW/WebUserControls/mod_post_B48.ascx.cs @@ -664,7 +664,7 @@ namespace GMW.WebUserControls else // PROCEDO!!! { // controllo formato datamatrix sia impostato sulla linea (altrimenti errore linea "non battezzata") - if (FormatoDtmxLinea == "") + if (string.IsNullOrEmpty(FormatoDtmxLinea)) { // errore poiché non è stato non specificato tipo Dtmx assegnato alla linea! Postazione.messaggiText = barcodeIn; @@ -747,7 +747,7 @@ namespace GMW.WebUserControls { newUdcChild = ""; } - if (newUdcChild == "") + if (string.IsNullOrEmpty(newUdcChild)) { // controllo NON ci siano troppi UDC in posizione... da capienza ed assegnati DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga; diff --git a/GMW/WebUserControls/mod_ricercaGenerica.ascx.cs b/GMW/WebUserControls/mod_ricercaGenerica.ascx.cs index 37fd9af8..1b3af19b 100644 --- a/GMW/WebUserControls/mod_ricercaGenerica.ascx.cs +++ b/GMW/WebUserControls/mod_ricercaGenerica.ascx.cs @@ -5,182 +5,182 @@ using System.Web.UI; public partial class mod_ricercaGenerica : ApplicationUserControl { - #region gestione eventi + #region gestione eventi - public event EventHandler eh_nuovaRicerca; + public event EventHandler eh_nuovaRicerca; - #endregion + #endregion - # region area protected + #region area protected - #region area ricerche dettaglio specifiche + #region area ricerche dettaglio specifiche - protected bool _cercaMatricole = false; - protected bool _cercaUsername = false; - //protected bool _cercaManufacturer = false; - //protected bool _cercaCategorie = false; - protected bool _cercaModelli = false; - protected bool _cercaMag = false; + protected bool _cercaMatricole = false; + protected bool _cercaUsername = false; + //protected bool _cercaManufacturer = false; + //protected bool _cercaCategorie = false; + protected bool _cercaModelli = false; + protected bool _cercaMag = false; - #endregion + #endregion - protected override void Page_Load(object sender, EventArgs e) + protected override void Page_Load(object sender, EventArgs e) + { + base.Page_Load(sender, e); + updateText(); + } + /// + /// cambiato valore in ricerca + /// + /// + /// + protected void txtCerca_TextChanged(object sender, EventArgs e) + { + salvaCerca(); + } + + /// + /// effettuato reset + /// + /// + /// + protected void lnkReset_Click(object sender, EventArgs e) + { + txtCerca.Text = ""; + salvaCerca(); + } + /// + /// pressione del button di ricerca + /// + /// + /// + protected void btnCerca_Click(object sender, EventArgs e) + { + salvaCerca(); + } + /// + /// testo ricerca trimmato da spazi + /// + protected string testoRicerca + { + get { - base.Page_Load(sender, e); - updateText(); + return txtCerca.Text.Trim(); } - /// - /// cambiato valore in ricerca - /// - /// - /// - protected void txtCerca_TextChanged(object sender, EventArgs e) + set { - salvaCerca(); + txtCerca.Text = value; } + } - /// - /// effettuato reset - /// - /// - /// - protected void lnkReset_Click(object sender, EventArgs e) + protected void salvaCerca() + { + if (string.IsNullOrEmpty(testoRicerca)) { - txtCerca.Text = ""; - salvaCerca(); + SteamWare.memLayer.ML.emptySessionVal("valoreCercato"); + SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch"); } - /// - /// pressione del button di ricerca - /// - /// - /// - protected void btnCerca_Click(object sender, EventArgs e) + else { - salvaCerca(); + SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca); + // verifico ricerche accessorie + if (_cercaMatricole) + { + salvaCercaMatricole(); + } + if (_cercaUsername) + { + salvaCercaUsername(); + } + // raise dell'evento + if (eh_nuovaRicerca != null) + { + eh_nuovaRicerca(this, new EventArgs()); + } } - /// - /// testo ricerca trimmato da spazi - /// - protected string testoRicerca + } + /// + /// ricerca utenti e salva lista matricole x SQL IN + /// + protected void salvaCercaMatricole() + { + // salvo anche l'elenco delle matricole compatibili... + DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca); + string listaMatricoleSearch = ""; + foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti) { - get - { - return txtCerca.Text.Trim(); - } - set - { - txtCerca.Text = value; - } + listaMatricoleSearch += string.Format("'{0}', ", riga.MATRICOLA); } + if (listaMatricoleSearch.Length > 0) + { + listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2); + } + SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch); + } + /// + /// ricerca utenti e salva lista username x SQL IN + /// + protected void salvaCercaUsername() + { + // salvo anche l'elenco delle matricole compatibili... + DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca); + string listaUsernameSearch = ""; + foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti) + { + listaUsernameSearch += string.Format("'{0}', ", riga.USER_NAME); + } + if (listaUsernameSearch.Length > 0) + { + listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2); + } + SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch); + } - protected void salvaCerca() - { - if (testoRicerca == "") - { - SteamWare.memLayer.ML.emptySessionVal("valoreCercato"); - SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch"); - } - else - { - SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca); - // verifico ricerche accessorie - if (_cercaMatricole) - { - salvaCercaMatricole(); - } - if (_cercaUsername) - { - salvaCercaUsername(); - } - // raise dell'evento - if (eh_nuovaRicerca != null) - { - eh_nuovaRicerca(this, new EventArgs()); - } - } - } - /// - /// ricerca utenti e salva lista matricole x SQL IN - /// - protected void salvaCercaMatricole() - { - // salvo anche l'elenco delle matricole compatibili... - DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca); - string listaMatricoleSearch = ""; - foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti) - { - listaMatricoleSearch += string.Format("'{0}', ", riga.MATRICOLA); - } - if (listaMatricoleSearch.Length > 0) - { - listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2); - } - SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch); - } - /// - /// ricerca utenti e salva lista username x SQL IN - /// - protected void salvaCercaUsername() - { - // salvo anche l'elenco delle matricole compatibili... - DataLayer_AnagGen.UTENTEDataTable righeUtenti = DataWrap.DW.taUtente.getByRicercaNomeCognome(testoRicerca); - string listaUsernameSearch = ""; - foreach (DataLayer_AnagGen.UTENTERow riga in righeUtenti) - { - listaUsernameSearch += string.Format("'{0}', ", riga.USER_NAME); - } - if (listaUsernameSearch.Length > 0) - { - listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2); - } - SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch); - } + #endregion - #endregion + #region area public - #region area public + /// + /// aggiorna il testo cercato + /// + public void updateText() + { + if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack) + { + testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato"); + } + } - /// - /// aggiorna il testo cercato - /// - public void updateText() + /// + /// indica se generare da stringa search un elenco delle matricole corrispondenti + /// + public bool cercaMatricole + { + get { - if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack) - { - testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato"); - } + return _cercaMatricole; } - - /// - /// indica se generare da stringa search un elenco delle matricole corrispondenti - /// - public bool cercaMatricole + set { - get - { - return _cercaMatricole; - } - set - { - _cercaMatricole = value; - } + _cercaMatricole = value; } - /// - /// indica se generare da stringa search un elenco di username corrispondenti - /// - public bool cercaUsername + } + /// + /// indica se generare da stringa search un elenco di username corrispondenti + /// + public bool cercaUsername + { + get { - get - { - return _cercaUsername; - } - set - { - _cercaUsername = value; - } + return _cercaUsername; } + set + { + _cercaUsername = value; + } + } - #endregion + #endregion } diff --git a/GMW/WebUserControls/mod_rimuoviNC.ascx.cs b/GMW/WebUserControls/mod_rimuoviNC.ascx.cs index 190b0d21..000ff262 100644 --- a/GMW/WebUserControls/mod_rimuoviNC.ascx.cs +++ b/GMW/WebUserControls/mod_rimuoviNC.ascx.cs @@ -16,7 +16,7 @@ namespace GMW.WebUserControls // controllo se ho QueryString modalità operativa... if (!Page.IsPostBack) { - if (memLayer.ML.QSS("RNC_Mode") == "") + if (string.IsNullOrEmpty(memLayer.ML.QSS("RNC_Mode"))) { // reinvio impostando modalità Delibera Semplice... Response.Redirect(string.Format("{0}?RNC_Mode=sim", user_std.pagCorrente), false); diff --git a/GMW/WebUserControls/mod_sanpos_associaz_F10_F18.ascx.cs b/GMW/WebUserControls/mod_sanpos_associaz_F10_F18.ascx.cs index 068cccf5..0815fee6 100644 --- a/GMW/WebUserControls/mod_sanpos_associaz_F10_F18.ascx.cs +++ b/GMW/WebUserControls/mod_sanpos_associaz_F10_F18.ascx.cs @@ -5,335 +5,335 @@ using System.Web.UI; namespace GMW.WebUserControls { - public partial class mod_sanpos_associaz_F10_F18 : System.Web.UI.UserControl + public partial class mod_sanpos_associaz_F10_F18 : System.Web.UI.UserControl + { + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - calcolaPostazione(); - traduciObj(); - } - doChecks(); - lblGitterBoxAttivo.Text = ""; - if (currUdcFrom != "") - { - lblGitterBoxAttivo.Text += string.Format("{1}: {0}", currUdcFrom, traduci("UdcPartenza")); - } - if (lblGitterBoxAttivo.Text != "") - { - lblGitterBoxAttivo.Text += "
"; - } - if (currUdcTo != "") - { - lblGitterBoxAttivo.Text += string.Format("{1}: {0}", currUdcTo, traduci("UdcArrivo")); - } - if (lblGitterBoxAttivo.Text == "") - { - lblGitterBoxAttivo.Text = "..."; - } - } - /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - checkStampa(); - } - /// - /// sistemo labels oggetti - /// - private void traduciObj() - { - // buttons - btnAssocia.Text = traduci("btnAssocia"); - } - /// - /// restituisce il nome della pagina corrente - /// - protected string PagCorrente - { - get - { - string answ = ""; - Uri MyUrl = Request.Url; - string delimStr = "/"; - char[] delimiter = delimStr.ToCharArray(); - string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); - int n = finalUrl.Length; - answ = finalUrl[n - 1].ToString(); - DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; - answ = riga.NOME; - return answ; - } - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// calcola postazione corrente (ip, name, printer) - /// - private void calcolaPostazione() - { - postazione_IP = Request.UserHostName; - postazione_name = dnsUtils.DetermineCompName(postazione_IP); - // cerco stampante x postazione - postazione_printer = "n.d."; - try - { - DS_Applicazione.ElencoPostazioniDataTable tabPost = DataProxy.obj.taElPost.getByCod(postazione_name); - if (tabPost.Rows.Count > 0) - { - postazione_printer = tabPost[0].stampante; - } - //else - //{ - // tabPost = DataProxy.obj.taElPost.getByCod("default"); - // postazione_printer = tabPost[0].stampante; - //} - } - catch - { } - } - /// - /// indica name della postazione corrente - /// - protected string postazione_name - { - get - { - return memLayer.ML.StringSessionObj("postazione_name"); - } - set - { - memLayer.ML.setSessionVal("postazione_name", value); - } - } - /// - /// indica ip della postazione corrente - /// - protected string postazione_IP - { - get - { - return memLayer.ML.StringSessionObj("postazione_IP"); - } - set - { - memLayer.ML.setSessionVal("postazione_IP", value); - } - } - /// - /// indica stampante associata alla postazione corrente - /// - protected string postazione_printer - { - get - { - return memLayer.ML.StringSessionObj("postazione_printer"); - } - set - { - memLayer.ML.setSessionVal("postazione_printer", value); - } - } - /// - /// indica UDC FROM (F10) selezionato - /// - protected string currUdcFrom - { - get - { - return memLayer.ML.StringSessionObj("currUdcFrom"); - } - set - { - memLayer.ML.setSessionVal("currUdcFrom", value, false); - } - } - /// - /// indica UDC TO (F18) selezionato - /// - protected string currUdcTo - { - get - { - return memLayer.ML.StringSessionObj("currUdcTo"); - } - set - { - memLayer.ML.setSessionVal("currUdcTo", value, false); - } - } - /// - /// indica se i caratteri vadano forzati a maiuscoli - /// - public bool forceUppercase - { - get - { - return memLayer.ML.confReadBool("forceUppercase"); - } - } - /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.AppConf["prefComandi"]; - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - // controllo se sia un particolare Tipo P - else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... - { - answ = tipoCodiceBarcode.Particolare; - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - DS_Applicazione.ElencoCartelliniRow rigaCart; - string tipoImballo = ""; - Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) - { - - case tipoCodiceBarcode.UDC: - // procedo solo se UDC esistente - if (MagClass.magazzino.checkUDC(barcodeIn)) - { - // cerco di recuperare riga UDC - try - { - rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; - tipoImballo = rigaCart.CodImballo; - } - catch - { } - // controllo il tipo imballo dell'UDC per decidere se sia F10 o F18... - if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidi")) - { - // salvo UDC from - currUdcFrom = barcodeIn; - } - else if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidiDaSpedire")) - { - // salvo UDC to - currUdcTo = barcodeIn; - } - else - { - Postazione.messaggiText += " - codice UDC non valido / non trovato."; - pnlAll.CssClass = "stileComandoKo"; - } - } - - break; - default: - Postazione.messaggiText += " - codice non riconosciuto!"; - pnlAll.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; - } - else - { - Postazione.messaggiText = traduci("AttesaBCode"); - pnlAll.CssClass = "stileAttesa"; - } - //grView.DataBind(); - txtBarcode.Focus(); - } - /// - /// controllo l'abilitazione alla stampa UDC: - /// - particolare ok - /// - qta > 0 - /// - almeno 1 trattamento - /// altrimenti disabilito btn stampa - /// - private void checkStampa() - { - bool associaOk = false; - if (currUdcFrom != "" && currUdcTo != "") - { - associaOk = true; - } - btnAssocia.Enabled = associaOk; - } - /// - /// genera i barcode di - /// - trattamenti - /// - nuovo x pezzi liquidi - /// e lancia la relativa stampa - /// - /// - /// - protected void btnAssocia_Click(object sender, EventArgs e) - { - if (currUdcFrom != "" && currUdcTo != "") - { - // associo i 2 cartellini - MagClass.magazzino.associaUdcParent(currUdcTo, currUdcFrom); - // indico UDC associati! - Postazione.messaggiText = string.Format("{0} {1} -> {2}", traduci("effettuataAssociazione"), currUdcFrom, currUdcTo); - currUdcFrom = ""; - currUdcTo = ""; - lblGitterBoxAttivo.Text = ""; - } - } + if (!Page.IsPostBack) + { + calcolaPostazione(); + traduciObj(); + } + doChecks(); + lblGitterBoxAttivo.Text = ""; + if (currUdcFrom != "") + { + lblGitterBoxAttivo.Text += string.Format("{1}: {0}", currUdcFrom, traduci("UdcPartenza")); + } + if (lblGitterBoxAttivo.Text != "") + { + lblGitterBoxAttivo.Text += "
"; + } + if (currUdcTo != "") + { + lblGitterBoxAttivo.Text += string.Format("{1}: {0}", currUdcTo, traduci("UdcArrivo")); + } + if (string.IsNullOrEmpty(lblGitterBoxAttivo.Text)) + { + lblGitterBoxAttivo.Text = "..."; + } } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkStampa(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + // buttons + btnAssocia.Text = traduci("btnAssocia"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// calcola postazione corrente (ip, name, printer) + /// + private void calcolaPostazione() + { + postazione_IP = Request.UserHostName; + postazione_name = dnsUtils.DetermineCompName(postazione_IP); + // cerco stampante x postazione + postazione_printer = "n.d."; + try + { + DS_Applicazione.ElencoPostazioniDataTable tabPost = DataProxy.obj.taElPost.getByCod(postazione_name); + if (tabPost.Rows.Count > 0) + { + postazione_printer = tabPost[0].stampante; + } + //else + //{ + // tabPost = DataProxy.obj.taElPost.getByCod("default"); + // postazione_printer = tabPost[0].stampante; + //} + } + catch + { } + } + /// + /// indica name della postazione corrente + /// + protected string postazione_name + { + get + { + return memLayer.ML.StringSessionObj("postazione_name"); + } + set + { + memLayer.ML.setSessionVal("postazione_name", value); + } + } + /// + /// indica ip della postazione corrente + /// + protected string postazione_IP + { + get + { + return memLayer.ML.StringSessionObj("postazione_IP"); + } + set + { + memLayer.ML.setSessionVal("postazione_IP", value); + } + } + /// + /// indica stampante associata alla postazione corrente + /// + protected string postazione_printer + { + get + { + return memLayer.ML.StringSessionObj("postazione_printer"); + } + set + { + memLayer.ML.setSessionVal("postazione_printer", value); + } + } + /// + /// indica UDC FROM (F10) selezionato + /// + protected string currUdcFrom + { + get + { + return memLayer.ML.StringSessionObj("currUdcFrom"); + } + set + { + memLayer.ML.setSessionVal("currUdcFrom", value, false); + } + } + /// + /// indica UDC TO (F18) selezionato + /// + protected string currUdcTo + { + get + { + return memLayer.ML.StringSessionObj("currUdcTo"); + } + set + { + memLayer.ML.setSessionVal("currUdcTo", value, false); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + // controllo se sia un particolare Tipo P + else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + DS_Applicazione.ElencoCartelliniRow rigaCart; + string tipoImballo = ""; + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // cerco di recuperare riga UDC + try + { + rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; + tipoImballo = rigaCart.CodImballo; + } + catch + { } + // controllo il tipo imballo dell'UDC per decidere se sia F10 o F18... + if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidi")) + { + // salvo UDC from + currUdcFrom = barcodeIn; + } + else if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidiDaSpedire")) + { + // salvo UDC to + currUdcTo = barcodeIn; + } + else + { + Postazione.messaggiText += " - codice UDC non valido / non trovato."; + pnlAll.CssClass = "stileComandoKo"; + } + } + + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + pnlAll.CssClass = "stileAttesa"; + } + //grView.DataBind(); + txtBarcode.Focus(); + } + /// + /// controllo l'abilitazione alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - almeno 1 trattamento + /// altrimenti disabilito btn stampa + /// + private void checkStampa() + { + bool associaOk = false; + if (currUdcFrom != "" && currUdcTo != "") + { + associaOk = true; + } + btnAssocia.Enabled = associaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnAssocia_Click(object sender, EventArgs e) + { + if (currUdcFrom != "" && currUdcTo != "") + { + // associo i 2 cartellini + MagClass.magazzino.associaUdcParent(currUdcTo, currUdcFrom); + // indico UDC associati! + Postazione.messaggiText = string.Format("{0} {1} -> {2}", traduci("effettuataAssociazione"), currUdcFrom, currUdcTo); + currUdcFrom = ""; + currUdcTo = ""; + lblGitterBoxAttivo.Text = ""; + } + } + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sanpos_consumoF10.ascx.cs b/GMW/WebUserControls/mod_sanpos_consumoF10.ascx.cs index fb46de05..b8f35e52 100644 --- a/GMW/WebUserControls/mod_sanpos_consumoF10.ascx.cs +++ b/GMW/WebUserControls/mod_sanpos_consumoF10.ascx.cs @@ -5,340 +5,340 @@ using System.Web.UI; namespace GMW.WebUserControls { - public partial class mod_sanpos_consumoF10 : System.Web.UI.UserControl + public partial class mod_sanpos_consumoF10 : System.Web.UI.UserControl + { + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { - /// - /// caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - traduciObj(); - } - doChecks(); - lblParticolareAttivo.Text = ""; - if (currUdcFrom != "") - { - lblParticolareAttivo.Text += string.Format("UDC FROM: {0}", currUdcFrom); - } - if (lblParticolareAttivo.Text == "") - { - lblParticolareAttivo.Text = "..."; - } - } - /// - /// richiesta (ri)stampa UDC - /// - /// - /// - public void ristampa() - { - 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 Fusi {0}", udcReq), tipoLog.EXCEPTION); - } - if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, postazione_name, postazione_IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Fusi"); - } - /// - /// udc da stampare - /// - protected string udcReq - { - get - { - return memLayer.ML.StringSessionObj("udcSelSAO"); - } - } - /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - checkConsuma(); - } - /// - /// sistemo labels oggetti - /// - private void traduciObj() - { - // buttons - btnConsuma.Text = traduci("btnConsumaUdcF10"); - } - /// - /// restituisce il nome della pagina corrente - /// - protected string PagCorrente - { - get - { - string answ = ""; - Uri MyUrl = Request.Url; - string delimStr = "/"; - char[] delimiter = delimStr.ToCharArray(); - string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); - int n = finalUrl.Length; - answ = finalUrl[n - 1].ToString(); - DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; - answ = riga.NOME; - return answ; - } - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - - /// - /// indica name della postazione corrente - /// - protected string postazione_name - { - get - { - return memLayer.ML.StringSessionObj("postazione_name"); - } - set - { - memLayer.ML.setSessionVal("postazione_name", value); - } - } - /// - /// indica ip della postazione corrente - /// - protected string postazione_IP - { - get - { - return memLayer.ML.StringSessionObj("postazione_IP"); - } - set - { - memLayer.ML.setSessionVal("postazione_IP", value); - } - } - /// - /// indica stampante associata alla postazione corrente - /// - protected string postazione_printer - { - get - { - return memLayer.ML.StringSessionObj("postazione_printer"); - } - set - { - memLayer.ML.setSessionVal("postazione_printer", value); - } - } - /// - /// indica UDC FROM (F10) selezionato - /// - protected string currUdcFrom - { - get - { - return memLayer.ML.StringSessionObj("currUdcFrom"); - } - set - { - memLayer.ML.setSessionVal("currUdcFrom", value, false); - } - } - /// - /// indica se i caratteri vadano forzati a maiuscoli - /// - public bool forceUppercase - { - get - { - return memLayer.ML.confReadBool("forceUppercase"); - } - } - /// - /// decodifica il tipo barcode acquisito - /// - public tipoCodiceBarcode tipoBCode - { - get - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - int trovati = 0; - // controllo non si tratti di un comando... - string preCmd = memLayer.ML.AppConf["prefComandi"]; - if (barcodeIn.StartsWith(preCmd)) - { - answ = tipoCodiceBarcode.Comando; - } - // controllo se sia un particolare Tipo P - else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... - { - answ = tipoCodiceBarcode.Particolare; - } - else - { - try - { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; - if (trovati > 0) - { - answ = tipoCodiceBarcode.UDC; - } - } - catch - { - } - } - return answ; - } - } - /// - /// valore barcode - /// - public string barcodeIn - { - get - { - return txtBarcode.Text.Trim(); - } - set - { - txtBarcode.Text = value; - } - } - /// - /// controlla se ci sia un barcode - /// - private void checkBarcode() - { - if (barcodeIn != "") - { - DS_Applicazione.ElencoCartelliniRow rigaCart; - string tipoImballo = ""; - Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) - { - - case tipoCodiceBarcode.UDC: - // procedo solo se UDC esistente - if (MagClass.magazzino.checkUDC(barcodeIn)) - { - // cerco di recuperare riga UDC - try - { - rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; - tipoImballo = rigaCart.CodImballo; - } - catch - { } - // controllo il tipo imballo dell'UDC per decidere se sia F10 o F18... - if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidi")) - { - // salvo UDC from - currUdcFrom = barcodeIn; - } - else - { - Postazione.messaggiText += " - codice UDC non valido / non trovato."; - pnlAll.CssClass = "stileComandoKo"; - } - } - - break; - default: - Postazione.messaggiText += " - codice non riconosciuto!"; - pnlAll.CssClass = "stileComandoND"; - break; - } - barcodeIn = ""; - } - else - { - Postazione.messaggiText = traduci("AttesaBCode"); - pnlAll.CssClass = "stileAttesa"; - } - //grView.DataBind(); - txtBarcode.Focus(); - } - /// - /// controllo l'abilitazione alla stampa UDC: - /// - particolare ok - /// - qta > 0 - /// - almeno 1 trattamento - /// altrimenti disabilito btn stampa - /// - private void checkConsuma() - { - bool associaOk = false; - if (currUdcFrom != "") - { - associaOk = true; - } - btnConsuma.Enabled = associaOk; - } - /// - /// genera i barcode di - /// - trattamenti - /// - nuovo x pezzi liquidi - /// e lancia la relativa stampa - /// - /// - /// - protected void btnConsuma_Click(object sender, EventArgs e) - { - // effettuo controlli che cod_soggetto e cod particolare siano disponibili... - string codSogg = ""; - string particolare = ""; - DateTime adesso = DateTime.Now; - try - { - codSogg = MagClass.magazzino.CodSoggCurrUser; - particolare = MagClass.magazzino.getParticolareByUDC(currUdcFrom); - } - catch - { - } - if (codSogg != "" && particolare != "") - { - - if (currUdcFrom != "") - { - // controllo se UDC non sia già consumato... - if (MagClass.magazzino.udcMpIsConsumabile(currUdcFrom)) - { - // consumo UDC - MagClass.magazzino.scaricaUdcMpWip(currUdcFrom, Request.UserHostName); - // registro consumo UDC - MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, postazione_name, postazione_IP, currUdcFrom, particolare, "consumaUDC", "Consumato UDC F10"); - } - // indico UDC consumato! - Postazione.messaggiText = string.Format("{0} {1}", traduci("effettuatoConsumoUDC"), currUdcFrom); - currUdcFrom = ""; - lblParticolareAttivo.Text = ""; - } - } - } - + if (!Page.IsPostBack) + { + traduciObj(); + } + doChecks(); + lblParticolareAttivo.Text = ""; + if (currUdcFrom != "") + { + lblParticolareAttivo.Text += string.Format("UDC FROM: {0}", currUdcFrom); + } + if (string.IsNullOrEmpty(lblParticolareAttivo.Text)) + { + lblParticolareAttivo.Text = "..."; + } } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + 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 Fusi {0}", udcReq), tipoLog.EXCEPTION); + } + if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, postazione_name, postazione_IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Fusi"); + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkConsuma(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + // buttons + btnConsuma.Text = traduci("btnConsumaUdcF10"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + + /// + /// indica name della postazione corrente + /// + protected string postazione_name + { + get + { + return memLayer.ML.StringSessionObj("postazione_name"); + } + set + { + memLayer.ML.setSessionVal("postazione_name", value); + } + } + /// + /// indica ip della postazione corrente + /// + protected string postazione_IP + { + get + { + return memLayer.ML.StringSessionObj("postazione_IP"); + } + set + { + memLayer.ML.setSessionVal("postazione_IP", value); + } + } + /// + /// indica stampante associata alla postazione corrente + /// + protected string postazione_printer + { + get + { + return memLayer.ML.StringSessionObj("postazione_printer"); + } + set + { + memLayer.ML.setSessionVal("postazione_printer", value); + } + } + /// + /// indica UDC FROM (F10) selezionato + /// + protected string currUdcFrom + { + get + { + return memLayer.ML.StringSessionObj("currUdcFrom"); + } + set + { + memLayer.ML.setSessionVal("currUdcFrom", value, false); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + // controllo se sia un particolare Tipo P + else if (TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare && TermClass.Ter.isParticolare(barcodeIn)) // è un particolare... + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + DS_Applicazione.ElencoCartelliniRow rigaCart; + string tipoImballo = ""; + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // cerco di recuperare riga UDC + try + { + rigaCart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0]; + tipoImballo = rigaCart.CodImballo; + } + catch + { } + // controllo il tipo imballo dell'UDC per decidere se sia F10 o F18... + if (tipoImballo == memLayer.ML.cdv("CodImballoLiquidi")) + { + // salvo UDC from + currUdcFrom = barcodeIn; + } + else + { + Postazione.messaggiText += " - codice UDC non valido / non trovato."; + pnlAll.CssClass = "stileComandoKo"; + } + } + + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + pnlAll.CssClass = "stileAttesa"; + } + //grView.DataBind(); + txtBarcode.Focus(); + } + /// + /// controllo l'abilitazione alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - almeno 1 trattamento + /// altrimenti disabilito btn stampa + /// + private void checkConsuma() + { + bool associaOk = false; + if (currUdcFrom != "") + { + associaOk = true; + } + btnConsuma.Enabled = associaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnConsuma_Click(object sender, EventArgs e) + { + // effettuo controlli che cod_soggetto e cod particolare siano disponibili... + string codSogg = ""; + string particolare = ""; + DateTime adesso = DateTime.Now; + try + { + codSogg = MagClass.magazzino.CodSoggCurrUser; + particolare = MagClass.magazzino.getParticolareByUDC(currUdcFrom); + } + catch + { + } + if (codSogg != "" && particolare != "") + { + + if (currUdcFrom != "") + { + // controllo se UDC non sia già consumato... + if (MagClass.magazzino.udcMpIsConsumabile(currUdcFrom)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(currUdcFrom, Request.UserHostName); + // registro consumo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, postazione_name, postazione_IP, currUdcFrom, particolare, "consumaUDC", "Consumato UDC F10"); + } + // indico UDC consumato! + Postazione.messaggiText = string.Format("{0} {1}", traduci("effettuatoConsumoUDC"), currUdcFrom); + currUdcFrom = ""; + lblParticolareAttivo.Text = ""; + } + } + } + + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sanpos_controlloLiquidi.ascx.cs b/GMW/WebUserControls/mod_sanpos_controlloLiquidi.ascx.cs index 86d37909..0fb6e1b3 100644 --- a/GMW/WebUserControls/mod_sanpos_controlloLiquidi.ascx.cs +++ b/GMW/WebUserControls/mod_sanpos_controlloLiquidi.ascx.cs @@ -538,7 +538,7 @@ namespace GMW.WebUserControls codImballo = memLayer.ML.cdv("CodImballoLiquidi"); } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = memLayer.ML.cdv("CodImballoLiquidi"); } diff --git a/GMW/WebUserControls/mod_selLineaNtDt.ascx.cs b/GMW/WebUserControls/mod_selLineaNtDt.ascx.cs index 9e20d9ff..70dd889d 100644 --- a/GMW/WebUserControls/mod_selLineaNtDt.ascx.cs +++ b/GMW/WebUserControls/mod_selLineaNtDt.ascx.cs @@ -237,7 +237,7 @@ namespace GMW.WebUserControls } catch { } - if (answ == "") answ = "IO"; + if (string.IsNullOrEmpty(answ)) answ = "IO"; return answ; } set @@ -403,7 +403,7 @@ namespace GMW.WebUserControls try { DS_magazzino.AnagLineeRow riga = MagClass.magazzino.taAL.getByKey(codLinea)[0]; - if (riga.codPostazione == "" || riga.codPostazione == Postazione.name) + if (string.IsNullOrEmpty(riga.codPostazione) || riga.codPostazione == Postazione.name) { lineaLibera = true; } diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx.cs b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs index 30744b4f..d0559f8b 100644 --- a/GMW/WebUserControls/mod_sterrTaglio.ascx.cs +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs @@ -1,6 +1,7 @@ using GMW_data; using SteamWare; using System; +using System.Globalization; using System.Web.UI; using System.Web.UI.WebControls; @@ -44,9 +45,6 @@ namespace GMW.WebUserControls 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("ALS00{0}", Postazione.currCodCella); // controllo se esista AL sennò lo creo... if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0) @@ -399,7 +397,7 @@ namespace GMW.WebUserControls { udcDest = ""; } - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { try { @@ -410,10 +408,10 @@ namespace GMW.WebUserControls } catch (Exception exc) { - logger.lg.scriviLog(string.Format("Errore in creazione UDC temp ST x travaso: {0}{1}", Environment.NewLine, exc)); + logger.lg.scriviLog(string.Format(new CultureInfo("en-US"), "Errore in creazione UDC temp ST x travaso: {0}{1}", Environment.NewLine, exc)); } } - if (udcDest != "") + if (string.IsNullOrEmpty(udcDest)) { Postazione.CssClass = "stileAttesa"; Postazione.warningText = ""; diff --git a/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs index 53347b78..1c526ad3 100644 --- a/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs +++ b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs @@ -100,9 +100,6 @@ namespace GMW.WebUserControls 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("ALS00{0}", Postazione.currCodCella); // controllo se esista AL sennò lo creo... if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0) @@ -508,7 +505,7 @@ namespace GMW.WebUserControls { udcDest = ""; } - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { try { diff --git a/GMW/WebUserControls/mod_testata.ascx.cs b/GMW/WebUserControls/mod_testata.ascx.cs index 027eb66d..ed783722 100644 --- a/GMW/WebUserControls/mod_testata.ascx.cs +++ b/GMW/WebUserControls/mod_testata.ascx.cs @@ -83,7 +83,7 @@ namespace GMW.WebUserControls { try { - if (user_std.UtSn.mappaSito == "") + if (string.IsNullOrEmpty(user_std.UtSn.mappaSito)) { Response.Redirect("default.aspx", false); } @@ -203,7 +203,7 @@ namespace GMW.WebUserControls string[] uri = Request.Url.LocalPath.Split('/'); // salvo pagina corrente user_std.pagCorrente = uri.Last(); - if (user_std.pagPrecedente == "") + if (string.IsNullOrEmpty(user_std.pagPrecedente)) { user_std.pagPrecedente = user_std.pagCorrente; } diff --git a/GMW/forceUser.aspx.cs b/GMW/forceUser.aspx.cs index c298ee5d..5f0e52f7 100644 --- a/GMW/forceUser.aspx.cs +++ b/GMW/forceUser.aspx.cs @@ -7,7 +7,7 @@ public partial class forceUser : System.Web.UI.Page get { string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") + if (string.IsNullOrEmpty(pagina)) { pagina = "menu.aspx"; } diff --git a/GMW/login.aspx.cs b/GMW/login.aspx.cs index cab36883..0f230bbd 100644 --- a/GMW/login.aspx.cs +++ b/GMW/login.aspx.cs @@ -8,7 +8,7 @@ public partial class login : System.Web.UI.Page get { string pagina = memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") + if (string.IsNullOrEmpty(pagina)) { // cerco se ho prev / prec page if (user_std.pagPrecedente != "") diff --git a/GMW_data/MagClass.cs b/GMW_data/MagClass.cs index c6db8f48..1199f7f5 100644 --- a/GMW_data/MagClass.cs +++ b/GMW_data/MagClass.cs @@ -1548,7 +1548,7 @@ namespace GMW_data } else { - logger.lg.scriviLog(string.Format(" | {24} | CodSoggetto / particolare non validi! tentativo di creazione cartellino come {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8} | {9} | {10} | {11} | {12} | {13} | {14} | {15} | {16} | {17} | {18} | {19} | {20} | {21} | {22}", CodCS, CodBilanciaTrim, annoTrim, CodClienteTrim, ParticolareTrim, CodImpiantoTrim, CodStampoTrim, EsponenteTrim, FiguraTrim, DataRif, TurnoRif, CodImballoTrim, CodSoggettoTrim, Tara, IdxPosizione, CodTipoDichiarazioneTrim, codEventoTrim, Quantita, PesoTot, PesoCad, CodStatoTrim, UDC_parentTrim, noteTrim, clientIp), tipoLog.ERROR); + logger.lg.scriviLog(string.Format(" | {23} | CodSoggetto / particolare non validi! tentativo di creazione cartellino come {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8} | {9} | {10} | {11} | {12} | {13} | {14} | {15} | {16} | {17} | {18} | {19} | {20} | {21} | {22}", CodCS, CodBilanciaTrim, annoTrim, CodClienteTrim, ParticolareTrim, CodImpiantoTrim, CodStampoTrim, EsponenteTrim, FiguraTrim, DataRif, TurnoRif, CodImballoTrim, CodSoggettoTrim, Tara, IdxPosizione, CodTipoDichiarazioneTrim, codEventoTrim, Quantita, PesoTot, PesoCad, CodStatoTrim, UDC_parentTrim, noteTrim, clientIp), tipoLog.ERROR); } return answ; } @@ -1893,12 +1893,12 @@ namespace GMW_data { logger.lg.scriviLog(string.Format("Non sono riuscito a recuperare il codice soggetto DALLA SESSIONE per l'utente loggato: {0}, errore {1}{2}", user_std.UtSn.userNameAD, Environment.NewLine, e), tipoLog.ERROR); } - if (CodSoggetto == "") + if (string.IsNullOrEmpty(CodSoggetto)) { // provo a recuperare da cookie... CodSoggetto = memLayer.ML.getCookieVal("CodSoggetto"); } - if (CodSoggetto == "") + if (string.IsNullOrEmpty(CodSoggetto)) { if (user_std.UtSn.utente != "") { @@ -2557,7 +2557,7 @@ namespace GMW_data * OVVERO tutte le righe hanno nella tab trans posiz eventi una riga valida * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ bool listaScaricabile = true; - if (riga.Destinatario == "") + if (string.IsNullOrEmpty(riga.Destinatario)) { listaScaricabile = false; } @@ -2730,7 +2730,7 @@ namespace GMW_data * OVVERO tutte le righe hanno nella tab trans posiz eventi una riga valida * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ bool listaScaricabile = true; - if (riga.Destinatario == "") + if (string.IsNullOrEmpty(riga.Destinatario)) { listaScaricabile = false; } @@ -3041,7 +3041,7 @@ namespace GMW_data foreach (DS_magazzino.RapQualRow rqRow in tabRapQual) { // se non ha già un UDC... e se NON E' stato già scaricato... - if (rqRow.UDC == "" && rqRow.LegaScaric.ToUpper() == "N") + if (string.IsNullOrEmpty(rqRow.UDC) && rqRow.LegaScaric.ToUpper() == "N") { answ = true; // controllo se sia con benestare, se "N" imposto con stato Non accettata (da web.config) altrimenti con stato MP ok... diff --git a/GMW_data/UserControl.cs b/GMW_data/UserControl.cs index ea79709e..8236c473 100644 --- a/GMW_data/UserControl.cs +++ b/GMW_data/UserControl.cs @@ -50,7 +50,7 @@ namespace GMW_data { string answ = memLayer.ML.StringSessionObj("CodCS"); // se lo perdesse lo recupera da DB - if (answ == "") + if (string.IsNullOrEmpty(answ)) { answ = memLayer.ML.cdv("CodCS"); } diff --git a/GMW_data/UserControlBCodeMan.cs b/GMW_data/UserControlBCodeMan.cs index 24d96db1..35697407 100644 --- a/GMW_data/UserControlBCodeMan.cs +++ b/GMW_data/UserControlBCodeMan.cs @@ -218,9 +218,6 @@ namespace GMW_data string answ = ""; try { - // tolto 2015.06.25 redirect a pagina default - //// 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) @@ -992,7 +989,7 @@ namespace GMW_data } else { - if (lastBarcodeIn == "") + if (string.IsNullOrEmpty(lastBarcodeIn)) { Postazione.messaggiText = traduci("AttesaBCode"); Postazione.warningText = ""; @@ -1263,7 +1260,7 @@ namespace GMW_data } if (createUdcOut && checkDone) { - if (udcDest == "") + if (string.IsNullOrEmpty(udcDest)) { try { @@ -1361,7 +1358,7 @@ namespace GMW_data codImballo = CodImballoStd; } // se NON HA selezionato prendo default... - if (codImballo == "" || codImballo == "-") + if (string.IsNullOrEmpty(codImballo) || codImballo == "-") { codImballo = CodImballoStd; } diff --git a/GMW_data/reportPrinter.cs b/GMW_data/reportPrinter.cs index 845dbb16..33b28dd3 100644 --- a/GMW_data/reportPrinter.cs +++ b/GMW_data/reportPrinter.cs @@ -486,7 +486,7 @@ public class reportPrinter break; } // carico di dati con lettura da web.config parametrica - if (printerName == "") + if (string.IsNullOrEmpty(printerName)) { printerName = memLayer.ML.cdv(string.Format("printer{0}", tipo)); } diff --git a/Jenkinsfile b/Jenkinsfile index 623a6b41..74969645 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=2133']) { + withEnv(['NEXT_BUILD_NUMBER=2135']) { // impiego numero di build del SINGOLO RAMO // env.versionNumber = VersionNumber(versionNumberString : '4.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) // forzo numero di build x tutti rami uguali