From a9bacff235547a03c6c3bbacc0de27ce7d095a8c Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 13 Jan 2021 09:38:04 +0100 Subject: [PATCH 01/10] Update conf code stampa MAG + reprint --- MP-MAG/Reports/queueConf.json | 133 +++++++++++++++------- MP-MAG/WebUserControls/cmp_UdcODL.ascx | 36 +++--- MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs | 32 ++++++ 3 files changed, 143 insertions(+), 58 deletions(-) diff --git a/MP-MAG/Reports/queueConf.json b/MP-MAG/Reports/queueConf.json index b17c7832..ed8e74e3 100644 --- a/MP-MAG/Reports/queueConf.json +++ b/MP-MAG/Reports/queueConf.json @@ -1,47 +1,92 @@ [ - { - "name": "codaFiniti_01", - "template": "CartellinoFinitiOdette.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "148mm", - "PageWidth": "210mm", - "MarginLeft": "0mm", - "MarginRight": "0mm", - "MarginTop": "30mm", - "MarginBottom": "0mm", - "xmlParam": "EMF210mm148mm30mm0mm0mm0mm" + { + "name": "codaFiniti_01", + "template": "CartellinoFinitiOdette.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "148mm", + "PageWidth": "210mm", + "MarginLeft": "0mm", + "MarginRight": "0mm", + "MarginTop": "30mm", + "MarginBottom": "0mm", + "xmlParam": "EMF210mm148mm30mm0mm0mm0mm" + } + }, + { + "name": "codaPedane_01", + "template": "CartellinoPedane.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "148mm", + "PageWidth": "213mm", + "MarginLeft": "10mm", + "MarginRight": "10mm", + "MarginTop": "10mm", + "MarginBottom": "10mm", + "xmlParam": "EMF213mm148mm10mm10mm10mm10mm" + } + }, + { + "name": "codaSemilavorati_01", + "template": "CartellinoSemilavorati.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "100mm", + "PageWidth": "148mm", + "MarginLeft": "10mm", + "MarginRight": "10mm", + "MarginTop": "10mm", + "MarginBottom": "10mm", + "xmlParam": "EMF148mm100mm10mm10mm10mm10mm" + } + }, + { + "name": "SIMUL_01", + "template": "CartellinoFinitiOdette.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "148mm", + "PageWidth": "210mm", + "MarginLeft": "0mm", + "MarginRight": "0mm", + "MarginTop": "30mm", + "MarginBottom": "0mm", + "xmlParam": "EMF210mm148mm30mm0mm0mm0mm" + } + }, + { + "name": "SIMUL_02", + "template": "CartellinoFinitiOdette.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "148mm", + "PageWidth": "210mm", + "MarginLeft": "0mm", + "MarginRight": "0mm", + "MarginTop": "30mm", + "MarginBottom": "0mm", + "xmlParam": "EMF210mm148mm30mm0mm0mm0mm" + } + }, + { + "name": "SIMUL_03", + "template": "CartellinoSemilavorati.rdlc", + "printerName": "Microsoft Print to PDF", + "deviceInfoParam": { + "OutputFormat": "EMF", + "PageHeight": "100mm", + "PageWidth": "148mm", + "MarginLeft": "10mm", + "MarginRight": "10mm", + "MarginTop": "10mm", + "MarginBottom": "10mm", + "xmlParam": "EMF148mm100mm10mm10mm10mm10mm" + } } - }, - { - "name": "codaPedane_01", - "template": "CartellinoPedane.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "148mm", - "PageWidth": "213mm", - "MarginLeft": "10mm", - "MarginRight": "10mm", - "MarginTop": "10mm", - "MarginBottom": "10mm", - "xmlParam": "EMF213mm148mm10mm10mm10mm10mm" - } - }, - { - "name": "codaSemilavorati_01", - "template": "CartellinoSemilavorati.rdlc", - "printerName": "Microsoft Print to PDF", - "deviceInfoParam": { - "OutputFormat": "EMF", - "PageHeight": "100mm", - "PageWidth": "148mm", - "MarginLeft": "10mm", - "MarginRight": "10mm", - "MarginTop": "10mm", - "MarginBottom": "10mm", - "xmlParam": "EMF148mm100mm10mm10mm10mm10mm" - } - } ] \ No newline at end of file diff --git a/MP-MAG/WebUserControls/cmp_UdcODL.ascx b/MP-MAG/WebUserControls/cmp_UdcODL.ascx index 77dd0127..760ad53b 100644 --- a/MP-MAG/WebUserControls/cmp_UdcODL.ascx +++ b/MP-MAG/WebUserControls/cmp_UdcODL.ascx @@ -7,34 +7,42 @@
- + - + + <%-- + + --%> + + + + + + + <%-- - --%> - <%----%> - - <%-- + + + - - - --%> - - <%----%> - <%----%> - - <%-- + + + + + + + diff --git a/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs b/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs index b6fe844f..2de81bb3 100644 --- a/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs @@ -9,8 +9,40 @@ namespace MP_MAG.WebUserControls { public partial class cmp_UdcODL : BaseUserControl { + #region Private Methods + + private void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + raiseReset(); + } + + #endregion Private Methods + #region Protected Methods + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // invio comando di ristampa.. + if (grView.SelectedIndex >= 0) + { + string UDC = $"{grView.SelectedValue}"; + MagDataLayerObj.taPJQ.insertQuery(UDC, currData.CodPost); + } + resetSelezione(); + } + + /// + /// comando reset + /// + /// + /// + protected void lbtReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) From 4b56919704384eedcb1cf3075df3091a1ee02020 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 13 Jan 2021 09:38:14 +0100 Subject: [PATCH 02/10] new rel --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bb95140d..733cc846 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1363']) { + withEnv(['NEXT_BUILD_NUMBER=1364']) { // env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' From 037d673b8a1c56a075e54fe10f3c18e6cca12234 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 13 Jan 2021 11:01:33 +0100 Subject: [PATCH 03/10] Update gestione PJQ come x NKC --- MP-MAG/Controllers/PrintQueueController.cs | 32 +- MP-MAG/Controllers/PrintQueueLenController.cs | 129 ++ MP-MAG/MP-MAG.csproj | 1 + MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs | 6 +- MP-MAG/WebUserControls/cmp_printODL.ascx.cs | 6 +- MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs | 3 +- MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs | 1158 +++++++++-------- MagData/DS_Report.Designer.cs | 124 +- MagData/DS_Report.xsd | 55 +- MagData/Enum.cs | 26 + MagData/MagDataLayer.cs | 18 +- MagData/reportPrinter.cs | 814 +++++------- 12 files changed, 1269 insertions(+), 1103 deletions(-) create mode 100644 MP-MAG/Controllers/PrintQueueLenController.cs diff --git a/MP-MAG/Controllers/PrintQueueController.cs b/MP-MAG/Controllers/PrintQueueController.cs index 8ca42e7e..5c1d41b4 100644 --- a/MP-MAG/Controllers/PrintQueueController.cs +++ b/MP-MAG/Controllers/PrintQueueController.cs @@ -14,14 +14,14 @@ namespace MP_MAG.Controllers { public class PrintQueueController : ApiController { - #region Public Fields + #region Protected Fields /// - /// chaive redis x cache conteggio coda PJQ + /// oggetto static/singleton per fare chiamate sul datalayer /// - public static string redQueueCount = "MP-CTRACK:MAG:PJQ"; + protected MagDataLayer MagDataLayerObj = new MagDataLayer(); - #endregion Public Fields + #endregion Protected Fields #region Protected Properties @@ -34,7 +34,7 @@ namespace MP_MAG.Controllers { int answ = 0; // resetto conteggio in redis... - DS_Report.PrintJobQueueDataTable nextJob = MagDataLayer.man.taPJQ.getWaiting(); + DS_Report.PrintJobQueueDataTable nextJob = MagDataLayerObj.taPJQ.getWaiting(); if (nextJob != null) { answ = nextJob.Count; @@ -60,17 +60,17 @@ namespace MP_MAG.Controllers switch (tipoReport) { case MagData.reportRichiesto.CartellinoFinitiOdette: - tab = MagDataLayer.man.taCFOdette.GetData(keyParam); + tab = MagDataLayerObj.taCFOdette.GetData(keyParam); answ.Add("stp_prt_CartellinoFinitiOdette", tab); break; case MagData.reportRichiesto.CartellinoPedane: - tab = MagDataLayer.man.taCPed.GetData(keyParam); + tab = MagDataLayerObj.taCPed.GetData(keyParam); answ.Add("stp_prt_CartellinoPedane", tab); break; case MagData.reportRichiesto.CartellinoSemilavorati: - tab = MagDataLayer.man.taCSemil.GetData(keyParam); + tab = MagDataLayerObj.taCSemil.GetData(keyParam); answ.Add("stp_prt_CartellinoSemilavorati", tab); break; @@ -92,7 +92,7 @@ namespace MP_MAG.Controllers protected MagData.reportRichiesto reportByTemplate(string queueName) { MagData.reportRichiesto report = MagData.reportRichiesto.ND; - var qConf = MagDataLayer.man.queueConfRedis.Find(x => x.name == queueName); + var qConf = MagDataLayerObj.queueConfRedis.Find(x => x.name == queueName); if (qConf != null) { // decodifico @@ -119,7 +119,7 @@ namespace MP_MAG.Controllers { // restituisco... int answ = 0; - string redVal = memLayer.ML.getRSV(redQueueCount); + string redVal = memLayer.ML.getRSV(MagDataLayer.redQueueCount); // cerco in redis se ci sia chiave.. if (!string.IsNullOrEmpty(redVal)) { @@ -131,7 +131,7 @@ namespace MP_MAG.Controllers int ttlPrintCount = memLayer.ML.CRI("ttlPrintCount"); // recupero da dbe e salvo answ = countWaitingDb; - memLayer.ML.setRSV(redQueueCount, $"{answ}", ttlPrintCount); + memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{answ}", ttlPrintCount); } return answ; } @@ -146,7 +146,7 @@ namespace MP_MAG.Controllers { List answ = new List(); // recupero da DB... - DS_Report.PrintJobQueueDataTable tabPJQ = MagDataLayer.man.taPJQ.getByQueue(id); + DS_Report.PrintJobQueueDataTable tabPJQ = MagDataLayerObj.taPJQ.getByQueue(id); if (tabPJQ.Count > 0) { reportData currReport = new reportData(); @@ -154,11 +154,11 @@ namespace MP_MAG.Controllers // ciclo! foreach (var pjReq in tabPJQ) { - currRdsData = caricaDati(reportByTemplate(pjReq.printerQueue), pjReq.keyParam); + currRdsData = caricaDati(reportByTemplate(pjReq.prtName), pjReq.KeyParam); // in base alla coda --> recupero i dati currReport = new reportData() { - ticketNum = pjReq.IdxPrintJob.ToString(), + ticketNum = $"{pjReq.IdxPrintJob}", rdsData = currRdsData }; answ.Add(currReport); @@ -196,9 +196,9 @@ namespace MP_MAG.Controllers { int idxPJQ = 0; int.TryParse(printAnsw.ticketNum, out idxPJQ); - MagDataLayer.man.taPJQ.updateStato(idxPJQ, printAnsw.newStatus); + MagDataLayerObj.taPJQ.updateStato(idxPJQ, printAnsw.newStatus); // resetto conteggio in redis... - memLayer.ML.setRSV(redQueueCount, countWaitingDb.ToString(), 30); + memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{countWaitingDb}", 30); answ = "OK"; } } diff --git a/MP-MAG/Controllers/PrintQueueLenController.cs b/MP-MAG/Controllers/PrintQueueLenController.cs new file mode 100644 index 00000000..2a81ce51 --- /dev/null +++ b/MP-MAG/Controllers/PrintQueueLenController.cs @@ -0,0 +1,129 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; + +using MagData; +using Newtonsoft.Json; +using SteamWare; + +namespace MP_MAG.Controllers +{ + public class PrintQueueLenController : ApiController + { + #region Protected Fields + + /// + /// oggetto static/singleton per fare chiamate sul datalayer + /// + protected MagDataLayer MagDataLayerObj = new MagDataLayer(); + + #endregion Protected Fields + + #region Protected Properties + + /// + /// Conteggio elementi in attesa stampa da DB + /// + protected int countWaitingDb + { + get + { + int answ = 0; + // resetto conteggio in redis... + DS_Report.PrintJobQueueDataTable tabPJQ = MagDataLayerObj.taPJQ.getWaiting(); + if (tabPJQ != null) + { + answ = tabPJQ.Count; + } + return answ; + } + } + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Conteggio elementi in attesa stampa da DB che fanno parte di un SET di queue + /// + protected int countWaitingDbQueueMult(string queueSet) + { + int answ = 0; + // resetto conteggio in redis... + DS_Report.PrintJobQueueDataTable tabPJQ = MagDataLayerObj.taPJQ.getWaiting(); + if (tabPJQ != null) + { + var selQueue = tabPJQ.Where(x => queueSet.Contains($"|{x.prtName}|")).ToList(); + if (selQueue != null) + { + answ = selQueue.Count; + } + } + return answ; + } + + #endregion Protected Methods + + #region Public Methods + + /// + /// Restituisce numero jobs aperti (stato = 0...), se 0 = NESSUNO + /// GET: api/PrintQueue + /// + /// + public int Get() + { + // restituisco... + int answ = 0; + string redVal = memLayer.ML.getRSV(MagDataLayer.redQueueCount); + // cerco in redis se ci sia chiave.. + if (!string.IsNullOrEmpty(redVal)) + { + // recupero + int.TryParse(redVal, out answ); + } + else + { + // recupero da db e salvo + answ = countWaitingDb; + memLayer.ML.setRSV(MagDataLayer.redQueueCount, $"{answ}", memLayer.ML.CRI("cacheQueueSec")); + // chiudo gli zombie (stampe non chiuse)... + MagDataLayerObj.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime"))); + } + return answ; + } + + /// + /// Restituisce numero jobs aperti (stato = 0...), se 0 = NESSUNO + /// GET: api/PrintQueue?queueList=|queueOffline| + /// + /// Elenco code delimitate da |..| + /// + public int Get(string queueList) + { + // restituisco... + int answ = 0; + string redVal = memLayer.ML.getRSV($"{MagDataLayer.redQueueCountSet}:{queueList}"); + // cerco in redis se ci sia chiave.. + if (!string.IsNullOrEmpty(redVal)) + { + // recupero + int.TryParse(redVal, out answ); + } + else + { + // recupero da db e salvo + answ = countWaitingDbQueueMult(queueList); + memLayer.ML.setRSV($"{MagDataLayer.redQueueCountSet}:{queueList}", $"{answ}", memLayer.ML.CRI("cacheQueueSec")); + // chiudo gli zombie (stampe non chiuse)... + MagDataLayerObj.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime"))); + } + return answ; + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP-MAG/MP-MAG.csproj b/MP-MAG/MP-MAG.csproj index 2c37d805..d2bfefeb 100644 --- a/MP-MAG/MP-MAG.csproj +++ b/MP-MAG/MP-MAG.csproj @@ -283,6 +283,7 @@ + Global.asax diff --git a/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs b/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs index 2de81bb3..602efe81 100644 --- a/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_UdcODL.ascx.cs @@ -1,4 +1,5 @@ -using System; +using MagData; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -27,8 +28,9 @@ namespace MP_MAG.WebUserControls // invio comando di ristampa.. if (grView.SelectedIndex >= 0) { + tipoDocumento tipoDoc = currData.isProdFinito ? tipoDocumento.docFinito : tipoDocumento.docSemilavorato; string UDC = $"{grView.SelectedValue}"; - MagDataLayerObj.taPJQ.insertQuery(UDC, currData.CodPost); + MagDataLayerObj.taPJQ.insertQuery($"{tipoDoc}", UDC, currData.CodPost); } resetSelezione(); } diff --git a/MP-MAG/WebUserControls/cmp_printODL.ascx.cs b/MP-MAG/WebUserControls/cmp_printODL.ascx.cs index 685c3c2a..beb9aafe 100644 --- a/MP-MAG/WebUserControls/cmp_printODL.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_printODL.ascx.cs @@ -1,4 +1,5 @@ -using System; +using MagData; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -84,13 +85,14 @@ namespace MP_MAG.WebUserControls protected void lbtPrint_Click(object sender, EventArgs e) { string flusso = currData.isProdFinito ? "MFI" : "MSL"; + tipoDocumento tipoDoc = currData.isProdFinito ? tipoDocumento.docFinito : tipoDocumento.docSemilavorato; // creo UDC var tabUdc = MagDataLayerObj.taEUdc.insertQuery(currData.Lotto, flusso, currData.CliCod, currData.CodPost, numPzUdc, 1, "", 0, 0, 0, "", 0, ""); // se ho nuovo udc --> seleziono stampa! if (tabUdc.Rows.Count > 0) { // metto in coda di stampa... - MagDataLayerObj.taPJQ.insertQuery(tabUdc[0].UDC, currData.CodPost); + MagDataLayerObj.taPJQ.insertQuery($"{tipoDoc}", tabUdc[0].UDC, currData.CodPost); } checkPrint(); // segnalo update diff --git a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs index e0b1c1ac..39e5ec49 100644 --- a/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_prtFiniti.ascx.cs @@ -271,8 +271,9 @@ namespace MP_MAG.WebUserControls var tabNewUDC = MagDataLayer.man.taEUdc.insertQuery(cmp_LottiOut.lottoSel, flussoUdc, CodCli, CodPost, qtaUdc, 1, CodOpr, 0, 0, 0, "", 0, ""); if (tabNewUDC.Count == 1) { + tipoDocumento tipoDoc = currData.isProdFinito ? tipoDocumento.docFinito : tipoDocumento.docSemilavorato; // cheo stampa per chiave lotto... - MagDataLayer.man.taPJQ.insertQuery(tabNewUDC[0].UDC, printQueue); + MagDataLayer.man.taPJQ.insertQuery($"{tipoDoc}", tabNewUDC[0].UDC, printQueue); } } } diff --git a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs index fa4d5f52..5f8a6892 100644 --- a/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs +++ b/MP-MAG/WebUserControls/cmp_prtSemilav.ascx.cs @@ -10,565 +10,279 @@ using System.Web.UI.WebControls; namespace MP_MAG.WebUserControls { - public partial class cmp_prtSemilav : BaseUserControl - { - /// - /// Tipo Stampa - /// - public string tipoStampa + public partial class cmp_prtSemilav : BaseUserControl { - get - { - return lblTipoStampa.Text; - } - set - { - lblTipoStampa.Text = value; - } - } - /// - /// Comando ULTIMO barcode letto - /// - protected string lastCmd - { - get - { - return hfLastBCode.Value; - } - set - { - hfLastBCode.Value = value; - lastValidCmd = value; - } - } - /// - /// Coda di stampa attiva - /// - public string printQueue - { - get - { - // cerco in hidden file... - string answ = hfPrintQueue.Value; - if (string.IsNullOrEmpty(answ)) + #region Protected Properties + + /// + /// Comando ULTIMO barcode letto + /// + protected string lastCmd { - // altrimenti da currProdData - answ = currProdData.PrintQueue; - } - return answ; - } - set - { - hfPrintQueue.Value = value; - } - } - /// - /// Tipo di lotto - /// - public string tipoLotto - { - get - { - return hfTipoLotto.Value; - } - set - { - hfTipoLotto.Value = value; - } - } - /// - /// Cod Flusso x UDC - /// - public string flussoUdc - { - get - { - return hfFlussoUdc.Value; - } - set - { - hfFlussoUdc.Value = value; - } - } - /// - /// Cod Stato in uscita - /// - public string codStatoOUT - { - get - { - return hfCodStatoOUT.Value; - } - set - { - hfCodStatoOUT.Value = value; - } - } - /// - /// Cod Stato materiale in ingresso - /// - public string codStatoIN - { - get - { - return hfCodStatoIN.Value; - } - set - { - hfCodStatoIN.Value = value; - } - } - /// - /// Origine - /// - public string origine - { - get - { - return hfOrigine.Value; - } - set - { - hfOrigine.Value = value; - } - } - /// - /// ULTIMO Comando barcode VALIDO (!="") letto - /// - protected string lastValidCmd - { - get - { - return hfLastValidBCode.Value; - } - set - { - // solo se è non nullo/vuoto - if (!string.IsNullOrEmpty(value)) - { - hfLastValidBCode.Value = value; - } - } - } - /// - /// Elenco dei lotti selezionati (riporta a sottocomponenti) - /// - public List lottiSel - { - get - { - return cmp_LottiIn.lottiSel; - } - set - { - cmp_LottiIn.lottiSel = value; - cmp_LottiOut.lottiSel = value; - cmp_ArtOut.lottiSel = value; - } - } - /// - /// Caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - lottiSel = new List(); - cmp_creaLottoOUT.Visible = false; - cmp_printLottoOUT.Visible = false; - } - // eventi barcode - cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh; - // eventi reset lotti IN - cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset; - cmp_LottiIn.eh_doReset += cmp_LottiIn_eh_doReset; - // selezione articoli - cmp_ArtOut.eh_doRefresh += cmp_ArtOut_eh_doRefresh; - cmp_ArtOut.eh_doReset += cmp_ArtOut_eh_doReset; - // selezione lotti esistenti x stampa - cmp_LottiOut.eh_doRefresh += cmp_LottiOut_eh_doRefresh; - cmp_LottiOut.eh_doReset += cmp_LottiOut_eh_doReset; - // eventi di creazione lotto e stampa - cmp_creaLottoOUT.eh_doRefresh += Cmp_creaLottoOUT_eh_doRefresh; - cmp_printLottoOUT.eh_doRefresh += Cmp_printLottoOUT_eh_doRefresh; - } - - private void Cmp_printLottoOUT_eh_doRefresh(object sender, EventArgs e) - { - // salvo richiesta stampa della quantità richiesta - int numUdc = cmp_printLottoOUT.numUdc; - decimal qtaTot = cmp_printLottoOUT.qtaTot; - if (numUdc > 0) - { - decimal qtaUdc = qtaTot / numUdc; - string keyParam = cmp_LottiOut.lottoSel; - for (int i = 0; i < numUdc; i++) - { - // creo UDC x semilavorato.. - MagDataLayer.man.taEUdc.insertQuery(cmp_LottiOut.lottoSel, flussoUdc, CodCli, CodPost, qtaUdc, 1, CodOpr, 0, 0, 0, "", 0, ""); - // cheo stampa per chiave lotto... - MagDataLayer.man.taPJQ.insertQuery(keyParam, printQueue); - } - } - // nascondo creazione... - showCreaStampa(false, false); - cmp_LottiIn.doUpdate(); - cmp_LottiOut.doUpdate(); - } - - private void Cmp_creaLottoOUT_eh_doRefresh(object sender, EventArgs e) - { - MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStatoOUT, origine, "", RifExt, cmp_LottiIn.elLotti); - cmp_LottiOut.doUpdate(); - } - - /// - /// Selezionato un Lotto già creato - /// - /// - /// - private void cmp_ArtOut_eh_doRefresh(object sender, EventArgs e) - { - // mostro button x creare NUOVA etichetta SUL LOTTO ESISTENTE - showCreaStampa(true, false); - } - /// - /// Reset sel articolo - /// - /// - /// - private void cmp_ArtOut_eh_doReset(object sender, EventArgs e) - { - showCreaStampa(false, false); - } - /// - /// Nascondo print lotto - /// - /// - /// - private void cmp_LottiOut_eh_doRefresh(object sender, EventArgs e) - { - // mostro button x creare NUOVO LOTTO - showCreaStampa(false, true); - } - /// - /// Print lotto - /// - /// - /// - private void cmp_LottiOut_eh_doReset(object sender, EventArgs e) - { - showCreaStampa(false, false); - } - /// - /// Mostra buttons crea/stampa lotto - /// - /// - /// - protected void showCreaStampa(bool showCrea, bool showPrint) - { - cmp_creaLottoOUT.Visible = showCrea; - cmp_printLottoOUT.Visible = showPrint; - } - - private void cmp_LottiIn_eh_doReset(object sender, EventArgs e) - { - Response.Redirect(user_std.pagCorrente); - } - - private void Cmp_barcode_eh_doReset(object sender, EventArgs e) - { - resetIcons(); - } - - private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e) - { - bool doRaiseEv = false; - // processo evento.. - lastCmd = cmp_barcode.inputAcquired.ToUpper(); - doRaiseEv = processLastCmd(doRaiseEv); - - // reset comando - cmp_barcode.inputAcquired = ""; - // aggiorno... - doUpdate(); - } - - private void resetIcons() - { -#if false - lblDestination.CssClass = "text-secondary"; - lblMessage.Text = ""; - lblDestination.Text = ""; - lblLastBCode.Text = ""; - lbtCancel.Visible = false; - lbtScrapped.Visible = false; - lbtParkArea.Visible = false; - lbtResetSel.Visible = (itemIdSelected != 0); -#endif - } - private bool processLastCmd(bool doRaiseEv) - { - if (lastCmd == "") doRaiseEv = true; - // processiamo barcode letto - decodedData decoData = MagDataLayer.man.decodeBcode(lastValidCmd); - switch (decoData.codeType) - { - case codeType.UNK: - cmp_barcode.showOutput("text-danger", $"Codice sconosciuto: {decoData.rawData} --> ignoro"); - resetSelection(false); - doRaiseEv = true; - break; - case codeType.Lotto: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - processSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); - break; - case codeType.LottoInt: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - //doRaiseEv = true; - break; - case codeType.Date: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - //processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); - break; - case codeType.PartNumber: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - //processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); - break; - case codeType.Quantity: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - //doRaiseEv = true; - break; - case codeType.Udc: - cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); - //doRaiseEv = true; - break; - //case codeType.Batch: - // cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}"); - // doRaiseEv = true; - // break; - //case codeType.Cart: - // cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}"); - // processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); - // break; - //case codeType.Bin: - // cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}"); - // processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); - // break; - //default: - // cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); - // resetSelection(false); - // break; - } - - return doRaiseEv; - } - /// - /// Processo il codice letto - /// - /// - /// - /// - private void processSuggestion(codeType tipoCod, string rawData, int codeInt) - { - //DS_App.ItemListDataTable tabItem = null; - // processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero) - switch (tipoCod) - { - case codeType.Lotto: - // IN PRIMIS cerco lotto valido - DS_Mag.ElencoLottiDataTable tabLotti; - tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "*", codStatoIN); - if (tabLotti.Count == 1) - { - // se trovato cerco in elenco --> aggiungo in lista se non c'è - var currLotti = lottiSel; - if (!currLotti.Contains(rawData)) + get { - currLotti.Add(rawData); - lottiSel = currLotti; + return hfLastBCode.Value; + } + set + { + hfLastBCode.Value = value; + lastValidCmd = value; } - } - break; - //case codeType.Item: - // tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData, 0, 999); - // if (tabItem.Count == 1) - // { - // showItemDetail(true, tabItem[0], false); - // } - // else if (tabItem.Count == 0) - // { - // showItemDetail(false, null, true); - // } - // break; - //case codeType.ItemGeneric: - // // PRIMA CERCSE ne ho in stato 1..3 - // tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 3); - // if (tabItem.Count == 0) - // { - // // se NON ne trovo cerci FINO a stato 5... - // tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 5); - // } - // if (tabItem.Count == 1) - // { - // showItemDetail(true, tabItem[0], false); - // } - // else if (tabItem.Count == 0) - // { - // showItemDetail(false, null, true); - // } - // break; - //case codeType.Cart: - // // verifico NON SIA richiesto PAINT - // if (showBin) - // { - // displError("PAINT: BIN REQUESTED: please retry", true); - // } - // else - // { - // if (currCartTab.Count == 1) - // { - // // controllo se sia quello corretto - // if (rawData != currCartTab[0].CartDtmx) - // { - // displError("INCORRECT CART: please retry", true); - // } - // else - // { - // // dichiaro che è depositato - // DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId); - // lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}"; - // resetSelection(false); - // } - // } - // } - // break; - //case codeType.Bin: - // // verifico NON SIA richiesto PAINT - // if (showCart) - // { - // displError("NOT PAINTED: CART REQUESTED: please retry", true); - // } - // else - // { - // if (currBinTab.Count == 1) - // { - // // controllo se sia quello corretto - // if (rawData != currBinTab[0].BinDtmx) - // { - // displError("INCORRECT BIN: please retry", true); - // } - // else - // { - // // dichiaro che è depositato - // DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId); - // lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}"; - // resetSelection(false); - // } - // } - // } - // break; - default: - break; - } - } -#if false - /// - /// Mostra o nasconde dettaglio su ITEM letto - /// - /// - /// - /// - private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError) - { - resetShowData(); - divItemDet.Visible = showItem; - divItemError.Visible = showError; - if (showError) - { - displError("Item not found", true); - } - if (showItem) - { - lblItemCode.Text = itemRow.ItemExtCode; - lblItemDesc.Text = itemRow.ItemDesc; - lblItemDtmx.Text = itemRow.ItemDtmx; - itemIdSelected = itemRow.ItemID; - // CONTROLLO SIA in stato 1 --> worked, 2--> selected, 100--> parked... - switch (itemRow.StatusID) - { - case 0: - displError("ERROR: Item not ready", false); - break; - case 1: - case 2: - case 100: - // salvo che è in STATO 2 (picked up) - DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); - // verifico cosa devo mostrare come PROX passaggio... - showCart = itemRow.ProcessesReq == ""; - showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); - secOp = itemRow.PostProcList; - showSecOp = (secOp != ""); - doUpdate(); - break; - case 3: - displError("Item already on CART!", false); - break; - case 4: - // fino a concorrenza qta richiesta sposto, POI do errori - displError("ALL Item already scanned on BIN!", false); - break; - case 5: - displError("Item already at KIT STATION!", false); - break; - case 990: - displError("Item declared SCRAP!", false); - break; - case 991: - displError("Item declared SCRAP with CNC program created!", false); - break; - default: - displError("ERROR: Item status UNKNOWN!", false); - break; } - } - lbtResetSel.Visible = (itemIdSelected != 0); - } -#endif - /// - /// Reset selezione item + blocchi suggerimento + sel REDIS x pagina unload - /// - /// - protected void resetSelection(bool resetStatus) - { -#if false - if (resetStatus) - { - try - { - // SE item esiste... - var tabItem = DataLayer.man.taIL.getBySearch(itemIdSelected, itemIdSelected.ToString(), 0, 999); - if (tabItem.Count == 1) - { - // riposto item a status 1... - DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId); - } - } - catch - { } - } - // elimino item sel... - itemIdSelected = 0; - resetShowData(); - ComLib.resetItemPickup(SheetID, DeviceId); -#endif - } - private void doUpdate() - { + /// + /// ULTIMO Comando barcode VALIDO (!="") letto + /// + protected string lastValidCmd + { + get + { + return hfLastValidBCode.Value; + } + set + { + // solo se è non nullo/vuoto + if (!string.IsNullOrEmpty(value)) + { + hfLastValidBCode.Value = value; + } + } + } + + #endregion Protected Properties + + #region Public Properties + + /// + /// Cod Stato materiale in ingresso + /// + public string codStatoIN + { + get + { + return hfCodStatoIN.Value; + } + set + { + hfCodStatoIN.Value = value; + } + } + + /// + /// Cod Stato in uscita + /// + public string codStatoOUT + { + get + { + return hfCodStatoOUT.Value; + } + set + { + hfCodStatoOUT.Value = value; + } + } + + /// + /// Cod Flusso x UDC + /// + public string flussoUdc + { + get + { + return hfFlussoUdc.Value; + } + set + { + hfFlussoUdc.Value = value; + } + } + + /// + /// Elenco dei lotti selezionati (riporta a sottocomponenti) + /// + public List lottiSel + { + get + { + return cmp_LottiIn.lottiSel; + } + set + { + cmp_LottiIn.lottiSel = value; + cmp_LottiOut.lottiSel = value; + cmp_ArtOut.lottiSel = value; + } + } + + /// + /// Origine + /// + public string origine + { + get + { + return hfOrigine.Value; + } + set + { + hfOrigine.Value = value; + } + } + + /// + /// Coda di stampa attiva + /// + public string printQueue + { + get + { + // cerco in hidden file... + string answ = hfPrintQueue.Value; + if (string.IsNullOrEmpty(answ)) + { + // altrimenti da currProdData + answ = currProdData.PrintQueue; + } + return answ; + } + set + { + hfPrintQueue.Value = value; + } + } + + /// + /// Tipo di lotto + /// + public string tipoLotto + { + get + { + return hfTipoLotto.Value; + } + set + { + hfTipoLotto.Value = value; + } + } + + /// + /// Tipo Stampa + /// + public string tipoStampa + { + get + { + return lblTipoStampa.Text; + } + set + { + lblTipoStampa.Text = value; + } + } + + #endregion Public Properties + + #region Private Methods + + /// + /// Selezionato un Lotto già creato + /// + /// + /// + private void cmp_ArtOut_eh_doRefresh(object sender, EventArgs e) + { + // mostro button x creare NUOVA etichetta SUL LOTTO ESISTENTE + showCreaStampa(true, false); + } + + /// + /// Reset sel articolo + /// + /// + /// + private void cmp_ArtOut_eh_doReset(object sender, EventArgs e) + { + showCreaStampa(false, false); + } + + private void Cmp_barcode_eh_doRefresh(object sender, EventArgs e) + { + bool doRaiseEv = false; + // processo evento.. + lastCmd = cmp_barcode.inputAcquired.ToUpper(); + doRaiseEv = processLastCmd(doRaiseEv); + + // reset comando + cmp_barcode.inputAcquired = ""; + // aggiorno... + doUpdate(); + } + + private void Cmp_barcode_eh_doReset(object sender, EventArgs e) + { + resetIcons(); + } + + private void Cmp_creaLottoOUT_eh_doRefresh(object sender, EventArgs e) + { + MagDataLayer.man.taEL.insertQuery(tipoLotto, cmp_ArtOut.CodArtSel, codStatoOUT, origine, "", RifExt, cmp_LottiIn.elLotti); + cmp_LottiOut.doUpdate(); + } + + private void cmp_LottiIn_eh_doReset(object sender, EventArgs e) + { + Response.Redirect(user_std.pagCorrente); + } + + /// + /// Nascondo print lotto + /// + /// + /// + private void cmp_LottiOut_eh_doRefresh(object sender, EventArgs e) + { + // mostro button x creare NUOVO LOTTO + showCreaStampa(false, true); + } + + /// + /// Print lotto + /// + /// + /// + private void cmp_LottiOut_eh_doReset(object sender, EventArgs e) + { + showCreaStampa(false, false); + } + + private void Cmp_printLottoOUT_eh_doRefresh(object sender, EventArgs e) + { + // salvo richiesta stampa della quantità richiesta + int numUdc = cmp_printLottoOUT.numUdc; + decimal qtaTot = cmp_printLottoOUT.qtaTot; + if (numUdc > 0) + { + decimal qtaUdc = qtaTot / numUdc; + string keyParam = cmp_LottiOut.lottoSel; + tipoDocumento tipoDoc = currData.isProdFinito ? tipoDocumento.docFinito : tipoDocumento.docSemilavorato; + for (int i = 0; i < numUdc; i++) + { + // creo UDC x semilavorato.. + MagDataLayer.man.taEUdc.insertQuery(cmp_LottiOut.lottoSel, flussoUdc, CodCli, CodPost, qtaUdc, 1, CodOpr, 0, 0, 0, "", 0, ""); + // cheo stampa per chiave lotto... + MagDataLayer.man.taPJQ.insertQuery($"{tipoDoc}", keyParam, printQueue); + } + } + // nascondo creazione... + showCreaStampa(false, false); + cmp_LottiIn.doUpdate(); + cmp_LottiOut.doUpdate(); + } + + private void doUpdate() + { #if false // reset grafico icnCart.Attributes.Remove("class"); @@ -622,8 +336,342 @@ namespace MP_MAG.WebUserControls lblLastBCode.CssClass = "text-info"; } // fix btn reset! - lbtResetSel.Visible = (itemIdSelected != 0); + lbtResetSel.Visible = (itemIdSelected != 0); +#endif + } + + private bool processLastCmd(bool doRaiseEv) + { + if (lastCmd == "") doRaiseEv = true; + // processiamo barcode letto + decodedData decoData = MagDataLayer.man.decodeBcode(lastValidCmd); + switch (decoData.codeType) + { + case codeType.UNK: + cmp_barcode.showOutput("text-danger", $"Codice sconosciuto: {decoData.rawData} --> ignoro"); + resetSelection(false); + doRaiseEv = true; + break; + + case codeType.Lotto: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + processSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + break; + + case codeType.LottoInt: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + //doRaiseEv = true; + break; + + case codeType.Date: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + //processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + break; + + case codeType.PartNumber: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + //processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + break; + + case codeType.Quantity: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + //doRaiseEv = true; + break; + + case codeType.Udc: + cmp_barcode.showOutput("badge badge-success", $"{decoData.description}"); + //doRaiseEv = true; + break; + //case codeType.Batch: + // cmp_barcode.showOutput("badge badge-warning", $"Batch - ignored: {decoData.description}"); + // doRaiseEv = true; + // break; + //case codeType.Cart: + // cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}"); + // processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + // break; + //case codeType.Bin: + // cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}"); + // processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt); + // break; + //default: + // cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action"); + // resetSelection(false); + // break; + } + + return doRaiseEv; + } + + /// + /// Processo il codice letto + /// + /// + /// + /// + private void processSuggestion(codeType tipoCod, string rawData, int codeInt) + { + //DS_App.ItemListDataTable tabItem = null; + // processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero) + switch (tipoCod) + { + case codeType.Lotto: + // IN PRIMIS cerco lotto valido + DS_Mag.ElencoLottiDataTable tabLotti; + tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "*", codStatoIN); + if (tabLotti.Count == 1) + { + // se trovato cerco in elenco --> aggiungo in lista se non c'è + var currLotti = lottiSel; + if (!currLotti.Contains(rawData)) + { + currLotti.Add(rawData); + lottiSel = currLotti; + } + } + break; + //case codeType.Item: + // tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData, 0, 999); + // if (tabItem.Count == 1) + // { + // showItemDetail(true, tabItem[0], false); + // } + // else if (tabItem.Count == 0) + // { + // showItemDetail(false, null, true); + // } + // break; + //case codeType.ItemGeneric: + // // PRIMA CERCSE ne ho in stato 1..3 + // tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 3); + // if (tabItem.Count == 0) + // { + // // se NON ne trovo cerci FINO a stato 5... + // tabItem = DataLayer.man.taIL.getBySearch(0, rawData, 1, 5); + // } + // if (tabItem.Count == 1) + // { + // showItemDetail(true, tabItem[0], false); + // } + // else if (tabItem.Count == 0) + // { + // showItemDetail(false, null, true); + // } + // break; + //case codeType.Cart: + // // verifico NON SIA richiesto PAINT + // if (showBin) + // { + // displError("PAINT: BIN REQUESTED: please retry", true); + // } + // else + // { + // if (currCartTab.Count == 1) + // { + // // controllo se sia quello corretto + // if (rawData != currCartTab[0].CartDtmx) + // { + // displError("INCORRECT CART: please retry", true); + // } + // else + // { + // // dichiaro che è depositato + // DataLayer.man.taIL.updateStatus(itemIdSelected, 3, PlaceId); + // lblDestination.Text = $"Item {itemIdSelected} PUT IN CART {rawData}"; + // resetSelection(false); + // } + // } + // } + // break; + //case codeType.Bin: + // // verifico NON SIA richiesto PAINT + // if (showCart) + // { + // displError("NOT PAINTED: CART REQUESTED: please retry", true); + // } + // else + // { + // if (currBinTab.Count == 1) + // { + // // controllo se sia quello corretto + // if (rawData != currBinTab[0].BinDtmx) + // { + // displError("INCORRECT BIN: please retry", true); + // } + // else + // { + // // dichiaro che è depositato + // DataLayer.man.taIL.updateStatus(itemIdSelected, 4, PlaceId); + // lblDestination.Text = $"Item {itemIdSelected} PUT IN BIN {rawData}"; + // resetSelection(false); + // } + // } + // } + // break; + default: + break; + } + } + + private void resetIcons() + { +#if false + lblDestination.CssClass = "text-secondary"; + lblMessage.Text = ""; + lblDestination.Text = ""; + lblLastBCode.Text = ""; + lbtCancel.Visible = false; + lbtScrapped.Visible = false; + lbtParkArea.Visible = false; + lbtResetSel.Visible = (itemIdSelected != 0); +#endif + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// Caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + lottiSel = new List(); + cmp_creaLottoOUT.Visible = false; + cmp_printLottoOUT.Visible = false; + } + // eventi barcode + cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh; + // eventi reset lotti IN + cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset; + cmp_LottiIn.eh_doReset += cmp_LottiIn_eh_doReset; + // selezione articoli + cmp_ArtOut.eh_doRefresh += cmp_ArtOut_eh_doRefresh; + cmp_ArtOut.eh_doReset += cmp_ArtOut_eh_doReset; + // selezione lotti esistenti x stampa + cmp_LottiOut.eh_doRefresh += cmp_LottiOut_eh_doRefresh; + cmp_LottiOut.eh_doReset += cmp_LottiOut_eh_doReset; + // eventi di creazione lotto e stampa + cmp_creaLottoOUT.eh_doRefresh += Cmp_creaLottoOUT_eh_doRefresh; + cmp_printLottoOUT.eh_doRefresh += Cmp_printLottoOUT_eh_doRefresh; + } + + /// + /// Reset selezione item + blocchi suggerimento + sel REDIS x pagina unload + /// + /// + protected void resetSelection(bool resetStatus) + { +#if false + if (resetStatus) + { + try + { + // SE item esiste... + var tabItem = DataLayer.man.taIL.getBySearch(itemIdSelected, itemIdSelected.ToString(), 0, 999); + if (tabItem.Count == 1) + { + // riposto item a status 1... + DataLayer.man.taIL.updateStatus(itemIdSelected, 1, PlaceId); + } + } + catch + { } + } + // elimino item sel... + itemIdSelected = 0; + resetShowData(); + ComLib.resetItemPickup(SheetID, DeviceId); +#endif + } + + /// + /// Mostra buttons crea/stampa lotto + /// + /// + /// + protected void showCreaStampa(bool showCrea, bool showPrint) + { + cmp_creaLottoOUT.Visible = showCrea; + cmp_printLottoOUT.Visible = showPrint; + } + + #endregion Protected Methods + +#if false + /// + /// Mostra o nasconde dettaglio su ITEM letto + /// + /// + /// + /// + private void showItemDetail(bool showItem, DS_App.ItemListRow itemRow, bool showError) + { + resetShowData(); + divItemDet.Visible = showItem; + divItemError.Visible = showError; + if (showError) + { + displError("Item not found", true); + } + if (showItem) + { + lblItemCode.Text = itemRow.ItemExtCode; + lblItemDesc.Text = itemRow.ItemDesc; + lblItemDtmx.Text = itemRow.ItemDtmx; + itemIdSelected = itemRow.ItemID; + // CONTROLLO SIA in stato 1 --> worked, 2--> selected, 100--> parked... + switch (itemRow.StatusID) + { + case 0: + displError("ERROR: Item not ready", false); + break; + + case 1: + case 2: + case 100: + // salvo che è in STATO 2 (picked up) + DataLayer.man.taIL.updateStatus(itemRow.ItemID, 2, PlaceId); + // verifico cosa devo mostrare come PROX passaggio... + showCart = itemRow.ProcessesReq == ""; + showBin = (itemRow.ProcessesReq.Contains("PaintFlag")); + secOp = itemRow.PostProcList; + showSecOp = (secOp != ""); + doUpdate(); + break; + + case 3: + displError("Item already on CART!", false); + break; + + case 4: + // fino a concorrenza qta richiesta sposto, POI do errori + displError("ALL Item already scanned on BIN!", false); + break; + + case 5: + displError("Item already at KIT STATION!", false); + break; + + case 990: + displError("Item declared SCRAP!", false); + break; + + case 991: + displError("Item declared SCRAP with CNC program created!", false); + break; + + default: + displError("ERROR: Item status UNKNOWN!", false); + break; + } + } + lbtResetSel.Visible = (itemIdSelected != 0); + } #endif } - } } \ No newline at end of file diff --git a/MagData/DS_Report.Designer.cs b/MagData/DS_Report.Designer.cs index bd6583b7..3795db82 100644 --- a/MagData/DS_Report.Designer.cs +++ b/MagData/DS_Report.Designer.cs @@ -386,9 +386,11 @@ namespace MagData { private global::System.Data.DataColumn columnIdxPrintJob; - private global::System.Data.DataColumn columnprinterQueue; + private global::System.Data.DataColumn columnTipoReport; - private global::System.Data.DataColumn columnkeyParam; + private global::System.Data.DataColumn columnKeyParam; + + private global::System.Data.DataColumn columnprtName; private global::System.Data.DataColumn columndtStart; @@ -441,17 +443,25 @@ namespace MagData { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn printerQueueColumn { + public global::System.Data.DataColumn TipoReportColumn { get { - return this.columnprinterQueue; + return this.columnTipoReport; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn keyParamColumn { + public global::System.Data.DataColumn KeyParamColumn { get { - return this.columnkeyParam; + return this.columnKeyParam; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn prtNameColumn { + get { + return this.columnprtName; } } @@ -524,12 +534,13 @@ namespace MagData { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public PrintJobQueueRow AddPrintJobQueueRow(string printerQueue, string keyParam, System.DateTime dtStart, System.DateTime dtEnd, int stato, System.DateTime dtLastTry) { + public PrintJobQueueRow AddPrintJobQueueRow(string TipoReport, string KeyParam, string prtName, System.DateTime dtStart, System.DateTime dtEnd, int stato, System.DateTime dtLastTry) { PrintJobQueueRow rowPrintJobQueueRow = ((PrintJobQueueRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, - printerQueue, - keyParam, + TipoReport, + KeyParam, + prtName, dtStart, dtEnd, stato, @@ -564,8 +575,9 @@ namespace MagData { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] internal void InitVars() { this.columnIdxPrintJob = base.Columns["IdxPrintJob"]; - this.columnprinterQueue = base.Columns["printerQueue"]; - this.columnkeyParam = base.Columns["keyParam"]; + this.columnTipoReport = base.Columns["TipoReport"]; + this.columnKeyParam = base.Columns["KeyParam"]; + this.columnprtName = base.Columns["prtName"]; this.columndtStart = base.Columns["dtStart"]; this.columndtEnd = base.Columns["dtEnd"]; this.columnstato = base.Columns["stato"]; @@ -577,10 +589,12 @@ namespace MagData { private void InitClass() { this.columnIdxPrintJob = new global::System.Data.DataColumn("IdxPrintJob", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnIdxPrintJob); - this.columnprinterQueue = new global::System.Data.DataColumn("printerQueue", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnprinterQueue); - this.columnkeyParam = new global::System.Data.DataColumn("keyParam", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnkeyParam); + this.columnTipoReport = new global::System.Data.DataColumn("TipoReport", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnTipoReport); + this.columnKeyParam = new global::System.Data.DataColumn("KeyParam", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnKeyParam); + this.columnprtName = new global::System.Data.DataColumn("prtName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnprtName); this.columndtStart = new global::System.Data.DataColumn("dtStart", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columndtStart); this.columndtEnd = new global::System.Data.DataColumn("dtEnd", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); @@ -597,10 +611,12 @@ namespace MagData { this.columnIdxPrintJob.AllowDBNull = false; this.columnIdxPrintJob.ReadOnly = true; this.columnIdxPrintJob.Unique = true; - this.columnprinterQueue.AllowDBNull = false; - this.columnprinterQueue.MaxLength = 500; - this.columnkeyParam.AllowDBNull = false; - this.columnkeyParam.MaxLength = 50; + this.columnTipoReport.AllowDBNull = false; + this.columnTipoReport.MaxLength = 250; + this.columnKeyParam.AllowDBNull = false; + this.columnKeyParam.MaxLength = 50; + this.columnprtName.AllowDBNull = false; + this.columnprtName.MaxLength = 500; this.columndtStart.AllowDBNull = false; this.columnstato.AllowDBNull = false; } @@ -3164,23 +3180,34 @@ namespace MagData { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string printerQueue { + public string TipoReport { get { - return ((string)(this[this.tablePrintJobQueue.printerQueueColumn])); + return ((string)(this[this.tablePrintJobQueue.TipoReportColumn])); } set { - this[this.tablePrintJobQueue.printerQueueColumn] = value; + this[this.tablePrintJobQueue.TipoReportColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string keyParam { + public string KeyParam { get { - return ((string)(this[this.tablePrintJobQueue.keyParamColumn])); + return ((string)(this[this.tablePrintJobQueue.KeyParamColumn])); } set { - this[this.tablePrintJobQueue.keyParamColumn] = value; + this[this.tablePrintJobQueue.KeyParamColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public string prtName { + get { + return ((string)(this[this.tablePrintJobQueue.prtNameColumn])); + } + set { + this[this.tablePrintJobQueue.prtNameColumn] = value; } } @@ -6409,8 +6436,9 @@ namespace MagData.DS_ReportTableAdapters { tableMapping.SourceTable = "Table"; tableMapping.DataSetTable = "PrintJobQueue"; tableMapping.ColumnMappings.Add("IdxPrintJob", "IdxPrintJob"); - tableMapping.ColumnMappings.Add("printerQueue", "printerQueue"); - tableMapping.ColumnMappings.Add("keyParam", "keyParam"); + tableMapping.ColumnMappings.Add("TipoReport", "TipoReport"); + tableMapping.ColumnMappings.Add("KeyParam", "KeyParam"); + tableMapping.ColumnMappings.Add("prtName", "prtName"); tableMapping.ColumnMappings.Add("dtStart", "dtStart"); tableMapping.ColumnMappings.Add("dtEnd", "dtEnd"); tableMapping.ColumnMappings.Add("stato", "stato"); @@ -6418,11 +6446,12 @@ namespace MagData.DS_ReportTableAdapters { this._adapter.TableMappings.Add(tableMapping); this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand(); this._adapter.DeleteCommand.Connection = this.Connection; - this._adapter.DeleteCommand.CommandText = @"DELETE FROM [PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([printerQueue] = @Original_printerQueue) AND ([keyParam] = @Original_keyParam) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry)))"; + this._adapter.DeleteCommand.CommandText = @"DELETE FROM [PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoReport] = @Original_TipoReport) AND ([KeyParam] = @Original_KeyParam) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry)))"; this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxPrintJob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxPrintJob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_printerQueue", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "printerQueue", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_keyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "keyParam", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TipoReport", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoReport", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_KeyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyParam", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_dtEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); @@ -6442,18 +6471,20 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtLastTry", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtLastTry", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand(); this._adapter.UpdateCommand.Connection = this.Connection; - this._adapter.UpdateCommand.CommandText = @"UPDATE [PrintJobQueue] SET [printerQueue] = @printerQueue, [keyParam] = @keyParam, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato, [dtLastTry] = @dtLastTry WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([printerQueue] = @Original_printerQueue) AND ([keyParam] = @Original_keyParam) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))); -SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob)"; + this._adapter.UpdateCommand.CommandText = @"UPDATE [PrintJobQueue] SET [TipoReport] = @TipoReport, [KeyParam] = @KeyParam, [prtName] = @prtName, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato, [dtLastTry] = @dtLastTry WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoReport] = @Original_TipoReport) AND ([KeyParam] = @Original_KeyParam) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))); +SELECT IdxPrintJob, TipoReport, KeyParam, prtName, dtStart, dtEnd, stato, dtLastTry FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob)"; this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@printerQueue", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "printerQueue", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@keyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "keyParam", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TipoReport", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoReport", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyParam", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@stato", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "stato", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtLastTry", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtLastTry", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxPrintJob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxPrintJob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_printerQueue", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "printerQueue", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_keyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "keyParam", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TipoReport", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoReport", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_KeyParam", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyParam", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_dtEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); @@ -6476,7 +6507,7 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO this._commandCollection = new global::System.Data.SqlClient.SqlCommand[10]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT *\r\nFROM PrintJobQueue"; + this._commandCollection[0].CommandText = "SELECT * FROM PrintJobQueue"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; @@ -6517,8 +6548,9 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO this._commandCollection[7].CommandText = "dbo.stp_PJQ_insert"; this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TipoReport", global::System.Data.SqlDbType.VarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@keyParam", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@printerQueue", global::System.Data.SqlDbType.VarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@prtName", global::System.Data.SqlDbType.VarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[8].Connection = this.Connection; this._commandCollection[8].CommandText = "dbo.stp_PJQ_updateLastTry"; @@ -6691,19 +6723,25 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int insertQuery(string keyParam, string printerQueue) { + public virtual int insertQuery(string TipoReport, string keyParam, string prtName) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; - if ((keyParam == null)) { + if ((TipoReport == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } else { - command.Parameters[1].Value = ((string)(keyParam)); + command.Parameters[1].Value = ((string)(TipoReport)); } - if ((printerQueue == null)) { + if ((keyParam == null)) { command.Parameters[2].Value = global::System.DBNull.Value; } else { - command.Parameters[2].Value = ((string)(printerQueue)); + command.Parameters[2].Value = ((string)(keyParam)); + } + if ((prtName == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(prtName)); } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) diff --git a/MagData/DS_Report.xsd b/MagData/DS_Report.xsd index 75d3986a..9138c891 100644 --- a/MagData/DS_Report.xsd +++ b/MagData/DS_Report.xsd @@ -12,11 +12,12 @@ - DELETE FROM [PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([printerQueue] = @Original_printerQueue) AND ([keyParam] = @Original_keyParam) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))) + DELETE FROM [PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoReport] = @Original_TipoReport) AND ([KeyParam] = @Original_KeyParam) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))) - - + + + @@ -41,26 +42,27 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - - SELECT * -FROM PrintJobQueue + + SELECT * FROM PrintJobQueue - UPDATE [PrintJobQueue] SET [printerQueue] = @printerQueue, [keyParam] = @keyParam, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato, [dtLastTry] = @dtLastTry WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([printerQueue] = @Original_printerQueue) AND ([keyParam] = @Original_keyParam) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))); -SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob) + UPDATE [PrintJobQueue] SET [TipoReport] = @TipoReport, [KeyParam] = @KeyParam, [prtName] = @prtName, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato, [dtLastTry] = @dtLastTry WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoReport] = @Original_TipoReport) AND ([KeyParam] = @Original_KeyParam) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato) AND ((@IsNull_dtLastTry = 1 AND [dtLastTry] IS NULL) OR ([dtLastTry] = @Original_dtLastTry))); +SELECT IdxPrintJob, TipoReport, KeyParam, prtName, dtStart, dtEnd, stato, dtLastTry FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob) - - + + + - - + + + @@ -75,8 +77,9 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - - + + + @@ -153,8 +156,9 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO dbo.stp_PJQ_insert + - + @@ -347,24 +351,31 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - + - + - + - + + + + + + + + @@ -372,7 +383,7 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - + @@ -980,7 +991,7 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - + @@ -1031,7 +1042,7 @@ SELECT IdxPrintJob, printerQueue, keyParam, dtStart, dtEnd, stato, dtLastTry FRO - + diff --git a/MagData/Enum.cs b/MagData/Enum.cs index f14b9e83..d178b77c 100644 --- a/MagData/Enum.cs +++ b/MagData/Enum.cs @@ -33,4 +33,30 @@ namespace MagData CartellinoPedane, CartellinoSemilavorati } + + /// + /// tipologia di DOCUMENTO gestito in stampa... + /// + public enum tipoDocumento + { + /// + /// Etichetta Odete x prodotti finiti + /// + docFinito, + + /// + /// Etichetta per pedana (AL) + /// + docPedana, + + /// + /// Etichetta per un Semilavorato + /// + docSemilavorato, + + /// + /// NON DEFINITO + /// + docND + } } \ No newline at end of file diff --git a/MagData/MagDataLayer.cs b/MagData/MagDataLayer.cs index 8fd3667c..a0205a6e 100644 --- a/MagData/MagDataLayer.cs +++ b/MagData/MagDataLayer.cs @@ -26,6 +26,16 @@ namespace MagData public static string redQueueConf = "MP-CTRACK:MAG:queueConf"; + /// + /// chaive redis x cache conteggio coda PJQ + /// + public static string redQueueCount = "MP:MAG:PJQ"; + + /// + /// chaive redis x cache conteggio coda PJQ composta da tante code + /// + public static string redQueueCountSet = "MP:MAG:PJQCOUNT"; + public DS_MagTableAdapters.AnagArtTableAdapter taAA; public DS_MagTableAdapters.AnagArticoli2ClientiTableAdapter taAA2C; public DS_ReportTableAdapters.stp_prt_CartellinoFinitiOdetteTableAdapter taCFOdette; @@ -377,15 +387,19 @@ namespace MagData /// /// Codice UNIVOCO del documento /// stampante specifica (da postazione o std da web.config, a cura dell'utente + /// Tipo documento richiesto /// IP del chiamante /// - public bool stampaDoc(string keyParam, string printQueue, string clientIp) + public bool stampaDoc(string keyParam, string printQueue, tipoDocumento tipoDoc, string clientIp) { bool answ = false; // controllo se esista UDC if (checkDoc(printQueue, keyParam)) { - answ = reportPrinter.obj.stampaReport(keyParam, printQueue); + answ = reportPrinter.obj.stampaReport(tipoDoc, keyParam, printQueue); + // svuoto code redis salvate.. + memLayer.ML.redFlushKey(redQueueCount); + memLayer.ML.redFlushKey(redQueueCountSet); if (answ) { SteamWare.Logger.Logging.Instance.Info($" | {clientIp} | salvata richiesta stampa su coda {printQueue} | key {keyParam}"); diff --git a/MagData/reportPrinter.cs b/MagData/reportPrinter.cs index 91aa8f26..9d990f6b 100644 --- a/MagData/reportPrinter.cs +++ b/MagData/reportPrinter.cs @@ -10,471 +10,365 @@ using System.Drawing.Printing; using System.IO; using System.Text; - namespace MagData { - /// - /// Classe che si occupa di stampare report da reportViewer via printer remota - /// - public class reportPrinter - { - #region area codice da non modificare + /// + /// Classe che si occupa di stampare report da reportViewer via printer remota + /// + public class reportPrinter + { + #region Private Fields - private int m_currentPageIndex; - protected int logLevel = 0; - protected bool doPdfCopy = false; - /// - /// stream del report... - /// - private IList m_streams; - /// - /// ciclo da fornire al renderizzatore dei report, per salvare 1 immagine da ogni pagina del report - /// - /// - /// - /// - /// - /// - /// - private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) - { - // creo files con nomi univoci... - string filePathName = string.Format(@"~\temp\{0}_{1:HHmmss}_{1:ffff}.{2}", name, DateTime.Now, fileNameExtension); - Stream stream = new FileStream(fileMover.getFilePath(filePathName), FileMode.Create); - //Stream stream = new FileStream(fileMover.getFilePath(@"~\temp\" + name + "." + fileNameExtension), FileMode.Create); - m_streams.Add(stream); - return stream; - } - /// - /// ciclo da fornire al renderizzatore dei report, per salvare 1 pdf da ogni pagina del report - /// - /// - /// - /// - /// - /// - /// - private Stream CreateStreamPdf(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) - { - // creo Directory se non c'è - fileMover fm = new fileMover(string.Format(@"{0}\{1:yyyy}\{1:MM}\{1:dd}\", memLayer.ML.confReadString("PdfFolder"), DateTime.Now), ""); - fm.checkDir(); - string pdfPathName = string.Format(@"{0}\{1:yyyy}\{1:MM}\{1:dd}\{2}_{1:HHmmss}_{1:ffff}.{3}", memLayer.ML.confReadString("PdfFolder"), DateTime.Now, name, fileNameExtension); - //Stream stream = new FileStream(fileMover.getFilePath(@"~\temp\" + name + "." + fileNameExtension), FileMode.Create); - Stream stream = new FileStream(fileMover.getFilePath(pdfPathName), FileMode.Create); - m_streams.Add(stream); - return stream; - } - /// - /// Handler per PrintPageEvents - /// - /// - /// - private void PrintPage(object sender, PrintPageEventArgs ev) - { - Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]); - ev.Graphics.DrawImage(pageImage, ev.PageBounds); - m_currentPageIndex++; - ev.HasMorePages = (m_currentPageIndex < m_streams.Count); - } - /// - /// funzione di stampa... - /// - private void Print(string printerName) - { - //const string printerName = "Microsoft Office Document Image Writer"; - //const string printerName = "Brother HL-2170W series"; - if (m_streams == null || m_streams.Count == 0) - { - return; - } + private int m_currentPageIndex; - PrintDocument printDoc = new PrintDocument(); - printDoc.PrinterSettings.PrinterName = printerName; - if (!printDoc.PrinterSettings.IsValid) - { - Logging.Instance.Error($"Impostazioni non valide per la stampante {printerName}"); - return; - } - printDoc.PrintPage += new PrintPageEventHandler(PrintPage); - printDoc.Print(); - } - /// - /// Export del report come EMF (Enhanced Metafile) file. - /// - /// - private void Export(LocalReport report, string deviceInfo) - { - Warning[] warnings; - m_streams = new List(); - report.Render("Image", deviceInfo, CreateStream, out warnings); - foreach (Stream stream in m_streams) - { - stream.Position = 0; - } - } - /// - /// Export del report come PDF file. - /// - /// - private void ExportPDF(LocalReport report, string deviceInfo) - { - Warning[] warnings; - m_streams = new List(); - report.Render("PDF", deviceInfo, CreateStreamPdf, out warnings); - foreach (Stream stream in m_streams) - { - stream.Position = 0; - } - } - /// - /// dispone l'applicazione e rilascia le risorse - /// - public void Dispose() - { - if (m_streams != null) - { - foreach (Stream stream in m_streams) + /// + /// stream del report... + /// + private IList m_streams; + + #endregion Private Fields + + #region Protected Fields + + protected bool doPdfCopy = false; + protected int logLevel = 0; + + #endregion Protected Fields + + #region Public Fields + + /// + /// singleton pubblico + /// + public static reportPrinter obj = new reportPrinter(); + + #endregion Public Fields + + #region Protected Constructors + + /// + /// oggetto protected + /// + /// + protected reportPrinter() { - stream.Close(); + logLevel = memLayer.ML.CRI("_logLevel"); + doPdfCopy = memLayer.ML.CRB("doPdfCopy"); } - m_streams = null; - } + #endregion Protected Constructors + + #region Private Methods + + /// + /// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...) + /// + /// + /// cod UDC + /// tabella dati + private DataTable caricaDati(reportRichiesto tipoReport, string keyParam) + { + DataTable tab = new DataTable(); + switch (tipoReport) + { + case reportRichiesto.CartellinoPedane: + tab = MagDataLayer.man.taCPed.GetData(keyParam); + break; + + case reportRichiesto.CartellinoFinitiOdette: + tab = MagDataLayer.man.taCFOdette.GetData(keyParam); + break; + + default: + break; + } + return tab; + } + + /// + /// ciclo da fornire al renderizzatore dei report, per salvare 1 immagine da ogni pagina del report + /// + /// + /// + /// + /// + /// + /// + private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) + { + // creo files con nomi univoci... + string filePathName = string.Format(@"~\temp\{0}_{1:HHmmss}_{1:ffff}.{2}", name, DateTime.Now, fileNameExtension); + Stream stream = new FileStream(fileMover.getFilePath(filePathName), FileMode.Create); + //Stream stream = new FileStream(fileMover.getFilePath(@"~\temp\" + name + "." + fileNameExtension), FileMode.Create); + m_streams.Add(stream); + return stream; + } + + /// + /// ciclo da fornire al renderizzatore dei report, per salvare 1 pdf da ogni pagina del report + /// + /// + /// + /// + /// + /// + /// + private Stream CreateStreamPdf(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek) + { + // creo Directory se non c'è + fileMover fm = new fileMover(string.Format(@"{0}\{1:yyyy}\{1:MM}\{1:dd}\", memLayer.ML.confReadString("PdfFolder"), DateTime.Now), ""); + fm.checkDir(); + string pdfPathName = string.Format(@"{0}\{1:yyyy}\{1:MM}\{1:dd}\{2}_{1:HHmmss}_{1:ffff}.{3}", memLayer.ML.confReadString("PdfFolder"), DateTime.Now, name, fileNameExtension); + //Stream stream = new FileStream(fileMover.getFilePath(@"~\temp\" + name + "." + fileNameExtension), FileMode.Create); + Stream stream = new FileStream(fileMover.getFilePath(pdfPathName), FileMode.Create); + m_streams.Add(stream); + return stream; + } + + /// + /// esegue print vero e proprio + /// + /// + /// + /// + private void doEmfPrint(string printerName, LocalReport report, string deviceInfo) + { + // export in EMF + Export(report, deviceInfo); + m_currentPageIndex = 0; + // stampo + Print(printerName); + // do dispose? + Dispose(); + } + + /// + /// effettua stampa in PDF dei vari report in una cartella Anno/Mese/Giorno + /// + /// + /// + private void doLocalPdfPrint(LocalReport report, string deviceInfo) + { + // export in PDF + ExportPDF(report, deviceInfo); + m_currentPageIndex = 0; + // do dispose? + Dispose(); + } + + /// + /// Export del report come EMF (Enhanced Metafile) file. + /// + /// + private void Export(LocalReport report, string deviceInfo) + { + Warning[] warnings; + m_streams = new List(); + report.Render("Image", deviceInfo, CreateStream, out warnings); + foreach (Stream stream in m_streams) + { + stream.Position = 0; + } + } + + /// + /// Export del report come PDF file. + /// + /// + private void ExportPDF(LocalReport report, string deviceInfo) + { + Warning[] warnings; + m_streams = new List(); + report.Render("PDF", deviceInfo, CreateStreamPdf, out warnings); + foreach (Stream stream in m_streams) + { + stream.Position = 0; + } + } + + /// + /// funzione di stampa... + /// + private void Print(string printerName) + { + //const string printerName = "Microsoft Office Document Image Writer"; + //const string printerName = "Brother HL-2170W series"; + if (m_streams == null || m_streams.Count == 0) + { + return; + } + + PrintDocument printDoc = new PrintDocument(); + printDoc.PrinterSettings.PrinterName = printerName; + if (!printDoc.PrinterSettings.IsValid) + { + Logging.Instance.Error($"Impostazioni non valide per la stampante {printerName}"); + return; + } + printDoc.PrintPage += new PrintPageEventHandler(PrintPage); + printDoc.Print(); + } + + /// + /// effettua la vera e propria fase di stampa + /// + /// + /// + /// + /// + /// + /// + private bool printAndLog(string keyParam, string printerName, bool answ, reportRichiesto report, devInfoParam deviceInfo) + { + try + { + if (logLevel > 5) + { + Logging.Instance.Info(String.Format("Sto per inviare un report alla stampante {0}", printerName)); + } + + reportPrinter.obj.printReport(report, printerName, keyParam, deviceInfo); + if (logLevel > 5) + { + Logging.Instance.Info(String.Format("inviato comando print alla stampante {0}", printerName)); + } + + answ = true; + } + catch (Exception e) + { + Logging.Instance.Error(String.Format("Errore in fase di creazione e stampa report: stampante {0}, errore riscontrato {1}", printerName, e)); + } + return answ; + } + + /// + /// Handler per PrintPageEvents + /// + /// + /// + private void PrintPage(object sender, PrintPageEventArgs ev) + { + Metafile pageImage = new Metafile(m_streams[m_currentPageIndex]); + ev.Graphics.DrawImage(pageImage, ev.PageBounds); + m_currentPageIndex++; + ev.HasMorePages = (m_currentPageIndex < m_streams.Count); + } + + #endregion Private Methods + + #region Public Methods + + /// + /// dispone l'applicazione e rilascia le risorse + /// + public void Dispose() + { + if (m_streams != null) + { + foreach (Stream stream in m_streams) + { + stream.Close(); + } + + m_streams = null; + } + } + + /// + /// Crea un report locale da file rdlc, carica i dati, esporta report come EMF file e quindi lo invia alla stampante + /// + /// report ammessi: ElencoMacchine / RichiestaIntervento + /// nome completo stampante (rispetto al server) + /// cod UDC + /// parametri "device input" + public void printReport(reportRichiesto tipoReport, string printerName, string keyParam, devInfoParam deviceInfoParam) + { + LocalReport report = new LocalReport(); + report.EnableExternalImages = true; + string deviceInfo = ""; + string repoBasePath = utils.getPath(memLayer.ML.cdv("ReportBasePath")); + repoBasePath = repoBasePath.Replace("\\site", ""); + switch (tipoReport) + { + case reportRichiesto.CartellinoPedane: + report.ReportPath = string.Format(@"{0}\PartLabel.rdlc", repoBasePath); + report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocPart"), caricaDati(tipoReport, keyParam))); + break; + + case reportRichiesto.CartellinoFinitiOdette: + report.ReportPath = string.Format(@"{0}\StackLabel.rdlc", repoBasePath); + report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocStack"), caricaDati(tipoReport, keyParam))); + break; + } + deviceInfo = deviceInfoParam.xmlParam; + doEmfPrint(printerName, report, deviceInfo); + // controllo se devo fare copia PDF... stampiamo ANCHE su pdf su una folder locale + if (doPdfCopy) + { + deviceInfoParam.OutputFormat = "PDF"; + deviceInfo = deviceInfoParam.xmlParam; + doLocalPdfPrint(report, deviceInfo); + } + } + + /// + /// effettua pulizia della cartella temp x i files più vecchi di X ore (web.config) + /// + public void pulisciDir() + { + // num max ore di età x files "vecchi" da tenere in temp area... + int maxOre = memLayer.ML.CRI("maxAgeTempAreaHours"); + int eliminati = 0; + // ottengo elenco files *.emf + fileMover.obj.setDirectory(@"~\temp\"); + FileInfo[] _fis = fileMover.obj.elencoFiles_FI("*.emf"); + bool fatto = false; + foreach (FileInfo _file in _fis) + { + if (_file.CreationTime < DateTime.Now.AddHours(-maxOre)) // elimino files vecchi... + { + fatto = fileMover.obj.eliminaFile(_file); + if (fatto) + { + Logging.Instance.Info(String.Format("Eliminato file {0}", _file.Name)); + eliminati++; + } + } + } + // salvo il log degli update + if (eliminati > 0) + { + Logging.Instance.Info(String.Format("Eliminati {0} files temporanei da area temp", eliminati)); + } + } + + /// + /// Effettua la stampa del documento indicato + /// + /// tipo di documento dastampare + /// coda di stampa da utilizzare + /// Chiave del documento + /// + public bool stampaReport(tipoDocumento documento, string printerName, string keyParam) + { + bool answ = false; + MagDataLayer dtProx = new MagDataLayer(); + // gestione coda stampa... + + // incomincio con gestione della coda di stampa... inserisco in tab la richiesta di stampa... + if (memLayer.ML.CRB("disable_singleton")) + { + dtProx.taPJQ.insertQuery(documento.ToString(), keyParam, printerName); + } + else + { + MagDataLayer.man.taPJQ.insertQuery(documento.ToString(), keyParam, printerName); + } + + return answ; + } + + #endregion Public Methods } - - - #endregion - - #region area codice da modificare - - /// - /// carica i dati richiesti dal report dalla StoredProcedure (filtrando quindi...) - /// - /// - /// cod UDC - /// tabella dati - private DataTable caricaDati(reportRichiesto tipoReport, string keyParam) - { - DataTable tab = new DataTable(); - switch (tipoReport) - { - case reportRichiesto.CartellinoPedane: - tab = MagDataLayer.man.taCPed.GetData(keyParam); - break; - case reportRichiesto.CartellinoFinitiOdette: - tab = MagDataLayer.man.taCFOdette.GetData(keyParam); - break; - default: - break; - } - return tab; - } - /// - /// Crea un report locale da file rdlc, carica i dati, esporta report come EMF file e quindi lo invia alla stampante - /// - /// report ammessi: ElencoMacchine / RichiestaIntervento - /// nome completo stampante (rispetto al server) - /// cod UDC - /// parametri "device input" - public void printReport(reportRichiesto tipoReport, string printerName, string keyParam, devInfoParam deviceInfoParam) - { - LocalReport report = new LocalReport(); - report.EnableExternalImages = true; - string deviceInfo = ""; - string repoBasePath = utils.getPath(memLayer.ML.cdv("ReportBasePath")); - repoBasePath = repoBasePath.Replace("\\site", ""); - switch (tipoReport) - { - case reportRichiesto.CartellinoPedane: - report.ReportPath = string.Format(@"{0}\PartLabel.rdlc", repoBasePath); - report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocPart"), caricaDati(tipoReport, keyParam))); - break; - case reportRichiesto.CartellinoFinitiOdette: - report.ReportPath = string.Format(@"{0}\StackLabel.rdlc", repoBasePath); - report.DataSources.Add(new ReportDataSource(memLayer.ML.cdv("ReportDS_DocStack"), caricaDati(tipoReport, keyParam))); - break; - } - deviceInfo = deviceInfoParam.xmlParam; - doEmfPrint(printerName, report, deviceInfo); - // controllo se devo fare copia PDF... stampiamo ANCHE su pdf su una folder locale - if (doPdfCopy) - { - deviceInfoParam.OutputFormat = "PDF"; - deviceInfo = deviceInfoParam.xmlParam; - doLocalPdfPrint(report, deviceInfo); - } - } - /// - /// esegue print vero e proprio - /// - /// - /// - /// - private void doEmfPrint(string printerName, LocalReport report, string deviceInfo) - { - // export in EMF - Export(report, deviceInfo); - m_currentPageIndex = 0; - // stampo - Print(printerName); - // do dispose? - Dispose(); - } - /// - /// effettua stampa in PDF dei vari report in una cartella Anno/Mese/Giorno - /// - /// - /// - private void doLocalPdfPrint(LocalReport report, string deviceInfo) - { - // export in PDF - ExportPDF(report, deviceInfo); - m_currentPageIndex = 0; - // do dispose? - Dispose(); - } - /// - /// Effettua la stampa del documento indicato - /// - /// coda di stampa da utilizzare - /// Chiave del documento - /// - public bool stampaReport(string printerQueue, string keyParam) - { - bool answ = false; - MagDataLayer dtProx = new MagDataLayer(); - // gestione coda stampa... - - // incomincio con gestione della coda di stampa... inserisco in tab la richiesta di stampa... - if (memLayer.ML.CRB("disable_singleton")) - { - dtProx.taPJQ.insertQuery(keyParam, printerQueue); - } - else - { - MagDataLayer.man.taPJQ.insertQuery(keyParam, printerQueue); - } -#if false - // faccio un ciclo while... finchè non sono "in testa" alla coda delle esecuzioni aspetto... - string nextJob = "ND"; - try - { - if (memLayer.ML.CRB("disable_singleton")) - { - nextJob = dtProx.taPJQ.getNext()[0].KeyParam; - } - else - { - nextJob = MagDataLayer.man.taPJQ.getNext()[0].KeyParam; - } - } - catch - { - nextJob = "ND"; - } - // verifico eventuali processi zombie: quelli in stato 0 con LastTry superiore a data attuale meno zombieMsTime - if (memLayer.ML.CRB("disable_singleton")) - { - dtProx.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime"))); - } - else - { - MagDataLayer.man.taPJQ.chiudiZoombie(DateTime.Now.AddMilliseconds(-memLayer.ML.CRI("zombieMsTime"))); - } - // ora inizio a fare le mie stampe... - Random rand = new Random(); - int msWait = 200; - while (nextJob != keyParam) - { - // indico che ho fatto un tentativo di stampa aggiornando dtLastTry - if (memLayer.ML.CRB("disable_singleton")) - { - dtProx.taPJQ.updateLastTry(keyParam); - } - else - { - MagDataLayer.man.taPJQ.updateLastTry(keyParam); - } - // aspetto... - msWait = rand.Next(memLayer.ML.confReadInt("minWait"), memLayer.ML.confReadInt("maxWait")); - System.Threading.Thread.Sleep(msWait); - // leggo prox record da coda - if (memLayer.ML.CRB("disable_singleton")) - { - nextJob = dtProx.taPJQ.getNext()[0].KeyParam; - } - else - { - nextJob = MagDataLayer.man.taPJQ.getNext()[0].KeyParam; - } - } - // salvo idx job... - try - { - if (memLayer.ML.CRB("disable_singleton")) - { - idxPrintJob = dtProx.taPJQ.getNext()[0].IdxPrintJob; - } - else - { - idxPrintJob = MagDataLayer.man.taPJQ.getNext()[0].IdxPrintJob; - } - } - catch (Exception exc) - { - logger.lg.scriviLog($"Errore in recupero IdxPrint Job:{exc}", tipoLog.EXCEPTION); - } - - // dimensioni pagina - string outForm = ""; - string pagWidth = ""; - string pagHeigth = ""; - string margin = ""; - reportRichiesto report = reportRichiesto.cartOdette; - string tipo = ""; - - switch (documento) - { - case tipoDocumento.docBinPre: - tipo = "DocPaint"; - report = reportRichiesto.paintLabelPre; - break; - case tipoDocumento.docBinPost: - tipo = "DocPaintPost"; - report = reportRichiesto.paintLabelPost; - break; - case tipoDocumento.docCart: - tipo = "DocCart"; - report = reportRichiesto.cartLabel; - break; - case tipoDocumento.docPart: - tipo = "DocPart"; - report = reportRichiesto.cartPedane; - break; - case tipoDocumento.docStack: - tipo = "DocStack"; - report = reportRichiesto.cartOdette; - break; - default: - break; - } - // carico di dati con lettura da web.config parametrica - if (string.IsNullOrEmpty(printerQueue)) - { - printerQueue = memLayer.ML.cdv(string.Format("printer{0}", tipo)); - } - outForm = "EMF"; - pagWidth = memLayer.ML.cdv(string.Format("PageWidth{0}", tipo)); - pagHeigth = memLayer.ML.cdv(string.Format("PageHeight{0}", tipo)); - margin = memLayer.ML.cdv(string.Format("Margin{0}", tipo)); - // compongo parametri stampa - devInfoParam deviceInfo = new devInfoParam(outForm, pagHeigth, pagWidth, margin, margin, margin, margin); - answ = printAndLog(keyParam, printerQueue, answ, report, deviceInfo); - if (answ) - { - // registro stampato in tabella queue... - if (memLayer.ML.CRB("disable_singleton")) - { - dtProx.taPJQ.updateStato(idxPrintJob, 1); - } - else - { - MagDataLayer.man.taPJQ.updateStato(idxPrintJob, 1); - } - } - else - { - // registro annullato in tab queue... - if (memLayer.ML.CRB("disable_singleton")) - { - dtProx.taPJQ.updateStato(idxPrintJob, -1); - } - else - { - MagDataLayer.man.taPJQ.updateStato(idxPrintJob, -1); - } - - } -#endif - return answ; - } - /// - /// effettua la vera e propria fase di stampa - /// - /// - /// - /// - /// - /// - /// - private bool printAndLog(string keyParam, string printerName, bool answ, reportRichiesto report, devInfoParam deviceInfo) - { - try - { - if (logLevel > 5) - { - Logging.Instance.Info(String.Format("Sto per inviare un report alla stampante {0}", printerName)); - } - - reportPrinter.obj.printReport(report, printerName, keyParam, deviceInfo); - if (logLevel > 5) - { - Logging.Instance.Info(String.Format("inviato comando print alla stampante {0}", printerName)); - } - - answ = true; - } - catch (Exception e) - { - Logging.Instance.Error(String.Format("Errore in fase di creazione e stampa report: stampante {0}, errore riscontrato {1}", printerName, e)); - } - return answ; - } - /// - /// oggetto protected - /// - /// - protected reportPrinter() - { - logLevel = memLayer.ML.CRI("_logLevel"); - doPdfCopy = memLayer.ML.CRB("doPdfCopy"); - } - /// - /// singleton pubblico - /// - public static reportPrinter obj = new reportPrinter(); - /// - /// effettua pulizia della cartella temp x i files più vecchi di X ore (web.config) - /// - public void pulisciDir() - { - // num max ore di età x files "vecchi" da tenere in temp area... - int maxOre = memLayer.ML.CRI("maxAgeTempAreaHours"); - int eliminati = 0; - // ottengo elenco files *.emf - fileMover.obj.setDirectory(@"~\temp\"); - FileInfo[] _fis = fileMover.obj.elencoFiles_FI("*.emf"); - bool fatto = false; - foreach (FileInfo _file in _fis) - { - if (_file.CreationTime < DateTime.Now.AddHours(-maxOre)) // elimino files vecchi... - { - fatto = fileMover.obj.eliminaFile(_file); - if (fatto) - { - Logging.Instance.Info(String.Format("Eliminato file {0}", _file.Name)); - eliminati++; - } - } - } - // salvo il log degli update - if (eliminati > 0) - { - Logging.Instance.Info(String.Format("Eliminati {0} files temporanei da area temp", eliminati)); - } - } - - #endregion - } -} +} \ No newline at end of file From 7c8e35e987169a4fa1b820208641f839b8124d70 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 13 Jan 2021 11:02:00 +0100 Subject: [PATCH 04/10] new rel number --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 733cc846..fc482227 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,7 +13,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1364']) { + withEnv(['NEXT_BUILD_NUMBER=1365']) { // env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' From f2b6d1da5f70b220fdb20c793e1809d8057a9492 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 13 Jan 2021 11:15:32 +0100 Subject: [PATCH 05/10] udpate report + pubblicazione rdlc --- MP-MAG/MP-MAG.csproj | 12 +- MP-MAG/Reports/CartellinoFinitiOdette.rdlc | 2865 ++++++++++---------- MP-MAG/Reports/CartellinoPedane.rdlc | 109 +- MP-MAG/Reports/CartellinoSemilavorati.rdlc | 200 +- 4 files changed, 1608 insertions(+), 1578 deletions(-) diff --git a/MP-MAG/MP-MAG.csproj b/MP-MAG/MP-MAG.csproj index d2bfefeb..1cdad8ae 100644 --- a/MP-MAG/MP-MAG.csproj +++ b/MP-MAG/MP-MAG.csproj @@ -852,9 +852,15 @@ - - - + + Always + + + Always + + + Always + diff --git a/MP-MAG/Reports/CartellinoFinitiOdette.rdlc b/MP-MAG/Reports/CartellinoFinitiOdette.rdlc index 062c8426..8858eb8e 100644 --- a/MP-MAG/Reports/CartellinoFinitiOdette.rdlc +++ b/MP-MAG/Reports/CartellinoFinitiOdette.rdlc @@ -1,1416 +1,6 @@  - - - - - - - - 19cm - - - - - 12.8cm - - - - - - - - - - - true - - - - - =Fields!Campo1_2.Value - - - - - - - true - - - - - =Fields!Campo1_1.Value - - - - - - - true - - - - - =Fields!Campo1_3.Value - - - - - - - true - - - - - =Fields!Campo1_4.Value - - - - - - - ContentsOnly - 0.1cm - 1.9cm - 9.2cm - - - - - - - true - - - - - =Fields!Campo2_4.Value - - - - - - - true - - - - - =Fields!Campo2_2.Value - - - - - - - true - - - - - =Fields!Campo2_3.Value - - - - - - - ContentsOnly - 9.4cm - 1.9cm - 9.5cm - 1 - - 0.5pt - - - - - 6.4cm - 0cm - 19cm - 3 - - 0.5pt - - - - - 1.9cm - 0cm - 19cm - 4 - - 0.5pt - - - - - 3.9cm - 9.4cm - -3.89577cm - 0cm - 5 - - 0.5pt - - - - - 12.8cm - 9.4cm - -6.4cm - 0cm - 6 - - 0.5pt - - - - - 8.8cm - 0cm - 9.37989cm - 7 - - 0.5pt - - - - - 10.8cm - 0cm - 9.37989cm - 8 - - 0.5pt - - - - - 7.6cm - 9.4cm - 0cm - 9.6cm - 9 - - 0.5pt - - - - - 10.8cm - 9.4cm - 0cm - 9.6cm - 10 - - 0.5pt - - - - - 9.5cm - 9.4cm - 0cm - 9.6cm - 11 - - 0.5pt - - - - - true - - - - - =Fields!Campo3_1.Value - - - - - - - 2.9cm - 9.4cm - 0cm - 9.6cm - 13 - - 0.5pt - - - - - true - - - - - =Fields!Campo4_1.Value - - - - - - - true - - - - - =Fields!Campo5_1.Value - - - - - - - true - - - - - =Fields!Campo3_2.Value - - - - - - - true - - - - - =Fields!Campo4_2.Value - - - - - - - textbox7 - 2.2cm - 9.5cm - 0.55889cm - 9.4cm - 17 - - - - true - - - - - =Fields!Campo8_1.Value - - - - - - - true - - - - - =Fields!Campo8_2.Value - - - - - - - 3.97cm - 2.8cm - 1cm - 13.2cm - 19 - - - Top - 0.5pt - 0.5pt - - - - true - - - - - =Fields!Campo9_1.Value - - - - - - - true - - - - - =Fields!Campo9_2.Value - - - - - - - 6.4cm - 2.39688cm - 0.84125cm - 6.70312cm - 21 - - - - true - - - - - =Fields!Campo10_1.Value - - - - - - - true - - - - - =Fields!Campo10_2.Value - - - - - - - true - - - - - =Fields!Campo13_1.Value - - - - - - - true - - - - - =Fields!Campo13_2.Value - - - - - - - 9.9cm - 9.4cm - 0.8cm - 3.5cm - 25 - - - - 9.5cm - 13cm - 1.3cm - 0cm - 26 - - 0.5pt - - - - - 3.9cm - 12.6cm - -1cm - 0cm - 27 - - 0.5pt - - - - - 3.9cm - 16.2cm - -1cm - 0cm - 28 - - 0.5pt - - - - - true - - - - - =Fields!Campo6_1.Value - - - - - - - true - - - - - =Fields!Campo7_1.Value - - - - - - - true - - - - - =Fields!Campo11_2_1.Value - - - - - - - true - - - - - =Fields!Campo14_1.Value - - - - - - - true - - - - - =Fields!Campo16_1.Value - - - - - - - true - - - - - =Fields!Campo15_1.Value - - - - - - - true - - - - - =Fields!Campo12_1.Value - - - - - - - true - - - - - =Fields!Campo12_2.Value - - - - - - - Campo12_2 - 8.8cm - 2.8cm - 0.6cm - 6.3cm - 36 - - - - true - - - - - =Fields!Campo15_2.Value - - - - - - - Campo15_2 - 10.8cm - 3.6923cm - 0.6cm - 5.40771cm - 37 - - - - true - - - - - =Fields!Campo16_2.Value - - - - - - - Campo16_2 - 10.8cm - 13.80827cm - 0.6cm - 5.09173cm - 38 - - - - true - - - - - =Fields!Campo14_2.Value - - - - - - - true - - - - - =Fields!Campo11_2_2.Value - - - - - - - Campo11_2_2 - 8.07639cm - 10.95375cm - 1.22361cm - 6.2cm - 40 - - - - true - - - - - =Fields!Campo5_2.Value - - - - - - - Campo5_2 - 3.2cm - 9.5cm - 0.7cm - 3cm - 41 - - - - true - - - - - =Fields!Campo6_2.Value - - - - - - - Campo6_2 - 3.2cm - 12.7cm - 0.7cm - 3.4cm - 42 - - - - true - - - - - =Fields!Campo7_2.Value - - - - - - - Campo7_2 - 3.2cm - 16.3cm - 0.7cm - 2.6cm - 43 - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(),"BARCODE",Fields!Campo8_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value - -'=Parameters!QRCodeBaseURL.Value.ToString() & ":['" & Fields!StackID.Value.ToString() & "']}" - FitProportional - 5.1cm - 2.8cm - 1.2cm - 13.2cm - 44 - - =iif(Fields!Campo8_3.Value="",True,False) - - - - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(),"BARCODE",Fields!Campo15_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value - FitProportional - 11.5cm - 0.6cm - 1.2cm - 8.4cm - 45 - - =iif(Fields!Campo15_3.Value="",True,False) - - - - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(),"BARCODE",Fields!Campo12_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value - FitProportional - 9.5cm - 0.6cm - 1.2cm - 8.4cm - 46 - - =iif(Fields!Campo12_3.Value="",True,False) - - - - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(),"BARCODE",Fields!Campo16_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value - FitProportional - 11.5cm - 9.94979cm - 1.2cm - 8.4cm - 47 - - =iif(Fields!Campo16_3.Value="",True,False) - - - - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(), "BARCODE", Fields!Campo9_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value -' "?showVal=false&h=" + Parameters!BarcodeHeight.Value non mostra valore sotto barcode e definisce altezza Barcode da services - FitProportional - 7.41764cm - 0.6cm - 1.2cm - 8.4cm - 48 - - =iif(Fields!Campo9_3.Value = "", True, False) - - - - - - - External - =Replace(Parameters!BarcodeBaseURL.Value.ToString(), "BARCODE", Fields!Campo3_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value - FitProportional - 2.6cm - 0.6cm - 1.2cm - 8.4cm - 49 - - =iif(Fields!Campo3_3.Value = "", True, False) - - - - - - - ContentsOnly - 12.8cm - 19cm - - - - - - true - - - - 12.8cm - + + + + + + true + + + + + =Fields!Campo1_1.Value + + + + + + + true + + + + + =Fields!Campo1_3.Value + + + + + + + true + + + + + =Fields!Campo1_4.Value + + + + + + + ContentsOnly + 0.1cm + 1.9cm + 9.2cm + + + + + + + true + + + + + =Fields!Campo2_4.Value + + + + + + + true + + + + + =Fields!Campo2_2.Value + + + + + + + true + + + + + =Fields!Campo2_3.Value + + + + + + + ContentsOnly + 9.4cm + 1.9cm + 9.5cm + 1 + + 0.5pt + + + + + 6.4cm + 0cm + 19cm + 3 + + 0.5pt + + + + + 1.9cm + 0cm + 19cm + 4 + + 0.5pt + + + + + 3.9cm + 9.4cm + -3.89577cm + 0cm + 5 + + 0.5pt + + + + + 12.8cm + 9.4cm + -6.4cm + 0cm + 6 + + 0.5pt + + + + + 8.8cm + 0cm + 9.37989cm + 7 + + 0.5pt + + + + + 10.8cm + 0cm + 9.37989cm + 8 + + 0.5pt + + + + + 7.6cm + 9.4cm + 0cm + 9.6cm + 9 + + 0.5pt + + + + + 10.8cm + 9.4cm + 0cm + 9.6cm + 10 + + 0.5pt + + + + + 9.5cm + 9.4cm + 0cm + 9.6cm + 11 + + 0.5pt + + + + + true + + + + + =Fields!Campo3_1.Value + + + + + + + 2.9cm + 9.4cm + 0cm + 9.6cm + 13 + + 0.5pt + + + + + true + + + + + =Fields!Campo4_1.Value + + + + + + + true + + + + + =Fields!Campo5_1.Value + + + + + + + true + + + + + =Fields!Campo3_2.Value + + + + + + + true + + + + + =Fields!Campo4_2.Value + + + + + + + textbox7 + 2.2cm + 9.5cm + 0.55889cm + 9.4cm + 17 + + + + true + + + + + =Fields!Campo8_1.Value + + + + + + + true + + + + + =Fields!Campo8_2.Value + + + + + + + 3.97cm + 2.8cm + 1cm + 13.2cm + 19 + + + Top + 0.5pt + 0.5pt + + + + true + + + + + =Fields!Campo9_1.Value + + + + + + + true + + + + + =Fields!Campo9_2.Value + + + + + + + 6.4cm + 2.39688cm + 0.84125cm + 6.70312cm + 21 + + + + true + + + + + =Fields!Campo10_1.Value + + + + + + + true + + + + + =Fields!Campo10_2.Value + + + + + + + true + + + + + =Fields!Campo13_1.Value + + + + + + + true + + + + + =Fields!Campo13_2.Value + + + + + + + 9.9cm + 9.4cm + 0.8cm + 3.5cm + 25 + + + + 9.5cm + 13cm + 1.3cm + 0cm + 26 + + 0.5pt + + + + + 3.9cm + 12.6cm + -1cm + 0cm + 27 + + 0.5pt + + + + + 3.9cm + 16.2cm + -1cm + 0cm + 28 + + 0.5pt + + + + + true + + + + + =Fields!Campo6_1.Value + + + + + + + true + + + + + =Fields!Campo7_1.Value + + + + + + + true + + + + + =Fields!Campo11_2_1.Value + + + + + + + true + + + + + =Fields!Campo14_1.Value + + + + + + + true + + + + + =Fields!Campo16_1.Value + + + + + + + true + + + + + =Fields!Campo15_1.Value + + + + + + + true + + + + + =Fields!Campo12_1.Value + + + + + + + true + + + + + =Fields!Campo12_2.Value + + + + + + + Campo12_2 + 8.8cm + 2.8cm + 0.6cm + 6.3cm + 36 + + + + true + + + + + =Fields!Campo15_2.Value + + + + + + + Campo15_2 + 10.8cm + 3.6923cm + 0.6cm + 5.40771cm + 37 + + + + true + + + + + =Fields!Campo16_2.Value + + + + + + + Campo16_2 + 10.8cm + 13.80827cm + 0.6cm + 5.09173cm + 38 + + + + true + + + + + =Fields!Campo14_2.Value + + + + + + + true + + + + + =Fields!Campo11_2_2.Value + + + + + + + Campo11_2_2 + 8.07639cm + 10.95375cm + 1.22361cm + 6.2cm + 40 + + + + true + + + + + =Fields!Campo5_2.Value + + + + + + + Campo5_2 + 3.2cm + 9.5cm + 0.7cm + 3cm + 41 + + + + true + + + + + =Fields!Campo6_2.Value + + + + + + + Campo6_2 + 3.2cm + 12.7cm + 0.7cm + 3.4cm + 42 + + + + true + + + + + =Fields!Campo7_2.Value + + + + + + + Campo7_2 + 3.2cm + 16.3cm + 0.7cm + 2.6cm + 43 + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(),"BARCODE",Fields!Campo8_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value + +'=Parameters!QRCodeBaseURL.Value.ToString() & ":['" & Fields!StackID.Value.ToString() & "']}" + FitProportional + 5.1cm + 2.8cm + 1.2cm + 13.2cm + 44 + + =iif(Fields!Campo8_3.Value="",True,False) + + + + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(),"BARCODE",Fields!Campo15_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value + FitProportional + 11.5cm + 0.6cm + 1.2cm + 8.4cm + 45 + + =iif(Fields!Campo15_3.Value="",True,False) + + + + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(),"BARCODE",Fields!Campo12_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value + FitProportional + 9.5cm + 0.6cm + 1.2cm + 8.4cm + 46 + + =iif(Fields!Campo12_3.Value="",True,False) + + + + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(),"BARCODE",Fields!Campo16_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value + FitProportional + 11.5cm + 9.94979cm + 1.2cm + 8.4cm + 47 + + =iif(Fields!Campo16_3.Value="",True,False) + + + + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(), "BARCODE", Fields!Campo9_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value +' "?showVal=false&h=" + Parameters!BarcodeHeight.Value non mostra valore sotto barcode e definisce altezza Barcode da services + FitProportional + 7.41764cm + 0.6cm + 1.2cm + 8.4cm + 48 + + =iif(Fields!Campo9_3.Value = "", True, False) + + + + + + + External + =Replace(Fields!BarcodeBaseUrl.Value.ToString(), "BARCODE", Fields!Campo3_3.Value.ToString()) + "?showVal=false&h=" + Parameters!BarcodeHeight.Value + FitProportional + 2.6cm + 0.6cm + 1.2cm + 8.4cm + 49 + + =iif(Fields!Campo3_3.Value = "", True, False) + + + + + + + ContentsOnly + 12.8cm + 19cm + + + + + + true + + + + 12.8cm + @@ -573,7 +577,7 @@ - 1.5cm + 2cm @@ -600,7 +604,7 @@ Middle - 2pt + 5pt 2pt 2pt 2pt @@ -621,7 +625,7 @@ - 1.5cm + 2cm @@ -648,7 +652,7 @@ Middle - 2pt + 5pt 2pt 2pt 2pt @@ -669,7 +673,7 @@ - 1.5cm + 2cm @@ -696,7 +700,7 @@ Middle - 2pt + 5pt 2pt 2pt 2pt @@ -717,7 +721,7 @@ - 1.12958cm + 1.5cm @@ -756,7 +760,7 @@ 0.5pt Middle - 2pt + 5pt 2pt 2pt 2pt @@ -783,7 +787,7 @@ @@ -802,7 +806,7 @@ Middle 2pt - 2pt + 5pt 2pt 2pt @@ -841,7 +845,7 @@ 0.5pt Middle - 2pt + 5pt 2pt 2pt 2pt @@ -862,14 +866,14 @@ =Fields!DataPedana.Value @@ -884,7 +888,7 @@ Middle 2pt - 2pt + 5pt 2pt 2pt @@ -936,31 +940,34 @@ stp_prt_CartellinoPedane - 11.64699cm - 19cm - + + true - 0.48678cm - 11.64699cm - 19cm + 13.81512cm + 20.9cm + - true true - powered by Steam + cart.213x150 v211-powered by Steam @@ -968,6 +975,7 @@ Ware @@ -995,10 +1003,10 @@ - 12.27488cm + 13.88568cm 11.126cm - 0.2in - 3.1in + 0.21in + 3.65208in 1 - DataDDT + DataLotto @@ -291,14 +291,14 @@ - + true true - Numero DDT + - Textbox48 + Textbox2 @@ -332,14 +332,14 @@ - + true true - =Fields!NumDDT.Value + - NumDDT + Textbox3 @@ -376,18 +376,18 @@ - 0.8cm + 0.9cm - + true true - Fornitore + =Fields!NoteLotto.Value - Textbox69 + NoteLotto @@ -415,50 +415,11 @@ 2pt - 2 + 10 - - - - true - true - - - - - =Fields!DescFornit.Value - - - - - - - DescFornit - - - - - 0.5pt - - Middle - 2pt - 2pt - 2pt - 2pt - - - 8 - - + @@ -469,7 +430,7 @@ - 1.2cm + 1.3cm @@ -567,7 +528,7 @@ - 2cm + 2.4cm @@ -592,7 +553,7 @@ Textbox105 0.10922cm 0.6cm - 4.59021cm + 4.8cm @@ -622,7 +583,7 @@ 0.77639cm 0.10922cm 1cm - 4.59021cm + 4.8cm 1 @@ -745,7 +705,7 @@ 0.77639cm 0.10922cm 1cm - 4.59021cm + 4.8cm 1 @@ -873,7 +833,7 @@ - powered by Steam + cart.150x100 v211 - powered by Steam - 8cm - 4.39819cm + 9.15cm + 5.51672cm 0.5cm - 7.81184cm + 8.67762cm 1 + + @@ -956,28 +920,28 @@ stp_prt_CartellinoSemilavorati - 8.5cm - 12.8cm + 9.65cm + 14.5cm