diff --git a/GMW-RT/bin/GMW-RT.dll b/GMW-RT/bin/GMW-RT.dll index ac052c17..5d215f43 100644 Binary files a/GMW-RT/bin/GMW-RT.dll and b/GMW-RT/bin/GMW-RT.dll differ diff --git a/GMW-RT/bin/GMW_data.dll b/GMW-RT/bin/GMW_data.dll index b9ec0ede..bf559bd6 100644 Binary files a/GMW-RT/bin/GMW_data.dll and b/GMW-RT/bin/GMW_data.dll differ diff --git a/GMW-UT/bin/GMW-UT.dll b/GMW-UT/bin/GMW-UT.dll index 70100afc..091ec1b5 100644 Binary files a/GMW-UT/bin/GMW-UT.dll and b/GMW-UT/bin/GMW-UT.dll differ diff --git a/GMW-UT/bin/GMW_data.dll b/GMW-UT/bin/GMW_data.dll index b9ec0ede..bf559bd6 100644 Binary files a/GMW-UT/bin/GMW_data.dll and b/GMW-UT/bin/GMW_data.dll differ diff --git a/GMW/Trattamenti.aspx.cs b/GMW/Trattamenti.aspx.cs index aa8f5dbb..6d20288c 100644 --- a/GMW/Trattamenti.aspx.cs +++ b/GMW/Trattamenti.aspx.cs @@ -26,13 +26,35 @@ namespace GMW // update vari... doUpdate(); mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); -#if false - mod_trattamenti1.doUpdate(); -#endif - mod_trattamenti1.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; + mod_trattamenti1.eh_ucev += Mod_trattamenti1_eh_ucev; mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh; mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico; } + + private void Mod_trattamenti1_eh_ucev(object sender, EventArgs e) + { + // se trovo evento select/reset mostro/nascondo dettagli... + ucEvent evento = (ucEvent)e; + switch (evento.tipoEvento) + { + case ucEvType.Delete: + break; + case ucEvType.Edit: + break; + case ucEvType.New: + break; + case ucEvType.Reset: + break; + case ucEvType.ReqUpdateParent: + doUpdate(); + break; + case ucEvType.Selected: + break; + default: + break; + } + } + /// /// Handles the showHideStorico event of the mod_selLineaNtDt1_eh control. /// diff --git a/GMW/WebUserControls/mod_trattamenti.ascx.cs b/GMW/WebUserControls/mod_trattamenti.ascx.cs index 86af20b3..a4e469b5 100644 --- a/GMW/WebUserControls/mod_trattamenti.ascx.cs +++ b/GMW/WebUserControls/mod_trattamenti.ascx.cs @@ -8,121 +8,44 @@ using System.Collections; namespace GMW.WebUserControls { - public partial class mod_trattamenti : System.Web.UI.UserControl + public partial class mod_trattamenti : GMW_data.UserControlBCodeMan { /// - /// flusso associato (hard coded) a Trattati + /// Imposta variabili specifiche classe /// - protected string flusso = "TT"; - /// - /// stato associato (hard coded) a Trattati - /// - protected string statoUDC = "Tratt"; - /// - /// tipo di evento associato alla creazione dell'UDC - /// - protected string eventoUDC = "UDC_TRATT"; - /// - /// stato associato all'UDC precedente (Sterrato) - /// - protected string statoUDC_pre = "Sterr"; - /// - /// attributo per TRATTAMENTO termico - /// - protected string attrNumTra = "NT"; - /// - /// flusso associato (hard coded) al TRATTAMENTO termico - /// - protected string flusso_TR = "TR"; - /// - /// dati x verifica CodSoggetto / matricola - /// - protected string preCodSogg = memLayer.ML.confReadString("prefCodSogg"); - public event EventHandler eh_reqUpdate; - /// - /// stringa UID univoca - /// - public string uid + public override void setupVariabili() { - get - { - return this.UniqueID.Replace("$", "_").Replace("-", "_"); - } + flusso = "TT"; + statoUDC = "Tratt"; + eventoUDC = "UDC_TRATT"; + eventoUDC_qta = "UDC_QTY"; + statoUDC_pre = "Sterr"; + attrNumTra = "NT"; + flusso_TR = "TR"; + tipoUdcLinea = "Trattato"; + IdxPosizioneIn = memLayer.ML.CRI("IdxPosizioneSterrati"); + IdxPosizioneOut = memLayer.ML.CRI("IdxPosizioneTrattati"); + tipoCartCurr = tipoCartellino.cartTratt; } + /// /// caricamento pagina /// /// /// - protected void Page_Load(object sender, EventArgs e) + public override void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { - traduciObj(); resetTrattamenti(); resetUDC(); - checkNumKeyIn(); - } - doChecks(); - } - /// - /// verifico se ci sia in sessione un input da NumKeyb e nel caso lometto in barcodeIn e processo... - /// - private void checkNumKeyIn() - { - if (memLayer.ML.isInSessionObject("numKeyIn")) - { - barcodeIn = memLayer.ML.StringSessionObj("numKeyIn"); - // svuoto valore in sessione... - memLayer.ML.emptySessionVal("numKeyIn"); - // controllo barcode... - checkBarcode(); - } - } - /// - /// richiesta (ri)stampa UDC - /// - /// - /// - public void ristampa() - { - bool fatto = false; - // registro ri-stampa UDC - DateTime adesso = DateTime.Now; - // calcolo particolare... - DS_magazzino.ElencoCartelliniRow rigaUDC; - string particolare = ""; - try - { - rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0]; - particolare = rigaUDC.Particolare; - fatto = MagClass.magazzino.ristampaUdc(udcReq, Postazione.printer, Request.UserHostName); - } - catch - { - logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Trattati {0}", udcReq), tipoLog.EXCEPTION); - } - if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Trattati"); - // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } - } - /// - /// udc da stampare - /// - protected string udcReq - { - get - { - return memLayer.ML.StringSessionObj("udcSelSAO"); } + base.Page_Load(sender, e); } /// /// controlla particolare selezionato /// - private void checkParticolare() + public override void checkParticolare() { if (currParticolare != "") { @@ -149,18 +72,9 @@ namespace GMW.WebUserControls } } /// - /// effettua controlli visibilità - /// - private void doChecks() - { - checkBarcode(); - checkStampa(); - checkParticolare(); - } - /// /// sistemo labels oggetti /// - private void traduciObj() + public override void traduciObj() { // labels lblAnnoTratt.Text = traduci("lblAnnoTratt"); @@ -172,138 +86,9 @@ namespace GMW.WebUserControls 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; - int matricola = -1; - // provo a convertire in intero barcode x verifica eventuale matricola... - try - { - matricola = Convert.ToInt32(barcodeIn); - } - catch - { } - // 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 if (barcodeIn.StartsWith(preCodSogg)) - { - // cerco cod soggetto... - if (DataProxy.obj.taTrascSogg.getByKey(barcodeIn, 0).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - else if (matricola >= 0) - { - if (DataProxy.obj.taTrascSogg.getByKey("", matricola).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Operatore; - } - } - 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 + public override string barcodeIn { get { @@ -317,7 +102,7 @@ namespace GMW.WebUserControls /// /// qta pezzi TOTALE /// - public int qta + public override int qta { get { @@ -338,12 +123,12 @@ namespace GMW.WebUserControls /// /// controlla se ci sia un barcode /// - private void checkBarcode() + public override void checkBarcode() { if (barcodeIn != "") { Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); - switch (tipoBCode) + switch (MagClass.tipoBCode_L3(barcodeIn)) { case tipoCodiceBarcode.Particolare: // 2014.02.13: tolto perché NON si vuole particolare OUT diverso da IN @@ -362,20 +147,15 @@ namespace GMW.WebUserControls // controllo se NON ci siano NC "pending" if (MagClass.magazzino.checkUDC_NC(barcodeIn) != checkUdcNc.HasNc) { - // 2014.05.19: solo posizioni > 0, era ANCHE se consumati, tolto... - //if (Math.Abs(MagClass.magazzino.IdxPosizioneUdc(barcodeIn)) == memLayer.ML.confReadInt("IdxPosizioneSterrati")) - - // 2014.07.16 aggiunto check posizione consumata x particolari TK "con deroga" come BMW - //if(MagClass.magazzino.IdxPosizioneUdc(barcodeIn) == memLayer.ML.confReadInt("IdxPosizioneSterrati")) bool posizOk = false; if (memLayer.ML.confReadString("codPartTrattDeroga").IndexOf(string.Format("#{0}#", DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare)) >= 0) { // controllo se il particolare è in quelli che accettano UDC già consumati - posizOk = (Math.Abs(MagClass.magazzino.IdxPosizioneUdc(barcodeIn)) == memLayer.ML.confReadInt("IdxPosizioneSterrati")); + posizOk = (Math.Abs(MagClass.magazzino.IdxPosizioneUdc(barcodeIn)) == IdxPosizioneIn); } else { - posizOk = MagClass.magazzino.IdxPosizioneUdc(barcodeIn) == memLayer.ML.confReadInt("IdxPosizioneSterrati"); + posizOk = MagClass.magazzino.IdxPosizioneUdc(barcodeIn) == IdxPosizioneIn; } // posizione corretta if (posizOk) @@ -472,44 +252,19 @@ namespace GMW.WebUserControls } barcodeIn = ""; } -#if false - else - { - Postazione.messaggiText = traduci("AttesaBCode"); - Postazione.CssClass = "stileAttesa"; - } -#endif //grView.DataBind(); txtBarcode.Focus(); } - /// - /// imposto numero pezzi - /// - private void fixNumPezzi() - { - // 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("QtaImballoTratt"); - } - } /// /// aggiorna tabella + focus a barcode /// - public void doUpdate() + public override void doUpdate() { - checkStampa(); + base.doUpdate(); txtBarcode.Focus(); // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } + raiseEvent(ucEvType.ReqUpdateParent); } /// /// controllo l'abilitazione alla stampa UDC: @@ -518,7 +273,7 @@ namespace GMW.WebUserControls /// - almeno 1 trattamento /// altrimenti disabilito btn stampa /// - private void checkStampa() + public override void checkStampa() { bool stampaOk = false; //controllo siano inseriti valori qta @@ -540,7 +295,7 @@ namespace GMW.WebUserControls /// /// The source of the event. /// The instance containing the event data. - protected void btnStampa_Click(object sender, EventArgs e) + public override void btnStampa_Click(object sender, EventArgs e) { bool needsRedirect = false; string[] stringSeparators = new string[] { "#" }; @@ -604,7 +359,7 @@ namespace GMW.WebUserControls try { // creo nuovo UDC trattati - newUdcChild = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoTratt"), "U", MagClass.magazzino.CodSoggCurrUser, qta, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneTrattati"), "IdxPosizioneTrattati", eventoUDC, noteTrim, "", adesso.Year, Request.UserHostName); + newUdcChild = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoTratt"), "U", MagClass.magazzino.CodSoggCurrUser, qta, 0, 0, adesso, 0, statoUDC, IdxPosizioneOut, "IdxPosizioneTrattati", eventoUDC, noteTrim, "", adesso.Year, Request.UserHostName); if (OpAuth.isAuth) { @@ -640,39 +395,6 @@ namespace GMW.WebUserControls // creo UDC dei trattamenti termici foreach (KeyValuePair kvp in elencoTrattamenti) { - // versione vecchia con creazione UDC di trattamento e relazione... -#if false - - // verifico se ci sia già UDC - UdcExists = MagClass.magazzino.checkUDC(newUdcParent); - if (!UdcExists) - { - try - { - // creo UDC - MagClass.magazzino.creaUdc(flusso_TR, "", currParticolare, "", "", "", "", "", 0, "", "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, DateTime.Now, 0, "Trattamenti", memLayer.ML.confReadInt("IdxPosizioneTrattamenti"), "IdxPosizioneTrattamenti", eventoUDC_TR, flusso, newUdcParent, anno, Request.UserHostName); - } - catch (Exception exc) - { - httpLog(string.Format("Errore creazione cartellino trattamenti: {0}", exc), tipoLog.EXCEPTION); - } - } - // associo tratt termici e liquidi - MagClass.magazzino.associaUdcParent(newUdcChild, newUdcParent); - if (!UdcExists) - { - // consumo UDC tratt termici - MagClass.magazzino.scaricaUdcMpWip(newUdcParent, Request.UserHostName); - } - // reset valori - newUdcParent = ""; - UdcExists = false; -#endif - // vecchia versione con calcolo num trattamento "tipo UDC" -#if false - // calcolo il nuovo codice UDC del trattamento - newUdcParent = MagClass.magazzino.getComposizioneUDC(memLayer.ML.confReadString("CodCS"), flusso_TR, anno.ToString(), Convert.ToInt32(kvp.Key)); -#endif // nuova versione codice trattamento (anno-numero) codTratt = MagClass.magazzino.getCompTrattamenti(txtAnno.Text, kvp.Key); // inserisco attributo trattamento @@ -733,53 +455,13 @@ namespace GMW.WebUserControls Response.Redirect("~/menu.aspx"); } // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } + raiseEvent(ucEvType.ReqUpdateParent); if (needsRedirect) { Response.Redirect(user_std.pagCorrente); } } /// - /// effettua il consumo dell'UDC inviati come array di stringhe - /// - /// - private void consumaUdc(string UDC) - { - // se UDC è NON vuoto ed esiste - if (UDC != "" && MagClass.magazzino.checkUDC(UDC)) - { - // se è consumabile (IdxPosizione > 0)... - if (MagClass.magazzino.udcMpIsConsumabile(UDC)) - { - // consumo UDC - MagClass.magazzino.scaricaUdcMpWip(UDC, Request.UserHostName); - } - } - } - /// - ///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); - } - } - } - } - /// /// verifica che il vettore di UDC abbia tutto lo stesso particolare e lo restituisce, altrimenti restituisce "" /// /// dictionary di UDC da verificare @@ -802,85 +484,15 @@ namespace GMW.WebUserControls 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() + public override void doResetData() { // resetto UDC e trattamenti resetTrattamenti(); resetUDC(); - // resetto i dati QtaTot e particolare... - qta = 0; - currParticolare = ""; - txtQta.Text = ""; - doChecks(); + base.doResetData(); } - /// - /// svuoto le note - /// - /// - /// - protected void btnEmptyNote_Click(object sender, EventArgs e) - { - txtNote.Text = ""; - Postazione.messaggiText = traduci("AttesaBCode"); - Postazione.CssClass = "stileAttesa"; - // raise dell'evento - if (eh_reqUpdate != null) - { - eh_reqUpdate(this, new EventArgs()); - } - } - - 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() - { - } - /// /// elenco dictionary dei trattamenti da associare ad UDC /// @@ -1028,7 +640,7 @@ namespace GMW.WebUserControls /// /// /// - protected void txtQta_TextChanged(object sender, EventArgs e) + public override void txtQta_TextChanged(object sender, EventArgs e) { checkStampa(); } diff --git a/GMW/bin/GMW.dll b/GMW/bin/GMW.dll index 5f50eeb5..c65c6168 100644 Binary files a/GMW/bin/GMW.dll and b/GMW/bin/GMW.dll differ diff --git a/GMW/bin/GMW_data.dll b/GMW/bin/GMW_data.dll index b9ec0ede..bf559bd6 100644 Binary files a/GMW/bin/GMW_data.dll and b/GMW/bin/GMW_data.dll differ diff --git a/GMW/bin/VersGen.dll b/GMW/bin/VersGen.dll index 388f1ba0..cce4b28f 100644 Binary files a/GMW/bin/VersGen.dll and b/GMW/bin/VersGen.dll differ diff --git a/GMW_data/UserControlBCodeMan.cs b/GMW_data/UserControlBCodeMan.cs index 4d99b06c..23354707 100644 --- a/GMW_data/UserControlBCodeMan.cs +++ b/GMW_data/UserControlBCodeMan.cs @@ -11,14 +11,18 @@ namespace GMW_data #region area base comune (variabili, valori e metodi generali) /// - /// flusso associato (hard coded) a sterrati + /// flusso associato al controllo /// public string flusso = ""; /// - /// stato associato (hard coded) a sterrati + /// stato associato all'UDC da CREARE /// public string statoUDC = ""; /// + /// stato associato all'UDC da accettare + /// + public string statoUDC_pre = ""; + /// /// tipo di evento associato alla creazione dell'UDC /// public string eventoUDC = ""; @@ -27,6 +31,14 @@ namespace GMW_data /// public string eventoUDC_qta = ""; /// + /// attributo per TRATTAMENTO termico + /// + public string attrNumTra = ""; + /// + /// flusso associato al TRATTAMENTO termico + /// + public string flusso_TR = ""; + /// /// dati x verifica CodSoggetto / matricola /// public string preCodSogg = memLayer.ML.CRS("prefCodSogg"); @@ -526,11 +538,15 @@ namespace GMW_data /// public virtual void consumaUdc(string oldUdc) { - // se è consumabile (IdxPosizione > 0)... - if (MagClass.magazzino.udcMpIsConsumabile(oldUdc)) + // se UDC è NON vuoto ed esiste + if (oldUdc != "" && MagClass.magazzino.checkUDC(oldUdc)) { - // consumo UDC - MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName); + // se è consumabile (IdxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(oldUdc)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName); + } } } ///