From 40e40fb83f8e0008e8bc02cb2bb360c4210880b3 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 29 May 2017 19:05:01 +0200 Subject: [PATCH] =?UTF-8?q?inserito=20blocco=20UDC=20ingresso=20di=20parti?= =?UTF-8?q?colare=20diverso=20da=20uno=20eventualmente=20gi=C3=A0=20carica?= =?UTF-8?q?to=20(verificare...)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GMW/WebUserControls/mod_PostFin_DT.ascx.cs | 109 +++++++++++++-------- 1 file changed, 67 insertions(+), 42 deletions(-) diff --git a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs index 65ec57eb..810a6727 100644 --- a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs @@ -263,9 +263,11 @@ namespace GMW.WebUserControls tipoCodiceBarcode tipoBC = MagClass.tipoBCode_L5(barcodeIn); // per prima cosa se non ho almeno un UDC trattamenti od un AL (che ne porti uno) sollevo un errore... int numUdcCella = 0; + DS_magazzino.v_UdcDetailDataTable tabUdcIn = new DS_magazzino.v_UdcDetailDataTable(); try { - numUdcCella = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella).Rows.Count; + tabUdcIn = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella); + numUdcCella = tabUdcIn.Rows.Count; } catch { } @@ -349,7 +351,7 @@ namespace GMW.WebUserControls // verifico stato (statoUdc/statoUdc_pre) e posizioni (IdxPosizioneIn/IdxPosizioneOut): tratt a sx da consumare, fin a dx da stampare/ricaricare... if (cartUDC.CodStato == statoUDC_pre && cartUDC.IdxPosizione == IdxPosizioneIn) { - bool partOk = false; + bool partOkOut = false; // recupero elenco UDC in uscita... DS_magazzino.v_A2U2DDataTable tab = MagClass.magazzino.taA2U2D.getByAL(destAL); if (tab.Rows.Count > 0) @@ -357,64 +359,87 @@ namespace GMW.WebUserControls // verifico se particolare NON corrisponde.... if (tab.Select(string.Format("Particolare = '{0}'", cartUDC.Particolare)).Length == 1) { - partOk = true; + partOkOut = true; } } else { - partOk = true; + partOkOut = true; } - // se part NON ok.. - if (!partOk) + // se part NON ok rispetto OUT.. + if (!partOkOut) { Postazione.warningText = traduci("ERR-UDC-DTX-006"); Postazione.CssClass = cssErr; } else { - // verifico che abbia attributo trattamento - int numTratt = MagClass.magazzino.taAtt2UDC.getByUdc(barcodeIn).Select("CodAttr = 'NT'").Length; - if (numTratt == 0) + // verifico se ci sia già un UDC in ingresso e che abbia lo stesso particolare... + bool partOkIn = false; + if (numUdcCella > 0) { - Postazione.warningText = traduci("ERR-UDC-DTX-003"); + // controllo particolare IN... + if (tabUdcIn[0].Particolare == cartUDC.Particolare) + { + partOkIn = true; + } + } + else + { + partOkIn = true; + } + // se part NON ok rispetto OUT.. + if (!partOkIn) + { + Postazione.warningText = traduci("ERR-UDC-DTX-009"); Postazione.CssClass = cssErr; } else { - currParticolare = cartUDC.Particolare; - origParticolare = cartUDC.Particolare; - // procedo a caricare UDC a SX, eventualmente consumando precedente... - if (currParticolare != "") + // verifico che abbia attributo trattamento + int numTratt = MagClass.magazzino.taAtt2UDC.getByUdc(barcodeIn).Select("CodAttr = 'NT'").Length; + if (numTratt == 0) { + Postazione.warningText = traduci("ERR-UDC-DTX-003"); + Postazione.CssClass = cssErr; + } + else + { + currParticolare = cartUDC.Particolare; + origParticolare = cartUDC.Particolare; + // procedo a caricare UDC a SX, eventualmente consumando precedente... + if (currParticolare != "") + { - int idxCellaCurr = 0; - try - { - idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; - } - catch - { } - string codBloccoCurr = ""; - int idxBlocco = 0; - try - { - idxBlocco = MagClass.magazzino.taCelle.getByIdxCella(idxCellaCurr)[0].IdxBlocco; - codBloccoCurr = MagClass.magazzino.taBlocchi.getByIdx(idxBlocco)[0].CodBlocco; - } - catch - { } - // 2015.01.12 controllo UDC non già su altre postazioni... - if (codBloccoCurr == Postazione.currCodBlocco && idxCellaCurr != Postazione.currIdxCella) - { - Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA!"; - Postazione.CssClass = cssErr; - } - else - { - // imposto qta STD... - qta = maxQta; - // processo (eventualmente creando UDC... - processUdcInOut(idxCellaCurr); + int idxCellaCurr = 0; + try + { + idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; + } + catch + { } + string codBloccoCurr = ""; + int idxBlocco = 0; + try + { + idxBlocco = MagClass.magazzino.taCelle.getByIdxCella(idxCellaCurr)[0].IdxBlocco; + codBloccoCurr = MagClass.magazzino.taBlocchi.getByIdx(idxBlocco)[0].CodBlocco; + } + catch + { } + // 2015.01.12 controllo UDC non già su altre postazioni... + if (codBloccoCurr == Postazione.currCodBlocco && idxCellaCurr != Postazione.currIdxCella) + { + Postazione.messaggiText += " - Attenzione, UDC già caricato su ALTRA LINEA!"; + Postazione.CssClass = cssErr; + } + else + { + // imposto qta STD... + qta = maxQta; + // processo (eventualmente creando UDC... + processUdcInOut(idxCellaCurr); + } } } }