diff --git a/GMW/GMW.csproj b/GMW/GMW.csproj index d997fe76..834edf97 100644 --- a/GMW/GMW.csproj +++ b/GMW/GMW.csproj @@ -462,6 +462,7 @@ + @@ -489,6 +490,7 @@ + @@ -872,6 +874,13 @@ POST_PRE_TT_DT.aspx + + Post_SterrTaglio.aspx + ASPXCodeBehind + + + Post_SterrTaglio.aspx + sanpos_associaz_F10_F18.aspx @@ -1734,6 +1743,13 @@ mod_SterrTagIN.ascx + + mod_sterrTaglio.ascx + ASPXCodeBehind + + + mod_sterrTaglio.ascx + mod_SterrTagOUT.ascx ASPXCodeBehind diff --git a/GMW/Post_SterrTaglio.aspx b/GMW/Post_SterrTaglio.aspx new file mode 100644 index 00000000..5a6ac8a2 --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx @@ -0,0 +1,40 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/FullPage.master" AutoEventWireup="true" CodeBehind="Post_SterrTaglio.aspx.cs" Inherits="GMW.Post_SterrTaglio" %> + +<%@ Register Src="WebUserControls/mod_selLineaNtDt.ascx" TagName="mod_selLineaNtDt" TagPrefix="uc1" %> +<%@ Register Src="WebUserControls/mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc2" %> +<%@ Register Src="WebUserControls/mod_sterrTaglio.ascx" TagPrefix="uc3" TagName="mod_sterrTaglio" %> + + + + + + + + + +
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
diff --git a/GMW/Post_SterrTaglio.aspx.cs b/GMW/Post_SterrTaglio.aspx.cs new file mode 100644 index 00000000..987059ca --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW +{ + public partial class Post_SterrTaglio : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + updatePrinterPostazione(); + // fix css... + Postazione.CssClass = "stileAttesa"; + // imposto pos abilitata x cancellazione + mod_storicoAzioniOperatore1.IdxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneSterrati"); + // pulisco dir temp dai file dei cartellini stampati + reportPrinter.obj.pulisciDir(); + } + // update vari... + doUpdate(); + mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); +#if false + mod_SterrTagOUT1.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; +#endif + mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh; + mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico; + } + /// + /// Handles the showHideStorico event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_showHideStorico(object sender, EventArgs e) + { + fixStorico(); + } + /// + /// Handles the doRefresh event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); +#if false + mod_SterrTagOUT1.doResetData(); + mod_SterrTagOUT1.doUpdate(); +#endif + } + /// + /// richiesta update del controllo SAO + /// + /// + /// + void mod_PostRX_NT1_eh_reqUpdate(object sender, EventArgs e) + { + doUpdate(); + } + /// + /// aggiorna messaggi e css + /// + private void updateMessCss() + { + lblWarning.Text = Postazione.warningText; + lblMessaggi.Text = Postazione.messaggiText; + pnlAll.CssClass = Postazione.CssClass; + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) + { +#if false + mod_SterrTagOUT1.ristampa(); +#endif + } + /// + /// sistemo visualizzazione pannelli + /// + private void fixPanels() + { + // default: moduli NON visibili SE non ho linea indicata.. + bool enableBtn = false; + if (Postazione.currCodCella != "") enableBtn = true; +#if false + mod_SterrTagOUT1.Visible = enableBtn; +#endif + fixStorico(); + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// toggle controllo storico + /// + private void fixStorico() + { + pnlSAO.Visible = Postazione.showStorico; + } + /// + /// update generale controlli + /// + private void doUpdate() + { + updateMessCss(); + fixPanels(); + mod_storicoAzioniOperatore1.doUpdate(); + } + /// + /// calcola postazione corrente (ip, name, printer) + /// + private void updatePrinterPostazione() + { + Postazione.IP = Request.UserHostName; + Postazione.setupPrinter(); + // mostro warning se postazione non configurata... + if (Postazione.printer == "n.d.") + { + lblWarning.Text = traduci("lblWarnPostNonConf"); + } + } + } +} \ No newline at end of file diff --git a/GMW/Post_SterrTaglio.aspx.designer.cs b/GMW/Post_SterrTaglio.aspx.designer.cs new file mode 100644 index 00000000..7fe027d0 --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW { + + + public partial class Post_SterrTaglio { + + /// + /// mod_selLineaNtDt1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_selLineaNtDt mod_selLineaNtDt1; + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + + /// + /// mod_sterrTaglio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_sterrTaglio mod_sterrTaglio; + } +} diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx b/GMW/WebUserControls/mod_sterrTaglio.ascx new file mode 100644 index 00000000..fd7b7d12 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx @@ -0,0 +1,152 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_sterrTaglio.ascx.cs" Inherits="GMW.WebUserControls.mod_sterrTaglio" %> + +<% if (false) + { %> + + +<% } %> + + + +
+
+
+
+ <%: traduci("UDC") %> +
+
+
+
+
+ + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + <%-- + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +   + +
+
+ +
+ + <%----%> +
+
+
+ <%: traduci("Note") %> +
+
+ + +
+
+ <%: traduci("btnStampaUdc") %> +
+
+
+
+
+
+ <%: traduci("Qta") %> +
+
+ +
+
+
+
diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx.cs b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs new file mode 100644 index 00000000..1f9d9ace --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs @@ -0,0 +1,945 @@ +using System; +using System.Collections.Generic; +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_sterrTaglio : System.Web.UI.UserControl + { + /// + /// flusso associato (hard coded) a FUSI + /// + protected string flusso = "ST"; + /// + /// stato associato (hard coded) a FUSI + /// + protected string statoUDC = "Sterr"; + /// + /// tipo di evento associato alla creazione dell'UDC + /// + protected string eventoUDC = "UDC_STTA"; + /// + /// 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; + 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_OUT")) + { + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_OUT"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaST_OUT", value); + } + } + /// + /// 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 + /// + /// + /// + public void ristampa() + { + 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"); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// 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 + btnCerca.Text = traduci("btnSearch"); + //txtBox + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + // buttons + btnEmptyNote.Text = traduci("btnEmptyNote"); + } + /// + /// 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 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 != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { +#if false + case tipoCodiceBarcode.Comando: + // verifico se il comando sia di tipo "seleziona linea" + string cmdSelLine = memLayer.ML.confReadString("cmdSelLine"); + Postazione.CssClass = "stileComandoOk"; + if (barcodeIn.StartsWith(cmdSelLine)) + { + // allora provo ad impostare la linea! + checkSelDDL(barcodeIn.Replace(cmdSelLine, ""), true); + } + break; +#endif + case tipoCodiceBarcode.Particolare: + // 2014.02.13: tolto perché NON si vuole particolare OUT diverso da IN +#if false + // imposto il particolare corrente + currParticolare = barcodeIn; + impostaParticolare(); +#endif + 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: + Postazione.messaggiText += " - codice non riconosciuto!"; + Postazione.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + //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 = ""; + Postazione.messaggiText += " - codice particolare non valido / non trovato in RILPRO."; + Postazione.CssClass = "stileComandoKo"; + } + else + { + Postazione.messaggiText += " - impostato particolare!"; + Postazione.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 + /// + public void doUpdate() + { + idxCella = Postazione.currIdxCella; + checkStampa(); + grView.DataBind(); + txtBarcode.Focus(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// controllo l'abilitazioen alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - udc da consumo totale/parziale + /// 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; + } + } + divNote.Visible = stampaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnStampa_Click(object sender, EventArgs e) + { + string[] stringSeparators = new string[] { "#" }; + // verifico postazione x procedere... + if (Postazione.printer != "n.d.") + { + // controllo UDC in ingresso, che siano tutti con uguale particolare e DIVERSO da "" + string partUdcIn = ""; + try + { + string fullUdc = string.Format("{0}#{1}", udcSelC, udcSelP); + // ciclo tutti gli UDC consumati P e C e verifico loro particolare + if (fullUdc.Replace("#", "").Length > 1) + { + string[] elencoUDC; + elencoUDC = fullUdc.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); + partUdcIn = checkPartUDC(elencoUDC); + } + } + catch + { } + if (partUdcIn != "") + { + // controllo da distinta base coerenza particolare IN/OUT + bool partDistintaOk = false; + try + { + if (MagClass.magazzino.taPartIO.GetData(currParticolare, partUdcIn, true)[0].Trovati > 0) partDistintaOk = true; + } + catch + { } + if (partDistintaOk) + { + string newUdcChild = ""; + int qta = memLayer.ML.confReadInt("QtaImballoSterr"); + string noteTrim = txtNote.Text.Trim(); + noteTrim = string.Format("{0}{1}{2}", Postazione.currNomeLinea, Environment.NewLine, noteTrim); + 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; + 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"); + } + } + else + { + httpLog(string.Format("STERRATI OUT, Errore controllo coerenza particolari da distinta base!"), tipoLog.ERROR); + Postazione.messaggiText += "Errore particolari UDC da controllo distinta base"; + Postazione.CssClass = "stileComandoND"; + } + } + else + { + httpLog(string.Format("STERRATI OUT, Errore controllo coerenza elenco aprticolari IN!"), tipoLog.ERROR); + Postazione.messaggiText += "Errore particolari UDC da consumare non coerenti"; + Postazione.CssClass = "stileComandoND"; + } + } + else + { + Response.Redirect("~/menu.aspx"); + } + doUpdate(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// 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 + /// vettore 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); + } + } + } + } + /// + /// verifica che il vettore di UDC abbia tutto lo stesso particolare e lo restituisce, altrimenti restituisce "" + /// + /// vettore di UDC da verificare + private string checkPartUDC(string[] UDC_P) + { + string answ = ""; + if (UDC_P.Length > 0) + { + // imposto il primo particolare... + answ = MagClass.magazzino.getParticolareByUDC(UDC_P[0]); + // ciclo + foreach (string udc_p in UDC_P) + { + if (MagClass.magazzino.getParticolareByUDC(udc_p) != answ) answ = ""; // se uno è diverso "azzero" + } + } + return answ; + } + /// + /// 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... + qta = 0; + currParticolare = ""; + txtQta.Text = ""; + testoRicerca = ""; + salvaCerca(); + doChecks(); + } + /// + /// svuoto le note + /// + /// + /// + protected void btnEmptyNote_Click(object sender, EventArgs e) + { + txtNote.Text = ""; + } + /// + /// passo alla modalità IN + /// + /// + /// + protected void btnIn_Click(object sender, EventArgs e) + { + Response.Redirect("SterrTaglioIN.aspx"); + } + + /// + /// 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); + } + } + /// + /// 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(); + } + /// + /// 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; + } + } + /// + /// salvo ricerca particolare + /// + 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) + { + + } + + /// + /// selezione UDC da elenco + /// + /// + /// + 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; + updFiltroPart(newPart); + // imposto particolare! + currParticolare = newPart; + checkParticolare(); + impostaParticolare(); + checkStampa(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + + } +} \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs b/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs new file mode 100644 index 00000000..8634ebd8 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW.WebUserControls { + + + public partial class mod_sterrTaglio { + + /// + /// BundleReference1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; + + /// + /// BundleReference2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2; + + /// + /// 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; + + /// + /// 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; + + /// + /// lnkReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lnkReset; + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + + /// + /// divNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNote; + + /// + /// 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; + + /// + /// lbtStampaUDC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtStampaUDC; + + /// + /// 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; + } +} diff --git a/VersGen/GMW.cs b/VersGen/GMW.cs index 570c59f6..c022570c 100644 --- a/VersGen/GMW.cs +++ b/VersGen/GMW.cs @@ -5,7 +5,7 @@ using System.Reflection; -[assembly: AssemblyVersion("2.8.741.1757")] -[assembly: AssemblyFileVersion("2.8.741.1757")] +[assembly: AssemblyVersion("2.8.743.1760")] +[assembly: AssemblyFileVersion("2.8.743.1760")] [assembly: AssemblyCopyright("Steamware © 2007-2014")] [assembly: AssemblyCompany("Steamware")] diff --git a/VersGen/GMW.tt b/VersGen/GMW.tt index 412fcc85..0918abe8 100644 --- a/VersGen/GMW.tt +++ b/VersGen/GMW.tt @@ -6,8 +6,8 @@ using System.Reflection; -[assembly: AssemblyVersion("2.8.741.<#= this.RevisionNumber #>")] -[assembly: AssemblyFileVersion("2.8.741.<#= this.RevisionNumber #>")] +[assembly: AssemblyVersion("2.8.743.<#= this.RevisionNumber #>")] +[assembly: AssemblyFileVersion("2.8.743.<#= this.RevisionNumber #>")] [assembly: AssemblyCopyright("Steamware © 2007-<#= DateTime.Now.Year #>")] [assembly: AssemblyCompany("Steamware")] <#+