diff --git a/GMW/Web.config b/GMW/Web.config index 5a6d9096..78e818f4 100644 --- a/GMW/Web.config +++ b/GMW/Web.config @@ -66,7 +66,7 @@ - + diff --git a/GMW/WebUserControls/mod_SterrTagIN.ascx b/GMW/WebUserControls/mod_SterrTagIN.ascx index 6abb3ef2..bab224df 100644 --- a/GMW/WebUserControls/mod_SterrTagIN.ascx +++ b/GMW/WebUserControls/mod_SterrTagIN.ascx @@ -131,7 +131,7 @@ SelectMethod="getUdcDetailByIdxCella" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter" OnDataBinding="ods_DataBinding" FilterExpression="UDC LIKE '%{0}%' OR PARTICOLARE LIKE '%{0}%'"> - + diff --git a/GMW/WebUserControls/mod_SterrTagOUT.ascx b/GMW/WebUserControls/mod_SterrTagOUT.ascx index 2837db17..a4e47bd7 100644 --- a/GMW/WebUserControls/mod_SterrTagOUT.ascx +++ b/GMW/WebUserControls/mod_SterrTagOUT.ascx @@ -143,7 +143,7 @@ SelectMethod="getUdcDetailByIdxCella" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter" OnDataBinding="ods_DataBinding" FilterExpression="UDC LIKE '%{0}%' OR PARTICOLARE LIKE '%{0}%'"> - + 0) - { - txtQta.Text = pezziUdc.ToString(); - } - else // rimette default - { - txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); - } + impostaParticolare(); break; case tipoCodiceBarcode.UDC: // procedo solo se UDC esistente @@ -466,6 +446,9 @@ namespace GMW.WebUserControls udcSelP = udcSelP.Replace(string.Format("#{0}#", barcodeIn), ""); } updFiltroPart(newPart); + // imposto particolare! + currParticolare = newPart; + impostaParticolare(); } break; @@ -484,6 +467,33 @@ namespace GMW.WebUserControls txtBarcode.Focus(); } /// + /// imposto i dati dal aprticolare corrente + /// + private void impostaParticolare() + { + // controllo esista il particolare scansionato + if (DataProxy.obj.taAnagParticolari.getByParticolare(currParticolare).Rows.Count == 0) + { + currParticolare = ""; + lblMessaggi.Text += " - codice particolare non valido / non trovato in RILPRO."; + pnlAll.CssClass = "stileComandoKo"; + } + else + { + lblMessaggi.Text += " - impostato particolare!"; + pnlAll.CssClass = "stileComandoOk"; + } + // leggo la qta dell'ultimo UDC del particolare, SE C'E', e la imposto... + if (pezziUdc > 0) + { + txtQta.Text = pezziUdc.ToString(); + } + else // rimette default + { + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + } + } + /// /// update del filtro su particolare x grview UDC caricati in linea /// /// @@ -914,15 +924,15 @@ namespace GMW.WebUserControls get { int answ = 0; - if (memLayer.ML.isInSessionObject("IdxCellaLineaOUT")) + if (memLayer.ML.isInSessionObject("IdxCellaLineaST_OUT")) { - answ = memLayer.ML.IntSessionObj("IdxCellaLineaOUT"); + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_OUT"); } return answ; } set { - memLayer.ML.setSessionVal("IdxCellaLineaOUT", value); + memLayer.ML.setSessionVal("IdxCellaLineaST_OUT", value); } } /// diff --git a/GMW/WebUserControls/mod_lavMeccIN.ascx b/GMW/WebUserControls/mod_lavMeccIN.ascx index c6f9e15d..52cb9afb 100644 --- a/GMW/WebUserControls/mod_lavMeccIN.ascx +++ b/GMW/WebUserControls/mod_lavMeccIN.ascx @@ -1 +1,153 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_lavMeccIN.ascx.cs" Inherits="GMW.WebUserControls.mod_lavMeccIN" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> +<%@ Register Src="mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc1" %> +<% if (false) + { %> + +<% } %> + + +
+
+
+
+ +
+ + +
+
+ +
+   +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+ + + + + + +
+
+
+ +
+
+ +   + +
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + <%-- + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
diff --git a/GMW/WebUserControls/mod_lavMeccIN.ascx.cs b/GMW/WebUserControls/mod_lavMeccIN.ascx.cs index a76ea3f5..efdc4bba 100644 --- a/GMW/WebUserControls/mod_lavMeccIN.ascx.cs +++ b/GMW/WebUserControls/mod_lavMeccIN.ascx.cs @@ -4,14 +4,679 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using System.Net; +using SteamWare; +using GMW_data; namespace GMW.WebUserControls { public partial class mod_lavMeccIN : System.Web.UI.UserControl { + public event EventHandler eh_nuovaRicerca; + /// + /// 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(); + calcolaPostazione(); + traduciObj(); + storicoVisibile = false; + fixStorico(); + // imposto pos abilitata x cancellazione + mod_storicoAzioniOperatore1.idxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneFiniti"); + // se c'è imposto linea da sessione + if (currCodLinea != "") + { + checkSelDDL(currCodLinea, false); + } + } + doChecks(); + mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); + } + /// + /// 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 + /// + /// + /// + void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) + { + MagClass.magazzino.stampaUdc(udcReq, postazione_printer, tipoCartellino.cartFiniti, Request.UserHostName); + // 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; + } + catch + { + logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Finito LM IN {0}", udcReq), tipoLog.EXCEPTION); + } + 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() + { + // labels + lblPostazione.Text = string.Format("{2}: {0} ({1})", postazione_name, postazione_IP, traduci("postazione")); + lblPrinter.Text = string.Format("{1}: {0}", postazione_printer, traduci("stampante")); + lblCurrentPage.Text = traduci(PagCorrente); + btnCerca.Text = traduci("btnSearch"); + // fix storico + fixStorico(); + } + /// + /// 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 + { } + // mostro warning se postazione non configurata... + lblWarning.Visible = (postazione_printer == "n.d."); + } + /// + /// 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 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.confReadString("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 != "") + { + lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + case tipoCodiceBarcode.Comando: + // verifico se il comando sia di tipo "seleziona linea" + string cmdSelLine = memLayer.ML.confReadString("cmdSelLine"); + pnlAll.CssClass = "stileComandoOk"; + if (barcodeIn.StartsWith(cmdSelLine)) + { + // allora provo ad impostare la linea! + checkSelDDL(barcodeIn.Replace(cmdSelLine, ""), true); + } + break; + case tipoCodiceBarcode.UDC: + // se linea non selezionata ERRORE!!! + if (ddlLinea.SelectedValue == "W2000") // HARD CODED + { + lblMessaggi.Text += " - Attenzione, IMPOSTARE LINEA!"; + pnlAll.CssClass = "stileComandoKo"; + } + else + { + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // 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.confReadInt("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 == idxCella) + { + lblMessaggi.Text += " - Attenzione, UDC già caricato!"; + pnlAll.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, idxCella, 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 Trattati su linea {2}, qta: {0} {1} ", qta, noteTrim, currCodLinea)); + pnlAll.CssClass = "stileComandoOk"; + } + } + else + { + // udc NON corretto, mostro errore... + lblMessaggi.Text += " - Attenzione, UDC NON VALIDO!"; + pnlAll.CssClass = "stileComandoKo"; + } + } + } + break; + default: + lblMessaggi.Text += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + lblMessaggi.Text = "...attesa barcode..."; + } + doUpdate(); + } + /// + /// aggiorna tabella + focus a barcode + /// + private void doUpdate() + { + grView.DataBind(); + mod_storicoAzioniOperatore1.doUpdate(); + txtBarcode.Focus(); + } + /// + /// 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; + } + /// + /// effettua reset dati + /// + private void doResetData() + { + // resetto i dati QtaTot e particolare... + doChecks(); + } + /// + /// toggle controllo storico + /// + private void fixStorico() + { + pnlSAO.Visible = storicoVisibile; + if (storicoVisibile) + { + btnShowHideStorico.Text = traduci("btnHideStorico"); + } + else + { + btnShowHideStorico.Text = traduci("btnShowStorico"); + } + } + /// + /// imposto visibilità pannelo storico + /// + protected bool storicoVisibile + { + get + { + return memLayer.ML.BoolSessionObj(string.Format("showHist_{0}", this.ID)); + } + set + { + memLayer.ML.setSessionVal(string.Format("showHist_{0}", this.ID), value); + } + } + /// + /// gestisco evento show/hide storico + /// + /// + /// + protected void btnShowHideStorico_Click(object sender, EventArgs e) + { + storicoVisibile = !storicoVisibile; + fixStorico(); + } + /// + /// passo alla modalità OUT + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.Redirect("LavorMeccOUT.aspx"); + } + /// + /// selezione di una linea da elenco DropDownList + /// + /// + /// + protected void ddlLinea_SelectedIndexChanged(object sender, EventArgs e) + { + checkSelDDL(ddlLinea.SelectedValue, true); + } + /// + /// tenta di selezionare la linea indicata + /// + /// + private void checkSelDDL(string codLinea, bool doSave) + { + //...aggiorno ddl + try + { + ddlLinea.SelectedValue = codLinea; + pnlAll.CssClass = "stileAttesa"; + } + catch + { + // mostro errore + lblMessaggi.Text = string.Format("Errore selezione linea: codice {0} non trovato!", codLinea); + pnlAll.CssClass = "stileComandoKo"; + } + if (doSave) + { + currCodLinea = codLinea; + } + // salvo codice cella! + try + { + codCella = MagClass.magazzino.taAL.getByKey(currCodLinea)[0].CodCella; + idxCella = MagClass.magazzino.taCelle.getByCodCella(codCella)[0].IdxCella; + } + catch + { + codCella = ""; + idxCella = 0; + } + doUpdate(); + } + /// + /// CODICE cella associata alla linea corrente + /// + protected string codCella + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject("codCella")) + { + answ = memLayer.ML.StringSessionObj("codCella"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("codCella", value); + } + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + 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); + } + } + /// + /// codice della linea corrente + /// + protected string currCodLinea + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject(string.Format("LineaIn-{0}", uid))) + { + answ = memLayer.ML.StringSessionObj(string.Format("LineaIn-{0}", uid)); + } + return answ; + } + set + { + memLayer.ML.setSessionVal(string.Format("LineaIn-{0}", uid), value); + } + } + /// + /// 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("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_lavMeccIN.ascx.designer.cs b/GMW/WebUserControls/mod_lavMeccIN.ascx.designer.cs index 2613116a..c4578e46 100644 --- a/GMW/WebUserControls/mod_lavMeccIN.ascx.designer.cs +++ b/GMW/WebUserControls/mod_lavMeccIN.ascx.designer.cs @@ -3,15 +3,238 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace GMW.WebUserControls -{ - - - public partial class mod_lavMeccIN - { +namespace GMW.WebUserControls { + + + public partial class mod_lavMeccIN { + + /// + /// pnlAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAll; + + /// + /// lblPostazione control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPostazione; + + /// + /// btnRefresh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefresh; + + /// + /// btnShowHideStorico control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnShowHideStorico; + + /// + /// lblPrinter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPrinter; + + /// + /// lblCurrentPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCurrentPage; + + /// + /// hlMenu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink hlMenu; + + /// + /// pnlSAO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlSAO; + + /// + /// mod_storicoAzioniOperatore1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_storicoAzioniOperatore mod_storicoAzioniOperatore1; + + /// + /// btnIn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnIn; + + /// + /// btnOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnOut; + + /// + /// ddlLinea control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlLinea; + + /// + /// odsLinea control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsLinea; + + /// + /// lblParticolareAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblParticolareAttivo; + + /// + /// lblDescrAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescrAttivo; + + /// + /// lblDisegno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDisegno; + + /// + /// lblMessaggi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessaggi; + + /// + /// lblWarning control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarning; + + /// + /// txtCerca control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCerca; + + /// + /// btnCerca control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCerca; + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + + /// + /// lblNumRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumRec; + + /// + /// lblBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBarcode; + + /// + /// txtBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBarcode; } } diff --git a/GMW/WebUserControls/mod_lavMeccOUT.ascx b/GMW/WebUserControls/mod_lavMeccOUT.ascx index 5938f187..a67da90a 100644 --- a/GMW/WebUserControls/mod_lavMeccOUT.ascx +++ b/GMW/WebUserControls/mod_lavMeccOUT.ascx @@ -1 +1,185 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_lavMeccOUT.ascx.cs" Inherits="GMW.WebUserControls.mod_lavMeccOUT" %> +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> +<%@ Register Src="mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc1" %> +<% if (false) + { %> + +<% } %> + + +
+
+
+
+ +
+ + +
+
+ +
+   +
+
+ +
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+ +
+ + + + + + +
+
+
+ +
+
+ +   + +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + <%-- + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P | C + <%----%> + + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ + +
+
+ +
+ +
+
+ +
+
+
+
+
diff --git a/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs b/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs index 2e51f15b..32ff530f 100644 --- a/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs +++ b/GMW/WebUserControls/mod_lavMeccOUT.ascx.cs @@ -4,14 +4,1117 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; namespace GMW.WebUserControls { public partial class mod_lavMeccOUT : System.Web.UI.UserControl { + /// + /// flusso associato (hard coded) a FUSI + /// + protected string flusso = "LM"; + /// + /// stato associato (hard coded) a FUSI + /// + protected string statoUDC = "Fin"; + /// + /// tipo di evento associato alla creazione dell'UDC + /// + protected string eventoUDC = "UDC_FINITO"; + /// + /// stringa degli UDC selezionati per consumo COMPLETO (nel formato #UDC1##UDC2#) + /// + protected string udcSelC + { + get + { + return memLayer.ML.StringSessionObj(string.Format("UdcSelC_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("UdcSelC_{0}", uid), value); + } + } + /// + /// stringa degli UDC selezionati per consumo PARZIALE (nel formato #UDC1##UDC2#) + /// + protected string udcSelP + { + get + { + return memLayer.ML.StringSessionObj(string.Format("UdcSelP_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("UdcSelP_{0}", uid), value); + } + } + public event EventHandler eh_nuovaRicerca; + /// + /// 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(); + calcolaPostazione(); + traduciObj(); + storicoVisibile = false; + fixStorico(); + // imposto pos abilitata x cancellazione + mod_storicoAzioniOperatore1.idxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneFiniti"); + // se c'è imposto linea da sessione + if (currCodLinea != "") + { + checkSelDDL(currCodLinea, false); + MagClass.magazzino.taAL.updatePost(currCodLinea, postazione_name); + } + else + { + // resetto uso postazione... + MagClass.magazzino.taAL.resetPost(postazione_name); + } + } + doChecks(); + mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); + } + /// + /// verifica se si debba mostrare un campo ricerca attivo... + /// + private void fixRicercaUdc() + { + if (memLayer.ML.isInSessionObject("valoreCercatoSTO")) + { + testoRicerca = memLayer.ML.StringSessionObj("valoreCercatoSTO"); + } + + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) + { + MagClass.magazzino.stampaUdc(udcReq, postazione_printer, tipoCartellino.cartSterr, Request.UserHostName); + // 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; + } + catch + { + logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Sterratura OUT {0}", udcReq), tipoLog.EXCEPTION); + } + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, postazione_name, postazione_IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Sterratura OUT"); + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// controlla particolare selezionato + /// + private void checkParticolare() + { + if (currParticolare != "") + { + lblParticolareAttivo.Text = string.Format("Particolare selezionato {0}", currParticolare); + // aggiungo descrizione del particolare + string descr = ""; + string disegno = ""; + try + { + DS_magazzino.AnagParticolariRow riga = MagClass.magazzino.taAnagPart.likeSearch(currParticolare, memLayer.ML.StringSessionObj("CodCS"))[0]; + descr = riga.DescParticolare; + disegno = string.Format("( {0} )", riga.DisegnoGrezzo); + } + catch + { } + lblDescrAttivo.Text = descr; + lblDisegno.Text = disegno; + } + else + { + lblParticolareAttivo.Text = "..."; + lblDescrAttivo.Text = ""; + lblDisegno.Text = ""; + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkStampa(); + checkParticolare(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + // labels + lblPostazione.Text = string.Format("{2}: {0} ({1})", postazione_name, postazione_IP, traduci("postazione")); + lblPrinter.Text = string.Format("{1}: {0}", postazione_printer, traduci("stampante")); + lblQta.Text = traduci("lblQuantitaTotale"); + lblNote.Text = traduci("lblNote"); + lblCurrentPage.Text = traduci(PagCorrente); + btnCerca.Text = traduci("btnSearch"); + //txtBox + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + // buttons + btnStampa.Text = traduci("btnStampa"); + btnEmptyNote.Text = traduci("btnEmptyNote"); + // fix storico + fixStorico(); + } + /// + /// 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 + { } + // mostro warning se postazione non configurata... + lblWarning.Visible = (postazione_printer == "n.d."); + } + /// + /// 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 il codice articolo correntemente selezionato + /// + protected string currParticolare + { + get + { + return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// num pezzi dell'ultimo UDC del particolare generato + /// + public int pezziUdc + { + get + { + int answ = 0; + try + { + answ = (int)MagClass.magazzino.taCartellini.getLastByParticolareStato(memLayer.ML.StringSessionObj("CodCS"), currParticolare, statoUDC)[0].Qta; + } + catch + { } + return answ; + } + } + /// + /// 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.confReadString("prefComandi"); + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare)) // è 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; + } + } + /// + /// qta pezzi TOTALE + /// + public int qta + { + get + { + int qta = 0; + try + { + qta = Convert.ToInt32(txtQta.Text.Trim()); + } + catch + { } + return qta; + } + set + { + txtQta.Text = value.ToString(); + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + case tipoCodiceBarcode.Comando: + // verifico se il comando sia di tipo "seleziona linea" + string cmdSelLine = memLayer.ML.confReadString("cmdSelLine"); + pnlAll.CssClass = "stileComandoOk"; + if (barcodeIn.StartsWith(cmdSelLine)) + { + // allora provo ad impostare la linea! + checkSelDDL(barcodeIn.Replace(cmdSelLine, ""), true); + } + break; + case tipoCodiceBarcode.Particolare: + // imposto il particolare corrente + currParticolare = barcodeIn; + impostaParticolare(); + break; + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + // calcolo nuovo particolare + string newPart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; + if (testoRicerca != newPart) + { + // resetto precedente ricerca e deseleziono TUTTI gli UDC elencati SE è cambiato il particolare + udcSelC = string.Format("#{0}#", barcodeIn); + } + else + { + udcSelC = string.Format("{0}#{1}#", udcSelC, barcodeIn); + // se era presente in elenco "P" lo elimino + udcSelP = udcSelP.Replace(string.Format("#{0}#", barcodeIn), ""); + } + updFiltroPart(newPart); + // imposto particolare! + currParticolare = newPart; + impostaParticolare(); + } + + break; + default: + lblMessaggi.Text += " - codice non riconosciuto!"; + pnlAll.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + lblMessaggi.Text = "...attesa barcode..."; + } + //grView.DataBind(); + txtBarcode.Focus(); + } + /// + /// imposto i dati dal aprticolare corrente + /// + private void impostaParticolare() + { + // controllo esista il particolare scansionato + if (DataProxy.obj.taAnagParticolari.getByParticolare(currParticolare).Rows.Count == 0) + { + currParticolare = ""; + lblMessaggi.Text += " - codice particolare non valido / non trovato in RILPRO."; + pnlAll.CssClass = "stileComandoKo"; + } + else + { + lblMessaggi.Text += " - impostato particolare!"; + pnlAll.CssClass = "stileComandoOk"; + } + // leggo la qta dell'ultimo UDC del particolare, SE C'E', e la imposto... + if (pezziUdc > 0) + { + txtQta.Text = pezziUdc.ToString(); + } + else // rimette default + { + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + } + } + /// + /// update del filtro su particolare x grview UDC caricati in linea + /// + /// + private void updFiltroPart(string newPart) + { + if (testoRicerca != newPart) + { + // imposto filtraggio x particoalre nell'elenco degli UDC della linea... + testoRicerca = newPart; + // salvo UDC da selezionare come consumo COMPLETO + salvaCerca(); + } + else + { + doUpdate(); + } + } + /// + /// aggiorna tabella + focus a barcode + /// + private void doUpdate() + { + checkStampa(); + grView.DataBind(); + mod_storicoAzioniOperatore1.doUpdate(); + txtBarcode.Focus(); + } + /// + /// controllo l'abilitazioen alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - almeno 1 trattamento + /// altrimenti disabilito btn stampa + /// + private void checkStampa() + { + bool stampaOk = false; + //controllo siano inseriti valori qta + if (qta > 0) + { + // controllo ci siano particolare e ci sia selezionato almeno un UDC + if (currParticolare != "" && ((udcSelC.Replace("#", "").Length > 1) || (udcSelP.Replace("#", "").Length > 1))) + { + stampaOk = true; + } + } + btnStampa.Enabled = stampaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnStampa_Click(object sender, EventArgs e) + { + + // calcolo postazione + calcolaPostazione(); + // verifico postazione x procedere... + if (postazione_printer != "n.d.") + { + string newUdcChild = ""; + int qta = memLayer.ML.confReadInt("QtaImballoSterr"); + string noteTrim = txtNote.Text.Trim(); + try + { + qta = Convert.ToInt32(txtQta.Text); + } + catch + { } + // effettuo controlli che cod_soggetto e cod particolare siano disponibili... + string codSogg = ""; + string particolare = ""; + try + { + codSogg = MagClass.magazzino.CodSoggCurrUser; + particolare = currParticolare; + } + catch + { + } + if (codSogg != "" && particolare != "") + { + // genero cartellino + DateTime adesso = DateTime.Now; + string[] stringSeparators = new string[] { "#" }; + try + { + // creo nuovo UDC sterrato OUT multiple + newUdcChild = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoSterr"), "U", MagClass.magazzino.CodSoggCurrUser, qta, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneSterrati"), "IdxPosizioneSterrati", eventoUDC, noteTrim, "", adesso.Year, Request.UserHostName); + // registro creazione nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, postazione_name, postazione_IP, newUdcChild, particolare, "creaUDC", string.Format("Creato nuovo UDC Sterrato, qta: {0} {1}", qta, noteTrim)); + } + catch (Exception exc) + { + httpLog(string.Format("Errore creazione UDC Sterrato: {0}", exc), tipoLog.EXCEPTION); + } + // devo gestire associazione e consumo cartellini FUSI + if (newUdcChild != "") + { + string[] UDC_P; + // ASSOCIO tutti gli UDC consumati sia Parziali che Completi al nuovo UDC + if (udcSelP.Replace("#", "").Length > 1) + { + // associo + UDC_P = udcSelP.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); + //UDC_P = SteamWare.StringSplitter.CSplitter.Split(udcSelP, "#", false, 0, SteamWare.StringSplitter.ComparisonMethod.Text); + associaUdc(newUdcChild, UDC_P); + } + if (udcSelC.Replace("#", "").Length > 1) + { + // associo + UDC_P = udcSelC.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); + //UDC_P = SteamWare.StringSplitter.CSplitter.Split(udcSelC, "#", false, 0, SteamWare.StringSplitter.ComparisonMethod.Text); + associaUdc(newUdcChild, UDC_P); + // consumo gli UDC indicati come "C" + consumaUdc(UDC_P); + } + + // ora stampo il nuovo cartellino!!! + MagClass.magazzino.stampaUdc(newUdcChild, postazione_printer, tipoCartellino.cartSterr, Request.UserHostName); + // incremento timing... + adesso = DateTime.Now; + adesso = adesso.AddSeconds(2); + // registro stampa nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, postazione_name, postazione_IP, newUdcChild, particolare, "stampaUDC", "Stampato UDC Sterrato"); + } + // resetto + doResetData(); + } + else + { + httpLog(string.Format("STERRATI OUT, Errore persi utente/particolare, ricarico!"), tipoLog.ERROR); + Response.Redirect("~/login.aspx"); + } + mod_storicoAzioniOperatore1.doUpdate(); + } + else + { + Response.Redirect("~/menu.aspx"); + } + doRefreshBloccoPost(); + } + /// + /// effettua il consumo di tutti gli UDC inviati come array di stringhe + /// + /// + private void consumaUdc(string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + // se è consumabile (idxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(udc_p)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(udc_p, Request.UserHostName); + // sposta UDC da posizione corrente a nessuna... + } + } + } + } + } + /// + ///associa nuovo UDC ad elenco UDC + /// + /// UDC da associare come child + /// vettorei di UDC da associare come parent + private void associaUdc(string newUdcChild, string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + MagClass.magazzino.associaUdcParent(newUdcChild, udc_p); + } + } + } + } + /// + /// 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; + } + /// + /// effettua reset dati + /// + private void doResetData() + { + // resetto i dati QtaTot e particolare... + qta = 0; + currParticolare = ""; + txtQta.Text = ""; + testoRicerca = ""; + salvaCerca(); + doChecks(); + } + /// + /// svuoto le note + /// + /// + /// + protected void btnEmptyNote_Click(object sender, EventArgs e) + { + txtNote.Text = ""; + } + /// + /// toggle controllo storico + /// + private void fixStorico() + { + pnlSAO.Visible = storicoVisibile; + if (storicoVisibile) + { + btnShowHideStorico.Text = traduci("btnHideStorico"); + } + else + { + btnShowHideStorico.Text = traduci("btnShowStorico"); + } + } + /// + /// imposto visibilità pannelo storico + /// + protected bool storicoVisibile + { + get + { + return memLayer.ML.BoolSessionObj(string.Format("showHist_{0}", this.ID)); + } + set + { + memLayer.ML.setSessionVal(string.Format("showHist_{0}", this.ID), value); + } + } + /// + /// gestisco evento show/hide storico + /// + /// + /// + protected void btnShowHideStorico_Click(object sender, EventArgs e) + { + storicoVisibile = !storicoVisibile; + fixStorico(); + } + /// + /// passo alla modalità IN + /// + /// + /// + protected void btnIn_Click(object sender, EventArgs e) + { + Response.Redirect("SterrTaglioIN.aspx"); + } + + /// + /// selezione di una linea da elenco DropDownList + /// + /// + /// + protected void ddlLinea_SelectedIndexChanged(object sender, EventArgs e) + { + checkSelDDL(ddlLinea.SelectedValue, true); + } + /// + /// tenta di selezionare la linea indicata + /// + /// + private void checkSelDDL(string codLinea, bool doSave) + { + /******************************************************* + * controllo se la linea sia libera .. OVVERO: + * - nessuna postazione la occupa + * - è bloccata da + di "minutiBloccoLinea" (e quindi sovrascrivo) + * + *******************************************************/ + bool lineaLibera = false; + try + { + DS_magazzino.AnagLineeRow riga = MagClass.magazzino.taAL.getByKey(codLinea)[0]; + if (riga.codPostazione == "" || riga.codPostazione == postazione_name) + { + lineaLibera = true; + } + else + { + // controllo se è bloccata da tempo > minutiBloccoLinea --> ignoro blocco! + if (DateTime.Now >= riga.dtAccess.AddMinutes(memLayer.ML.confReadInt("minutiBloccoLinea"))) + { + lineaLibera = true; + } + } + } + catch + { } + if (lineaLibera) + { + //...aggiorno ddl + try + { + ddlLinea.SelectedValue = codLinea; + pnlAll.CssClass = "stileAttesa"; + } + catch + { + // mostro errore + lblMessaggi.Text = string.Format("Errore selezione linea: codice {0} non trovato!", codLinea); + pnlAll.CssClass = "stileComandoKo"; + } + if (doSave) + { + refreshBloccoPost(codLinea); + // continuo + currCodLinea = codLinea; + testoRicerca = ""; + grView.DataBind(); + salvaCerca(); + } + // salvo codice cella! + try + { + codCella = MagClass.magazzino.taAL.getByKey(currCodLinea)[0].CodCella; + idxCella = MagClass.magazzino.taCelle.getByCodCella(codCella)[0].IdxCella; + } + catch + { + codCella = ""; + idxCella = 0; + } + doUpdate(); + } + else + { + codCella = ""; + idxCella = 0; + MagClass.magazzino.taAL.resetPost(postazione_name); + // mostro errore + lblMessaggi.Text = string.Format("Errore: linea {0} già impegnata, sbloccare postazione o attendere timeout!", codLinea); + pnlAll.CssClass = "stileComandoKo"; + ddlLinea.DataBind(); + ddlLinea.SelectedIndex = 0; + } + } + /// + /// effettua refresh (su db) del blocco postazione + /// + /// + private void refreshBloccoPost(string codLinea) + { + // resetto usi linee precedenti.. + MagClass.magazzino.taAL.resetPost(postazione_name); + // se la linea non è "base" = "Sel linea", finisce x "0" + if (codLinea.Substring(codLinea.Length - 1) != "0") + { + // salvo su DB che sto occupando linea... + MagClass.magazzino.taAL.updatePost(codLinea, postazione_name); + } + // ricarico elenco postazioni... + ddlLinea.DataBind(); + } + /// + /// CODICE cella associata alla linea corrente + /// + protected string codCella + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject("codCella")) + { + answ = memLayer.ML.StringSessionObj("codCella"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("codCella", value); + } + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + get + { + int answ = 0; + if (memLayer.ML.isInSessionObject("IdxCellaLineaST_OUT")) + { + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_OUT"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaST_OUT", value); + } + } + /// + /// codice della linea corrente + /// + protected string currCodLinea + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject(string.Format("LineaOut-{0}", uid))) + { + answ = memLayer.ML.StringSessionObj(string.Format("LineaOut-{0}", uid)); + } + return answ; + } + set + { + memLayer.ML.setSessionVal(string.Format("LineaOut-{0}", uid), value); + } + } + /// + /// cambiato valore in ricerca + /// + /// + /// + protected void txtCerca_TextChanged(object sender, EventArgs e) + { + // se è nuovo il testo resetto + if (testoRicerca != SteamWare.memLayer.ML.StringSessionObj("valoreCercatoSTO")) + { + udcSelC = ""; + udcSelP = ""; + } + 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("valoreCercatoSTO"); + udcSelC = ""; + udcSelP = ""; + } + else + { + SteamWare.memLayer.ML.setSessionVal("valoreCercatoSTO", 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 = ""; + } + } + + protected void rbl_DataBinding(object sender, EventArgs e) + { + RadioButtonList rbl = (RadioButtonList)sender; + if (udcSelC.IndexOf(rbl.ToolTip) >= 0) + { + rbl.SelectedValue = "C"; + } + else if (udcSelP.IndexOf(rbl.ToolTip) >= 0) + { + rbl.SelectedValue = "P"; + } + } + + protected void rbl_DataBound(object sender, EventArgs e) { } + + protected void rbl_SelectedIndexChanged(object sender, EventArgs e) + { + RadioButtonList rbl = (RadioButtonList)sender; + if (rbl.SelectedValue == "C") + { + udcSelC = string.Format("{0}#{1}#", udcSelC, rbl.ToolTip); + // se era presente in elenco "P" lo elimino + udcSelP = udcSelP.Replace(string.Format("#{0}#", rbl.ToolTip), ""); + } + else + { + udcSelP = string.Format("{0}#{1}#", udcSelP, rbl.ToolTip); + // se era presente in elenco "C" lo elimino + udcSelC = udcSelC.Replace(string.Format("#{0}#", rbl.ToolTip), ""); + } + // calcolo il particolare da selezionare... + string newPart = DataProxy.obj.taCartellini.stp_getByUdc(rbl.ToolTip)[0].Particolare; + //testoRicerca = newPart; + updFiltroPart(newPart); + } + /// + /// fa su richiesta un refresh (aggiornando dataOra di blocco x cella/posizione ad esempio) + /// + public void doRefreshBloccoPost() + { + refreshBloccoPost(currCodLinea); + } } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_lavMeccOUT.ascx.designer.cs b/GMW/WebUserControls/mod_lavMeccOUT.ascx.designer.cs index 79420003..342269c4 100644 --- a/GMW/WebUserControls/mod_lavMeccOUT.ascx.designer.cs +++ b/GMW/WebUserControls/mod_lavMeccOUT.ascx.designer.cs @@ -3,15 +3,301 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace GMW.WebUserControls -{ - - - public partial class mod_lavMeccOUT - { +namespace GMW.WebUserControls { + + + public partial class mod_lavMeccOUT { + + /// + /// pnlAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAll; + + /// + /// lblPostazione control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPostazione; + + /// + /// btnRefresh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefresh; + + /// + /// btnShowHideStorico control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnShowHideStorico; + + /// + /// lblPrinter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblPrinter; + + /// + /// lblCurrentPage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCurrentPage; + + /// + /// hlMenu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink hlMenu; + + /// + /// pnlSAO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlSAO; + + /// + /// mod_storicoAzioniOperatore1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_storicoAzioniOperatore mod_storicoAzioniOperatore1; + + /// + /// btnIn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnIn; + + /// + /// btnOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnOut; + + /// + /// ddlLinea control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlLinea; + + /// + /// odsLinea control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsLinea; + + /// + /// lblParticolareAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblParticolareAttivo; + + /// + /// lblDescrAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescrAttivo; + + /// + /// lblDisegno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDisegno; + + /// + /// lblMessaggi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessaggi; + + /// + /// lblWarning control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarning; + + /// + /// txtCerca control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCerca; + + /// + /// btnCerca control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCerca; + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + + /// + /// lblNumRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumRec; + + /// + /// lblQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblQta; + + /// + /// txtQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtQta; + + /// + /// btnStampa control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnStampa; + + /// + /// lblBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBarcode; + + /// + /// txtBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBarcode; + + /// + /// aceParticolare control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.AutoCompleteExtender aceParticolare; + + /// + /// lblNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNote; + + /// + /// txtNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNote; + + /// + /// btnEmptyNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEmptyNote; } } diff --git a/GMW/bin/GMW.dll b/GMW/bin/GMW.dll index 0b1931cb..de90b5f9 100644 Binary files a/GMW/bin/GMW.dll and b/GMW/bin/GMW.dll differ