diff --git a/GMW-RT/bin/GMW-RT.dll b/GMW-RT/bin/GMW-RT.dll index 65102f8d..d6d99d03 100644 Binary files a/GMW-RT/bin/GMW-RT.dll and b/GMW-RT/bin/GMW-RT.dll differ diff --git a/GMW-RT/bin/GMW_data.dll b/GMW-RT/bin/GMW_data.dll index 12050147..f20d7a85 100644 Binary files a/GMW-RT/bin/GMW_data.dll and b/GMW-RT/bin/GMW_data.dll differ diff --git a/GMW-RT/bin/SteamWare.dll b/GMW-RT/bin/SteamWare.dll index 44f1ee35..80634d4d 100644 Binary files a/GMW-RT/bin/SteamWare.dll and b/GMW-RT/bin/SteamWare.dll differ diff --git a/GMW-RT/bin/SteamWare.xml b/GMW-RT/bin/SteamWare.xml index 9797a877..dd8e6e28 100644 --- a/GMW-RT/bin/SteamWare.xml +++ b/GMW-RT/bin/SteamWare.xml @@ -1476,6 +1476,11 @@ restituisce il nome della pagina corrente + + + restituisce nome cookie di auth (o default...) + + restituisce la tabella diritti da session diff --git a/GMW-RT/obj/Debug/GMW-RT.csproj.FileListAbsolute.txt b/GMW-RT/obj/Debug/GMW-RT.csproj.FileListAbsolute.txt index 0ad3092b..180e0d42 100644 --- a/GMW-RT/obj/Debug/GMW-RT.csproj.FileListAbsolute.txt +++ b/GMW-RT/obj/Debug/GMW-RT.csproj.FileListAbsolute.txt @@ -23,7 +23,6 @@ C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\Elmah.dll C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\Microsoft.Web.Infrastructure.dll C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\System.Web.Optimization.dll C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\WebGrease.dll -C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\Antlr3.Runtime.pdb C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\System.Web.Optimization.xml C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\Microsoft.AspNet.FriendlyUrls.dll C:\Users\samuele\Documents\Visual Studio 2012\Projects\GMW\GMW-RT\bin\Microsoft.AspNet.FriendlyUrls.xml diff --git a/GMW/GMW.csproj b/GMW/GMW.csproj index d997fe76..11b16466 100644 --- a/GMW/GMW.csproj +++ b/GMW/GMW.csproj @@ -461,7 +461,10 @@ + + + @@ -489,6 +492,8 @@ + + @@ -872,6 +877,20 @@ POST_PRE_TT_DT.aspx + + Post_SterrTaglio.aspx + ASPXCodeBehind + + + Post_SterrTaglio.aspx + + + Post_SterrTaglioFC.aspx + ASPXCodeBehind + + + Post_SterrTaglioFC.aspx + sanpos_associaz_F10_F18.aspx @@ -1734,6 +1753,20 @@ mod_SterrTagIN.ascx + + mod_sterrTaglio.ascx + ASPXCodeBehind + + + mod_sterrTaglio.ascx + + + mod_sterrTaglioFC.ascx + ASPXCodeBehind + + + mod_sterrTaglioFC.ascx + mod_SterrTagOUT.ascx ASPXCodeBehind @@ -2046,7 +2079,6 @@ - @@ -2238,7 +2270,7 @@ True 57804 / - http://localhost:55555 + http://localhost:55554 False False diff --git a/GMW/GMW.csproj.user b/GMW/GMW.csproj.user index 3b0d8d98..b9513f4d 100644 --- a/GMW/GMW.csproj.user +++ b/GMW/GMW.csproj.user @@ -2,7 +2,7 @@ ShowAllFiles - IIS02_TK + TK_test diff --git a/GMW/Post_SterrTaglio.aspx b/GMW/Post_SterrTaglio.aspx new file mode 100644 index 00000000..5a6ac8a2 --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx @@ -0,0 +1,40 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/FullPage.master" AutoEventWireup="true" CodeBehind="Post_SterrTaglio.aspx.cs" Inherits="GMW.Post_SterrTaglio" %> + +<%@ Register Src="WebUserControls/mod_selLineaNtDt.ascx" TagName="mod_selLineaNtDt" TagPrefix="uc1" %> +<%@ Register Src="WebUserControls/mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc2" %> +<%@ Register Src="WebUserControls/mod_sterrTaglio.ascx" TagPrefix="uc3" TagName="mod_sterrTaglio" %> + + + + + + + + + +
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
diff --git a/GMW/Post_SterrTaglio.aspx.cs b/GMW/Post_SterrTaglio.aspx.cs new file mode 100644 index 00000000..1eb0e44f --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW +{ + public partial class Post_SterrTaglio : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + updatePrinterPostazione(); + // fix css... + Postazione.CssClass = "stileAttesa"; + // imposto pos abilitata x cancellazione + mod_storicoAzioniOperatore1.IdxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneSterrati"); + // pulisco dir temp dai file dei cartellini stampati + reportPrinter.obj.pulisciDir(); + } + // update vari... + doUpdate(); + mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); + mod_sterrTaglio.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; + mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh; + mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico; + } + /// + /// Handles the showHideStorico event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_showHideStorico(object sender, EventArgs e) + { + fixStorico(); + } + /// + /// Handles the doRefresh event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); + mod_sterrTaglio.doResetData(); + mod_sterrTaglio.doUpdate(); + } + /// + /// richiesta update del controllo SAO + /// + /// + /// + void mod_PostRX_NT1_eh_reqUpdate(object sender, EventArgs e) + { + doUpdate(); + } + /// + /// aggiorna messaggi e css + /// + private void updateMessCss() + { + lblWarning.Text = Postazione.warningText; + lblMessaggi.Text = Postazione.messaggiText; + pnlAll.CssClass = Postazione.CssClass; + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) + { + mod_sterrTaglio.ristampa(); + } + /// + /// sistemo visualizzazione pannelli + /// + private void fixPanels() + { + // default: moduli NON visibili SE non ho linea indicata.. + bool enableBtn = false; + if (Postazione.currCodCella != "") enableBtn = true; + mod_sterrTaglio.Visible = enableBtn; + fixStorico(); + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// toggle controllo storico + /// + private void fixStorico() + { + pnlSAO.Visible = Postazione.showStorico; + } + /// + /// update generale controlli + /// + private void doUpdate() + { + updateMessCss(); + fixPanels(); + mod_storicoAzioniOperatore1.doUpdate(); + } + /// + /// calcola postazione corrente (ip, name, printer) + /// + private void updatePrinterPostazione() + { + Postazione.IP = Request.UserHostName; + Postazione.setupPrinter(); + // mostro warning se postazione non configurata... + if (Postazione.printer == "n.d.") + { + lblWarning.Text = traduci("lblWarnPostNonConf"); + } + } + } +} \ No newline at end of file diff --git a/GMW/Post_SterrTaglio.aspx.designer.cs b/GMW/Post_SterrTaglio.aspx.designer.cs new file mode 100644 index 00000000..7fe027d0 --- /dev/null +++ b/GMW/Post_SterrTaglio.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW { + + + public partial class Post_SterrTaglio { + + /// + /// mod_selLineaNtDt1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_selLineaNtDt mod_selLineaNtDt1; + + /// + /// pnlAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAll; + + /// + /// pnlSAO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlSAO; + + /// + /// mod_storicoAzioniOperatore1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_storicoAzioniOperatore mod_storicoAzioniOperatore1; + + /// + /// lblMessaggi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessaggi; + + /// + /// lblWarning control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarning; + + /// + /// mod_sterrTaglio control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_sterrTaglio mod_sterrTaglio; + } +} diff --git a/GMW/Post_SterrTaglioFC.aspx b/GMW/Post_SterrTaglioFC.aspx new file mode 100644 index 00000000..ae02f662 --- /dev/null +++ b/GMW/Post_SterrTaglioFC.aspx @@ -0,0 +1,39 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/FullPage.master" AutoEventWireup="true" CodeBehind="Post_SterrTaglioFC.aspx.cs" Inherits="GMW.Post_SterrTaglioFC" %> + +<%@ Register Src="WebUserControls/mod_selLineaNtDt.ascx" TagName="mod_selLineaNtDt" TagPrefix="uc1" %> +<%@ Register Src="WebUserControls/mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc2" %> +<%@ Register Src="WebUserControls/mod_sterrTaglioFC.ascx" TagPrefix="uc3" TagName="mod_sterrTaglioFC" %> + + + + + + + + +
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
\ No newline at end of file diff --git a/GMW/Post_SterrTaglioFC.aspx.cs b/GMW/Post_SterrTaglioFC.aspx.cs new file mode 100644 index 00000000..d5764049 --- /dev/null +++ b/GMW/Post_SterrTaglioFC.aspx.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW +{ + public partial class Post_SterrTaglioFC : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + updatePrinterPostazione(); + // fix css... + Postazione.CssClass = "stileAttesa"; + // imposto pos abilitata x cancellazione + mod_storicoAzioniOperatore1.IdxPosizione2del = memLayer.ML.confReadInt("IdxPosizioneSterrati"); + // pulisco dir temp dai file dei cartellini stampati + reportPrinter.obj.pulisciDir(); + } + // update vari... + doUpdate(); + mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); + mod_sterrTaglioFC.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; + mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh; + mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico; + } + /// + /// Handles the showHideStorico event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_showHideStorico(object sender, EventArgs e) + { + fixStorico(); + } + /// + /// Handles the doRefresh event of the mod_selLineaNtDt1_eh control. + /// + /// The source of the event. + /// The instance containing the event data. + private void mod_selLineaNtDt1_eh_doRefresh(object sender, EventArgs e) + { + doUpdate(); + mod_sterrTaglioFC.doResetData(); + mod_sterrTaglioFC.doUpdate(); + } + /// + /// richiesta update del controllo SAO + /// + /// + /// + void mod_PostRX_NT1_eh_reqUpdate(object sender, EventArgs e) + { + doUpdate(); + } + /// + /// aggiorna messaggi e css + /// + private void updateMessCss() + { + lblWarning.Text = Postazione.warningText; + lblMessaggi.Text = Postazione.messaggiText; + pnlAll.CssClass = Postazione.CssClass; + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) + { + mod_sterrTaglioFC.ristampa(); + } + /// + /// sistemo visualizzazione pannelli + /// + private void fixPanels() + { + // default: moduli NON visibili SE non ho linea indicata.. + bool enableBtn = false; + if (Postazione.currCodCella != "") enableBtn = true; + mod_sterrTaglioFC.Visible = enableBtn; + fixStorico(); + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// toggle controllo storico + /// + private void fixStorico() + { + pnlSAO.Visible = Postazione.showStorico; + } + /// + /// update generale controlli + /// + private void doUpdate() + { + updateMessCss(); + fixPanels(); + mod_storicoAzioniOperatore1.doUpdate(); + } + /// + /// calcola postazione corrente (ip, name, printer) + /// + private void updatePrinterPostazione() + { + Postazione.IP = Request.UserHostName; + Postazione.setupPrinter(); + // mostro warning se postazione non configurata... + if (Postazione.printer == "n.d.") + { + lblWarning.Text = traduci("lblWarnPostNonConf"); + } + } + } +} \ No newline at end of file diff --git a/GMW/Post_SterrTaglioFC.aspx.designer.cs b/GMW/Post_SterrTaglioFC.aspx.designer.cs new file mode 100644 index 00000000..9d3d7ce5 --- /dev/null +++ b/GMW/Post_SterrTaglioFC.aspx.designer.cs @@ -0,0 +1,78 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW { + + + public partial class Post_SterrTaglioFC { + + /// + /// mod_selLineaNtDt1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_selLineaNtDt mod_selLineaNtDt1; + + /// + /// pnlAll control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlAll; + + /// + /// pnlSAO control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlSAO; + + /// + /// mod_storicoAzioniOperatore1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_storicoAzioniOperatore mod_storicoAzioniOperatore1; + + /// + /// lblMessaggi control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessaggi; + + /// + /// lblWarning control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWarning; + + /// + /// mod_sterrTaglioFC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::GMW.WebUserControls.mod_sterrTaglioFC mod_sterrTaglioFC; + } +} diff --git a/GMW/Properties/PublishProfiles/IIS02_SP.pubxml b/GMW/Properties/PublishProfiles/IIS02_SP.pubxml deleted file mode 100644 index 3e5c3609..00000000 --- a/GMW/Properties/PublishProfiles/IIS02_SP.pubxml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - MSDeploy - 218_SP - Any CPU - - True - https://IIS02:8172/MsDeploy.axd - Default Web Site/GMW_SP - - False - WMSVC - True - steamwarewin\Administrator - <_SavePWD>True - - - - - - - - - - - - - - - True - True - True - False - DonotMerge - - - - - \ No newline at end of file diff --git a/GMW/Properties/PublishProfiles/Test218.pubxml b/GMW/Properties/PublishProfiles/Test218.pubxml new file mode 100644 index 00000000..836e9b31 --- /dev/null +++ b/GMW/Properties/PublishProfiles/Test218.pubxml @@ -0,0 +1,23 @@ + + + + + MSDeploy + Release + Any CPU + + True + False + https://10.74.82.218:8172/MsDeploy.axd + Default Web Site/GMW + + True + WMSVC + True + Administrator + <_SavePWD>True + + \ No newline at end of file diff --git a/GMW/Properties/PublishProfiles/IIS02_SP.pubxml.user b/GMW/Properties/PublishProfiles/Test218.pubxml.user similarity index 52% rename from GMW/Properties/PublishProfiles/IIS02_SP.pubxml.user rename to GMW/Properties/PublishProfiles/Test218.pubxml.user index afd74a32..aa317686 100644 --- a/GMW/Properties/PublishProfiles/IIS02_SP.pubxml.user +++ b/GMW/Properties/PublishProfiles/Test218.pubxml.user @@ -5,7 +5,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt --> - 2013-07-02T19:12:45.6296989+02:00 - AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAbVjPk8XiaE6hVPnucZB+eAAAAAACAAAAAAADZgAAwAAAABAAAAAKIuT9gYRdT6NzRJoTJ5doAAAAAASAAACgAAAAEAAAACBa1wUmKLBYRwfz9sDnzzoYAAAAcXHUkmaqiDUamFrj9nv68hAHfHCDaf8zFAAAAPHPHfMngM1nhXwNXMIU8ndlBZKZ + 2014-10-23T19:00:49.9701048+02:00 + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAADfdPkbM5mUeaV6YvQx8NEwAAAAACAAAAAAADZgAAwAAAABAAAABretqmeAwoN8dwwUym0l6uAAAAAASAAACgAAAAEAAAANS9Yunkzc8Nyn9LraBErMgQAAAArKgvGhTAwNnTbdGD8tmWohQAAAC/UZP/r9BIjbarE1TjmEMK+wszYw== \ No newline at end of file diff --git a/GMW/Web.218_TK.config b/GMW/Web.218_TK.config index 0c905d95..ec795494 100644 --- a/GMW/Web.218_TK.config +++ b/GMW/Web.218_TK.config @@ -41,6 +41,7 @@ + diff --git a/GMW/Web.TK_prod.config b/GMW/Web.TK_prod.config index a81a125f..79cc1b07 100644 --- a/GMW/Web.TK_prod.config +++ b/GMW/Web.TK_prod.config @@ -49,6 +49,7 @@ + diff --git a/GMW/Web.TK_test.config b/GMW/Web.TK_test.config index 431c0b17..2b99ee17 100644 --- a/GMW/Web.TK_test.config +++ b/GMW/Web.TK_test.config @@ -48,6 +48,7 @@ + diff --git a/GMW/Web.config b/GMW/Web.config index 376f2578..e2bda049 100644 --- a/GMW/Web.config +++ b/GMW/Web.config @@ -162,6 +162,7 @@ + diff --git a/GMW/WebUserControls/mod_PostRX_DT.ascx.cs b/GMW/WebUserControls/mod_PostRX_DT.ascx.cs index 2215a6da..9b7320ba 100644 --- a/GMW/WebUserControls/mod_PostRX_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostRX_DT.ascx.cs @@ -384,7 +384,11 @@ namespace GMW.WebUserControls int answ = 0; try { - answ = Convert.ToInt32(float.Parse(MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(Convert.ToInt32(lblIdxCella.Text)).Compute("Sum(Qta)", "").ToString())); + DS_magazzino.v_UdcDetailDataTable tabUdc = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(Convert.ToInt32(lblIdxCella.Text)); + if (tabUdc.Rows.Count > 0) + { + answ = Convert.ToInt32(float.Parse(tabUdc.Compute("Sum(Qta)", "").ToString())); + } } catch (Exception exc) { diff --git a/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs b/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs index dd36ab46..ebcc7dff 100644 --- a/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs +++ b/GMW/WebUserControls/mod_PostTT_Pre_NT.ascx.cs @@ -350,7 +350,7 @@ namespace GMW.WebUserControls { try { - // creo nuovo UDC RX... direttametne in posizioen definitiva e con un evento differente... + // creo nuovo UDC RX... direttamente in posizione definitiva e con un evento differente... udcDest = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoRX"), "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneRx"), "IdxPosizioneRx", codEventoUdc, "", "", adesso.Year, Request.UserHostName); // associo UDC a AL... MagClass.magazzino.taAL2UDC.Insert(destAL, udcDest, adesso, MagClass.magazzino.CodSoggCurrUser); diff --git a/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs b/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs index cd6a08cf..af601bbb 100644 --- a/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs +++ b/GMW/WebUserControls/mod_SterrTagOUT.ascx.cs @@ -404,7 +404,7 @@ namespace GMW.WebUserControls txtBarcode.Focus(); } /// - /// imposto i dati dal aprticolare corrente + /// imposto i dati dal particolare corrente /// private void impostaParticolare() { diff --git a/GMW/WebUserControls/mod_fusiTK.ascx.cs b/GMW/WebUserControls/mod_fusiTK.ascx.cs index 29ed795b..207fda7c 100644 --- a/GMW/WebUserControls/mod_fusiTK.ascx.cs +++ b/GMW/WebUserControls/mod_fusiTK.ascx.cs @@ -133,7 +133,7 @@ namespace GMW.WebUserControls { return user_std.UtSn.Traduci(lemma.ToString()); } - + /// /// indica il codice articolo correntemente selezionato /// @@ -424,12 +424,17 @@ namespace GMW.WebUserControls DateTime adesso = DateTime.Now; try { + // aggiungo codice linea alle note + noteTrim = string.Format("{0}{1}{2}", Postazione.currNomeLinea, Environment.NewLine, noteTrim); // creo nuovo UDC del trattamento liquidi newUdcChild = MagClass.magazzino.creaUdc(flusso, "", particolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoFusi"), "U", codSogg, qta, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneFusi"), "IdxPosizioneFusi", "UDC_FUSI", noteTrim, "", adesso.Year, Request.UserHostName); // registro creazione nuovo UDC MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, newUdcChild, particolare, "creaUDC", string.Format("Creato nuovo UDC Fusi - qta:{0} {1}", qta, noteTrim)); + // per ora attributo linea tolto, messo nelle note... +#if false // salvo attributo linea con UDC - MagClass.magazzino.taAtt2UDC.Insert(newUdcChild, attrLINEA, "", DateTime.Now, codSogg); + MagClass.magazzino.taAtt2UDC.Insert(newUdcChild, attrLINEA, Postazione.currCodLinea, DateTime.Now, codSogg); +#endif } catch (Exception exc) { @@ -491,7 +496,7 @@ namespace GMW.WebUserControls { txtNote.Text = ""; } - + } } \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx b/GMW/WebUserControls/mod_sterrTaglio.ascx new file mode 100644 index 00000000..f6601d29 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx @@ -0,0 +1,188 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_sterrTaglio.ascx.cs" Inherits="GMW.WebUserControls.mod_sterrTaglio" %> + +<% if (false) + { %> + + +<% } %> + + + +
+
+
+
+ <%: traduci("UDC") %> +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +   + +
+
+ +
+ +
+
+
+ <%: traduci("Note") %> +
+
+ + +
+
+ <%: traduci("btnStampaUdc") %> +
+
+
+
+
+
+ <%: traduci("Destinazione") %> (AL) +
+
+
+ +
+
+ + + + + + + + + + + + + + + + <%: traduci("Reset") %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ <%: traduci("lblCesta") %> +
+
+ +
+
+
+
+ <%: traduci("Qta") %> +
+
+ + <%: traduci("updateQty") %> +
+
+
+
diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx.cs b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs new file mode 100644 index 00000000..6ce49f00 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx.cs @@ -0,0 +1,963 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW.WebUserControls +{ + public partial class mod_sterrTaglio : System.Web.UI.UserControl + { + /// + /// flusso associato (hard coded) a sterrati + /// + protected string flusso = "ST"; + /// + /// stato associato (hard coded) a sterrati + /// + protected string statoUDC = "Sterr"; + /// + /// tipo di evento associato alla creazione dell'UDC + /// + protected string eventoUDC = "UDC_STTA"; + /// + /// tipo di evento associato alla modifica qta dell'UDC + /// + protected string eventoUDC_qta = "UDC_QTY"; + public event EventHandler eh_reqUpdate; + /// + /// stringa UID univoca + /// + public string uid + { + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + // imposto destAL + destAL = AlByCella; + traduciObj(); + idxCella = Postazione.currIdxCella; + } + setVisibility(); + doChecks(); + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + get + { + int answ = 0; + if (memLayer.ML.isInSessionObject("IdxCellaLineaST")) + { + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaST", value); + } + } + /// + /// Codice AL associato alla cella corrente... + /// + protected string AlByCella + { + get + { + string answ = ""; + try + { + answ = string.Format("ALS00{0}", Postazione.currCodCella); + // controllo se esista AL sennò lo creo... + if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0) + { + MagClass.magazzino.taEA.Insert(answ, true, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, "", ""); + } + } + catch + { } + return answ; + } + } + /// + /// Codice AL target + /// + protected string destAL + { + get + { + return lblAL.Text.Trim(); + } + set + { + lblAL.Text = value; + } + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + MagClass.magazzino.stampaUdc(udcReq, Postazione.printer, tipoCartellino.cartSterr, Request.UserHostName); + // registro ri-stampa UDC + DateTime adesso = DateTime.Now; + // calcolo particolare... + DS_magazzino.ElencoCartelliniRow rigaUDC; + string particolare = ""; + try + { + rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0]; + particolare = rigaUDC.Particolare; + } + catch + { + logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Sterratura {0}", udcReq), tipoLog.EXCEPTION); + } + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Sterratura"); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// controlla particolare selezionato + /// + private void checkParticolare() + { + if (currParticolare != "") + { + lblParticolareAttivo.Text = string.Format("Particolare selezionato {0}", currParticolare); + // aggiungo descrizione del particolare + string descr = ""; + string disegno = ""; + try + { + DS_magazzino.AnagParticolariRow riga = MagClass.magazzino.taAnagPart.likeSearch(currParticolare, memLayer.ML.StringSessionObj("CodCS"))[0]; + descr = riga.DescParticolare; + disegno = string.Format("( {0} )", riga.DisegnoGrezzo); + } + catch + { } + lblDescrAttivo.Text = descr; + lblDisegno.Text = disegno; + } + else + { + lblParticolareAttivo.Text = "..."; + lblDescrAttivo.Text = ""; + lblDisegno.Text = ""; + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkStampa(); + checkParticolare(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + //txtBox + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + // buttons + btnEmptyNote.Text = traduci("btnEmptyNote"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// indica il codice articolo correntemente selezionato + /// + protected string currParticolare + { + get + { + return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica UDC correntemente selezionato + /// + protected string currUDC + { + get + { + return memLayer.ML.StringSessionObj(string.Format("UDC_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("UDC_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// num pezzi dell'ultimo UDC del particolare generato + /// + public int pezziUdc + { + get + { + int answ = 0; + try + { + answ = (int)MagClass.magazzino.taCartellini.getLastByParticolareStato(memLayer.ML.StringSessionObj("CodCS"), currParticolare, statoUDC)[0].Qta; + } + catch + { } + return answ; + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.confReadString("prefComandi"); + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare)) // è un particolare... + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// qta pezzi TOTALE + /// + public int qta + { + get + { + int qta = 0; + try + { + qta = Convert.ToInt32(txtQta.Text.Trim()); + } + catch + { } + return qta; + } + set + { + txtQta.Text = value.ToString(); + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + case tipoCodiceBarcode.UDC: + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + /******************************************************************** + * procedo per UDC in ingresso: + * - deve essere di tipo IN + * - se NON c'è UDC in AL dest a parti particolare LO CREO + * - se c'era già UDC per lo stesso particolare --> consumo (il vecchio) + * - associo UDC letto ad UDC in AL dest a pari particolare + * + ********************************************************************/ + + // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x fusi (pre sterratura/taglio) + int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; + if (IdxPosizione == memLayer.ML.confReadInt("IdxPosizioneFusi")) + { + + // calcolo nuovo particolare + string newPart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; + string udcDest = ""; + // imposto particolare! + currParticolare = newPart; + + // controllo SE esista già UDC in AL dest... altrimenti CREO!!! + udcDest = checkCreaUDC(); + // associo UDC con quello di destinazione SE NECESSARIO + MagClass.magazzino.associaUdcParent(udcDest, barcodeIn, true); + + int idxCellaCurr = 0; + try + { + idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; + } + catch + { } + // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc + if (idxCellaCurr == Postazione.currIdxCella) + { + Postazione.messaggiText += " - Attenzione, UDC già caricato!"; + Postazione.CssClass = "stileComandoKo"; + // controllo SE esista già UDC in AL dest... altrimenti CREO!!! + checkCreaUDC(); + } + else + { + // verifico per eventuale consumo vecchio UDC... cerco nella posizione + DS_magazzino.v_UdcDetailDataTable tabUdcDet = null; + try + { + // cerco nella posizione + tabUdcDet = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella); + } + catch + { } + // carico UDC letto in cella... + DateTime adesso = DateTime.Now; + string noteTrim = Postazione.currNomeLinea; + // cerco se NON ci sia l'UDC letto... + if (tabUdcDet.Select(string.Format("UDC = '{0}'", barcodeIn)).Length == 0) + { + string oldUdc = ""; + try + { + oldUdc = ((DS_magazzino.v_UdcDetailRow)tabUdcDet.Select(string.Format("Particolare = '{0}'", currParticolare))[0]).UDC; + } + catch + { } + // se trovo un altro UDC dello stesso particolare... + if (oldUdc != "") + { + // consumo UDC + consumaUdc(oldUdc); + } + + // se ho cod cella sposto UDC in nuova posizione! + MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); + // registro spostamento UDC + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, barcodeIn, currParticolare, "spostaUDC", string.Format("Caricato UDC Fusi su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); + + } + + Postazione.CssClass = "stileComandoOk"; + } + } + } + + // update + doUpdate(); + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + Postazione.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + txtBarcode.Focus(); + } + /// + /// effettua consumo UDC + /// + /// + private void consumaUdc(string oldUdc) + { + // se è consumabile (IdxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(oldUdc)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName); + } + } + + /// + /// crea eventualmente UDC per particolare in AL di destinazione e restituisce codice UDC + /// + /// + /// + private string checkCreaUDC() + { + string udcDest = ""; + DateTime adesso = DateTime.Now; + // verifico se ho già quel particolare tra quelli dell'AL... + try + { + udcDest = MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL)[0].UDC; + } + catch + { + udcDest = ""; + } + if (udcDest == "") + { + try + { + // creo nuovo UDC ST... direttamente in posizione definitiva e con un evento differente... + udcDest = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoSterr"), "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneSterratiTemp"), "IdxPosizioneSterratiTemp", eventoUDC, "", "", adesso.Year, Request.UserHostName); + // associo UDC a AL... + MagClass.magazzino.taAL2UDC.Insert(destAL, udcDest, adesso, MagClass.magazzino.CodSoggCurrUser); + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in creazione UDC temp ST x travaso: {0}{1}", Environment.NewLine, exc)); + } + } + if (udcDest != "") + { + Postazione.CssClass = "stileAttesa"; + Postazione.warningText = ""; + Postazione.messaggiText = traduci("partAdded"); + } + else + { + Postazione.CssClass = "stileComandoKo"; + Postazione.warningText = traduci("ErroreUdcDest"); + } + grViewDest.DataBind(); + return udcDest; + } + + /// + /// aggiorna tabella + focus a barcode + /// + public void doUpdate() + { + idxCella = Postazione.currIdxCella; + destAL = AlByCella; + setVisibility(); + checkStampa(); + grView.DataBind(); + grViewDest.DataBind(); + txtBarcode.Focus(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// controllo l'abilitazioen alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - udc da consumo totale/parziale + /// altrimenti disabilito btn stampa + /// + private void checkStampa() + { + bool stampaOk = false; + //controllo siano inseriti valori qta + if (numCesta != "" && numCesta != "0000" && qta > 0) + { + // controllo ci siano particolare + if (currParticolare != "") + { + stampaOk = true; + txtNote.Focus(); + } + } + divNote.Visible = stampaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnStampa_Click(object sender, EventArgs e) + { + string[] stringSeparators = new string[] { "#" }; + // verifico postazione x procedere... + if (Postazione.printer != "n.d.") + { + //int qta = memLayer.ML.confReadInt("QtaImballoSterr"); + string noteTrim = txtNote.Text.Trim(); + string lineaCesta = string.Format("{0} | cesta: {1}", Postazione.currNomeLinea, numCesta); + noteTrim = string.Format("{0}{1}{2}", lineaCesta, Environment.NewLine, noteTrim); + + // effettuo controlli che cod_soggetto e cod particolare siano disponibili... + if (MagClass.magazzino.CodSoggCurrUser != "" && currParticolare != "") + { + + // aggiorno note e posizione da temp a definitiv x UDC... + MagClass.magazzino.updateNotePosizioneUDC(currUDC, noteTrim, memLayer.ML.confReadInt("IdxPosizioneSterrati")); + // tolgo UDC da AL corrente... + MagClass.magazzino.taAL2UDC.deleteQuery(destAL, currUDC); + + // ora stampo il nuovo cartellino!!! + MagClass.magazzino.stampaUdc(currUDC, Postazione.printer, tipoCartellino.cartSterr, Request.UserHostName); + // incremento timing... + DateTime adesso = DateTime.Now; + adesso = adesso.AddSeconds(2); + // registro stampa nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, currUDC, currParticolare, "stampaUDC", "Stampato UDC Sterrato"); + // svuoto campo cesta... + numCesta = ""; + // resetto + doResetData(); + } + else + { + httpLog(string.Format("STERRATI, Errore persi utente/particolare, ricarico!"), tipoLog.ERROR); + Response.Redirect("~/login.aspx"); + } + } + else + { + Response.Redirect("~/menu.aspx"); + } + doUpdate(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// effettua il consumo di tutti gli UDC inviati come array di stringhe + /// + /// + private void consumaUdc(string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + // se è consumabile (IdxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(udc_p)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(udc_p, Request.UserHostName); + // sposta UDC da posizione corrente a nessuna... + } + } + } + } + } + /// + ///associa nuovo UDC ad elenco UDC + /// + /// UDC da associare come child + /// vettore di UDC da associare come parent + private void associaUdc(string newUdcChild, string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + MagClass.magazzino.associaUdcParent(newUdcChild, udc_p); + } + } + } + } + /// + /// verifica che il vettore di UDC abbia tutto lo stesso particolare e lo restituisce, altrimenti restituisce "" + /// + /// vettore di UDC da verificare + private string checkPartUDC(string[] UDC_P) + { + string answ = ""; + if (UDC_P.Length > 0) + { + // imposto il primo particolare... + answ = MagClass.magazzino.getParticolareByUDC(UDC_P[0]); + // ciclo + foreach (string udc_p in UDC_P) + { + if (MagClass.magazzino.getParticolareByUDC(udc_p) != answ) answ = ""; // se uno è diverso "azzero" + } + } + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string _testoPre) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + _testoPre); + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string testoLog, tipoLog tipo) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + testoLog, tipo); + return answ; + } + /// + /// effettua reset dati + /// + public void doResetData() + { + // resetto i dati QtaTot e particolare... + qta = 0; + currParticolare = ""; + txtQta.Text = ""; + grViewDest.SelectedIndex = -1; + doChecks(); + } + /// + /// svuoto le note + /// + /// + /// + protected void btnEmptyNote_Click(object sender, EventArgs e) + { + txtNote.Text = ""; + } + /// + /// passo alla modalità IN + /// + /// + /// + protected void btnIn_Click(object sender, EventArgs e) + { + Response.Redirect("SterrTaglioIN.aspx"); + } + + /// + /// effettua refresh (su db) del blocco postazione + /// + /// + private void refreshBloccoPost(string codLinea) + { + // resetto usi linee precedenti.. + MagClass.magazzino.taAL.resetPost(Postazione.name); + // se la linea non è "base" = "Sel linea", finisce x "0" + if (codLinea.Substring(codLinea.Length - 1) != "0") + { + // salvo su DB che sto occupando linea... + MagClass.magazzino.taAL.updatePost(codLinea, Postazione.name); + } + } + + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + protected void grView_Sorted(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// aggiorno ods al binding.. + /// + /// + /// + protected void ods_DataBinding(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// verifica se attivo filtro company e imposta ods di conseguenza... + /// + private void checkFixOds() + { + } + /// + /// traduce gli header delle colonne + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } + } + /// + /// evento selezione grView destinazione: ricarico dati! + /// + /// + /// + protected void grViewDest_SelectedIndexChanged(object sender, EventArgs e) + { + // ricarico dati dell'UDC come particolare e quantità... + currUDC = grViewDest.SelectedDataKey["UDC"].ToString(); + if (MagClass.magazzino.checkUDC(currUDC)) + { + currParticolare = DataProxy.obj.taCartellini.stp_getByUdc(currUDC)[0].Particolare; + //qta = Convert.ToInt32(DataProxy.obj.taCartellini.stp_getByUdc(currUDC)[0].Qta); + } + Postazione.messaggiText = traduci("partSelected"); + Postazione.warningText = ""; + Postazione.CssClass = "stileComandoOk"; + doChecks(); + doUpdate(); + // fisso focus su note! + txtNote.Focus(); + } + /// + /// sistema modalità input + /// + private void setVisibility() + { + bool showBtn = false; + // ora controllo btn quantità + if (grViewDest.SelectedIndex >= 0) + { + showBtn = true; + } + divQta.Visible = showBtn; + } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + grViewDest.SelectedIndex = -1; + qta = 0; + currUDC = ""; + currParticolare = ""; + setVisibility(); + doUpdate(); + } + /// + /// update Qty x UDC selezionato... + /// + /// + /// + protected void lbtUpdQty_Click(object sender, EventArgs e) + { + aggiornaQta(); + } + + private void aggiornaQta() + { + MagClass.magazzino.taCartellini.updateQty(currUDC, MagClass.magazzino.CodSoggCurrUser, "U", eventoUDC_qta, qta); + currUDC = ""; + currParticolare = ""; + grViewDest.SelectedIndex = -1; + setVisibility(); + doUpdate(); + } + /// + /// Numero cesta inserito + /// + public string numCesta + { + get + { + return txtCesta.Text.Trim(); + } + set + { + txtCesta.Text = value; + } + } + /// + /// evento cambio num cesta/grappolo + /// + /// + /// + protected void txtCesta_TextChanged(object sender, EventArgs e) + { + txtCesta.Text = txtCesta.Text.ToUpper().Trim().PadLeft(4, '0').Substring(0, 4); + doUpdate(); + } + /// + /// fornisce in output la corretta classe css x icona + /// + /// + /// + public string cssGlyphByQty(object _qta) + { + string answ = "glyphicon glyphicon-pencil"; + int qtaUDC = 0; + try + { + qtaUDC = Convert.ToInt32(_qta); + } + catch { } + if (qtaUDC > 0) + { + answ = "glyphicon glyphicon-print"; + } + return answ; + } + /// + /// qui la seleizone è x scaricare... + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + consumaUdc(grView.SelectedValue.ToString()); + doUpdate(); + } + /// + /// determina se sia possibile cancellare un record, se qta > 0 + /// + /// + /// + public bool canDelete(object _qta) + { + bool answ = false; + try + { + answ = Convert.ToInt32(_qta) == 0; + } + catch + { } + return answ; + } + /// + /// evento cambio qta + /// + /// + /// + protected void txtQta_TextChanged(object sender, EventArgs e) + { + aggiornaQta(); + } + } +} \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs b/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs new file mode 100644 index 00000000..c44ebdc6 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglio.ascx.designer.cs @@ -0,0 +1,204 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW.WebUserControls { + + + public partial class mod_sterrTaglio { + + /// + /// BundleReference1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; + + /// + /// BundleReference2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2; + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + + /// + /// lblNumRec control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblNumRec; + + /// + /// lblParticolareAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblParticolareAttivo; + + /// + /// lblDescrAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescrAttivo; + + /// + /// lblDisegno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDisegno; + + /// + /// lblBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBarcode; + + /// + /// txtBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBarcode; + + /// + /// divNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNote; + + /// + /// txtNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNote; + + /// + /// btnEmptyNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEmptyNote; + + /// + /// lbtStampaUDC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtStampaUDC; + + /// + /// lblAL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAL; + + /// + /// grViewDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grViewDest; + + /// + /// odsDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsDest; + + /// + /// txtCesta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCesta; + + /// + /// divQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divQta; + + /// + /// txtQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtQta; + + /// + /// lbtUpdQty control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtUpdQty; + } +} diff --git a/GMW/WebUserControls/mod_sterrTaglioFC.ascx b/GMW/WebUserControls/mod_sterrTaglioFC.ascx new file mode 100644 index 00000000..9f2b8be9 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglioFC.ascx @@ -0,0 +1,138 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_sterrTaglioFC.ascx.cs" Inherits="GMW.WebUserControls.mod_sterrTaglioFC" %> + +<% if (false) + { %> + + +<% } %> + + + +
+
+

Gestione Sterrati

+

FUORICICLO

+
+
+
+ +
+
+ +   + +
+
+ +
+ +
+
+
+ <%: traduci("Note") %> +
+
+ + +
+
+ <%: traduci("btnStampaUdc") %> +
+
+
+
+
+
+ <%: traduci("Destinazione") %> (AL) +
+
+
+ +
+
+ + + + + + + + + + + + + + + + <%: traduci("Reset") %> + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ <%: traduci("lblCesta") %> +
+
+ +
+
+
+
+ <%: traduci("Qta") %> +
+
+ + <%: traduci("updateQty") %> +
+
+
+
diff --git a/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs new file mode 100644 index 00000000..977c28fc --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.cs @@ -0,0 +1,910 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using SteamWare; +using GMW_data; + +namespace GMW.WebUserControls +{ + public partial class mod_sterrTaglioFC : System.Web.UI.UserControl + { + /// + /// flusso associato (hard coded) a sterrati + /// + protected string flusso = "ST"; + /// + /// stato associato (hard coded) a sterrati + /// + protected string statoUDC = "Sterr"; + /// + /// tipo di evento associato alla creazione dell'UDC + /// + protected string eventoUDC = "UDC_STTA"; + /// + /// tipo di evento associato alla modifica qta dell'UDC + /// + protected string eventoUDC_qta = "UDC_QTY"; + public event EventHandler eh_reqUpdate; + /// + /// stringa UID univoca + /// + public string uid + { + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + // imposto destAL + destAL = AlByCella; + traduciObj(); + idxCella = Postazione.currIdxCella; + } + setVisibility(); + doChecks(); + } + /// + /// IDX cella associata alla linea corrente + /// + protected int idxCella + { + get + { + int answ = 0; + if (memLayer.ML.isInSessionObject("IdxCellaLineaST_FC")) + { + answ = memLayer.ML.IntSessionObj("IdxCellaLineaST_FC"); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("IdxCellaLineaST_FC", value); + } + } + /// + /// Codice AL associato alla cella corrente... + /// + protected string AlByCella + { + get + { + string answ = ""; + try + { + answ = string.Format("ALS00{0}", Postazione.currCodCella); + // controllo se esista AL sennò lo creo... + if (MagClass.magazzino.taEA.getByAL(answ).Rows.Count == 0) + { + MagClass.magazzino.taEA.Insert(answ, true, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, "", ""); + } + } + catch + { } + return answ; + } + } + /// + /// Codice AL target + /// + protected string destAL + { + get + { + return lblAL.Text.Trim(); + } + set + { + lblAL.Text = value; + } + } + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + MagClass.magazzino.stampaUdc(udcReq, Postazione.printer, tipoCartellino.cartSterr, Request.UserHostName); + // registro ri-stampa UDC + DateTime adesso = DateTime.Now; + // calcolo particolare... + DS_magazzino.ElencoCartelliniRow rigaUDC; + string particolare = ""; + try + { + rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0]; + particolare = rigaUDC.Particolare; + } + catch + { + logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Sterratura FC {0}", udcReq), tipoLog.EXCEPTION); + } + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Sterratura Fuoriciclo"); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// controlla particolare selezionato + /// + private void checkParticolare() + { + if (currParticolare != "") + { + lblParticolareAttivo.Text = string.Format("Particolare selezionato {0}", currParticolare); + // aggiungo descrizione del particolare + string descr = ""; + string disegno = ""; + try + { + DS_magazzino.AnagParticolariRow riga = MagClass.magazzino.taAnagPart.likeSearch(currParticolare, memLayer.ML.StringSessionObj("CodCS"))[0]; + descr = riga.DescParticolare; + disegno = string.Format("( {0} )", riga.DisegnoGrezzo); + } + catch + { } + lblDescrAttivo.Text = descr; + lblDisegno.Text = disegno; + } + else + { + lblParticolareAttivo.Text = "..."; + lblDescrAttivo.Text = ""; + lblDisegno.Text = ""; + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkStampa(); + checkParticolare(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + //txtBox + txtQta.Text = memLayer.ML.confReadString("QtaImballoSterr"); + // buttons + btnEmptyNote.Text = traduci("btnEmptyNote"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// indica il codice articolo correntemente selezionato + /// + protected string currParticolare + { + get + { + return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica UDC correntemente selezionato + /// + protected string currUDC + { + get + { + return memLayer.ML.StringSessionObj(string.Format("UDC_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("UDC_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// num pezzi dell'ultimo UDC del particolare generato + /// + public int pezziUdc + { + get + { + int answ = 0; + try + { + answ = (int)MagClass.magazzino.taCartellini.getLastByParticolareStato(memLayer.ML.StringSessionObj("CodCS"), currParticolare, statoUDC)[0].Qta; + } + catch + { } + return answ; + } + } + /// + /// decodifica il tipo barcode acquisito + /// + public tipoCodiceBarcode tipoBCode + { + get + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int trovati = 0; + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.confReadString("prefComandi"); + if (barcodeIn.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + else if ((TermClass.Ter.riconosciBarcode(barcodeIn) == tipoCodiceBarcode.Particolare)) // è un particolare... + { + answ = tipoCodiceBarcode.Particolare; + } + else + { + try + { + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.UDC; + } + } + catch + { + } + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// qta pezzi TOTALE + /// + public int qta + { + get + { + int qta = 0; + try + { + qta = Convert.ToInt32(txtQta.Text.Trim()); + } + catch + { } + return qta; + } + set + { + txtQta.Text = value.ToString(); + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (tipoBCode) + { + case tipoCodiceBarcode.Particolare: + // imposto il particolare corrente + currParticolare = barcodeIn; + // controllo SE esista già UDC in AL dest... altrimenti CREO!!! + string udcDest = checkCreaUDC(); + + break; + case tipoCodiceBarcode.UDC: + +#if false + // procedo solo se UDC esistente + if (MagClass.magazzino.checkUDC(barcodeIn)) + { + /******************************************************************** + * procedo per UDC in ingresso: + * - deve essere di tipo IN + * - se NON c'è UDC in AL dest a parti particolare LO CREO + * - se c'era già UDC per lo stesso particolare --> consumo (il vecchio) + * - associo UDC letto ad UDC in AL dest a pari particolare + * + ********************************************************************/ + + // controllo IdxPosizione dell'UDC e confronto con posizione in webconfig x fusi (pre sterratura/taglio) + int IdxPosizione = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].IdxPosizione; + if (IdxPosizione == memLayer.ML.confReadInt("IdxPosizioneFusi")) + { + int idxCellaCurr = 0; + try + { + idxCellaCurr = MagClass.magazzino.taPosUdcCorr.getByUDC(barcodeIn)[0].IdxCella; + } + catch + { } + // controllo se UDC non sia già stato spostato in posizione... ds magazzino, posiz udc corrente, get By udc + if (idxCellaCurr == Postazione.currIdxCella) + { + Postazione.messaggiText += " - Attenzione, UDC già caricato!"; + Postazione.CssClass = "stileComandoKo"; + } + else + { + // calcolo nuovo particolare + string newPart = DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Particolare; + string udcDest = ""; + // imposto particolare! + currParticolare = newPart; + + // controllo SE esista già UDC in AL dest... altrimenti CREO!!! + udcDest = checkCreaUDC(); + + // verifico per eventuale consumo vecchio UDC + // cerco nella posizione + DS_magazzino.v_UdcDetailDataTable tabUdcDet = null; + try + { + // cerco nella posizione + tabUdcDet = MagClass.magazzino.taDettUDC.getUdcDetailByIdxCella(idxCella); + } + catch + { } + // carico UDC letto in cella... + DateTime adesso = DateTime.Now; + string noteTrim = Postazione.currNomeLinea; + // cerco se NON ci sia l'UDC letto... + if (tabUdcDet.Select(string.Format("UDC = '{0}'", barcodeIn)).Length == 0) + { + string oldUdc = ""; + try + { + oldUdc = ((DS_magazzino.v_UdcDetailRow)tabUdcDet.Select(string.Format("Particolare = '{0}'", currParticolare))[0]).UDC; + } + catch + { } + // se trovo un altro UDC dello stesso particolare... + if (oldUdc != "") + { + // consumo UDC + consumaUdc(oldUdc); + } + + // se ho cod cella sposto UDC in nuova posizione! + MagClass.magazzino.spostaUDC(memLayer.ML.StringSessionObj("CodCS"), barcodeIn, Postazione.currIdxCella, memLayer.ML.confReadBool("spostaUdcResettaLdp"), Request.UserHostName); + // registro spostamento UDC + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, barcodeIn, currParticolare, "spostaUDC", string.Format("Caricato UDC Fusi su linea {2}, qta: {0} {1} ", qta, noteTrim, Postazione.currCodLinea)); + + } + + Postazione.CssClass = "stileComandoOk"; + + // associo UDC con quello di destinazione + MagClass.magazzino.associaUdcParent(udcDest, barcodeIn, true); + + } + } + } + + // update + doUpdate(); +#endif + break; + default: + Postazione.messaggiText += " - codice non riconosciuto!"; + Postazione.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + else + { + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + } + txtBarcode.Focus(); + } + + /// + /// effettua consumo UDC + /// + /// + private void consumaUdc(string oldUdc) + { + // se è consumabile (IdxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(oldUdc)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(oldUdc, Request.UserHostName); + } + } + + /// + /// crea eventualmente UDC per particolare in AL di destinazione e restituisce codice UDC + /// + /// + /// + private string checkCreaUDC() + { + string udcDest = ""; + DateTime adesso = DateTime.Now; + // verifico se ho già quel particolare tra quelli dell'AL... + try + { + udcDest = MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL)[0].UDC; + } + catch + { + udcDest = ""; + } + if (udcDest == "") + { + try + { + // creo nuovo UDC ST... direttamente in posizione definitiva e con un evento differente... + udcDest = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.confReadString("CodImballoSterr"), "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, adesso, 0, statoUDC, memLayer.ML.confReadInt("IdxPosizioneSterratiTemp"), "IdxPosizioneSterratiTemp", eventoUDC, "", "", adesso.Year, Request.UserHostName); + // associo UDC a AL... + MagClass.magazzino.taAL2UDC.Insert(destAL, udcDest, adesso, MagClass.magazzino.CodSoggCurrUser); + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in creazione UDC temp ST x travaso: {0}{1}", Environment.NewLine, exc)); + } + } + if (udcDest != "") + { + Postazione.CssClass = "stileAttesa"; + Postazione.warningText = ""; + Postazione.messaggiText = traduci("partAdded"); + } + else + { + Postazione.CssClass = "stileComandoKo"; + Postazione.warningText = traduci("ErroreUdcDest"); + } + grViewDest.DataBind(); + return udcDest; + } + + /// + /// aggiorna tabella + focus a barcode + /// + public void doUpdate() + { + idxCella = Postazione.currIdxCella; + destAL = AlByCella; + setVisibility(); + checkStampa(); + grViewDest.DataBind(); + txtBarcode.Focus(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// controllo l'abilitazioen alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// - udc da consumo totale/parziale + /// altrimenti disabilito btn stampa + /// + private void checkStampa() + { + bool stampaOk = false; + //controllo siano inseriti valori qta + if (numCesta != "" && numCesta != "0000" && qta > 0) + { + // controllo ci siano particolare + if (currParticolare != "") + { + stampaOk = true; + txtNote.Focus(); + } + } + divNote.Visible = stampaOk; + } + /// + /// genera i barcode di + /// - trattamenti + /// - nuovo x pezzi liquidi + /// e lancia la relativa stampa + /// + /// + /// + protected void btnStampa_Click(object sender, EventArgs e) + { + string[] stringSeparators = new string[] { "#" }; + // verifico postazione x procedere... + if (Postazione.printer != "n.d.") + { + //int qta = memLayer.ML.confReadInt("QtaImballoSterr"); + string noteTrim = txtNote.Text.Trim(); + noteTrim = string.Format("FUORICICLO{0}{1}", Environment.NewLine, noteTrim); + + // effettuo controlli che cod_soggetto e cod particolare siano disponibili... + if (MagClass.magazzino.CodSoggCurrUser != "" && currParticolare != "") + { + // aggiorno note e posizione da temp a definitiv x UDC... + MagClass.magazzino.updateNotePosizioneUDC(currUDC, noteTrim, memLayer.ML.confReadInt("IdxPosizioneSterrati")); + // metto attributo FC + MagClass.magazzino.taAtt2UDC.Insert(currUDC, "FC", "", DateTime.Now, MagClass.magazzino.CodSoggCurrUser); + // tolgo UDC da AL corrente... + MagClass.magazzino.taAL2UDC.deleteQuery(destAL, currUDC); + + // ora stampo il nuovo cartellino!!! + MagClass.magazzino.stampaUdc(currUDC, Postazione.printer, tipoCartellino.cartSterr, Request.UserHostName); + // incremento timing... + DateTime adesso = DateTime.Now; + adesso = adesso.AddSeconds(2); + // registro stampa nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, currUDC, currParticolare, "stampaUDC", "Stampato UDC Sterrato FUORICICLO"); + // svuoto campo cesta... + numCesta = ""; + // resetto + doResetData(); + } + else + { + httpLog(string.Format("STERRATI FC, Errore persi utente/particolare, ricarico!"), tipoLog.ERROR); + Response.Redirect("~/login.aspx"); + } + } + else + { + Response.Redirect("~/menu.aspx"); + } + doUpdate(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// effettua il consumo di tutti gli UDC inviati come array di stringhe + /// + /// + private void consumaUdc(string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + // se è consumabile (IdxPosizione > 0)... + if (MagClass.magazzino.udcMpIsConsumabile(udc_p)) + { + // consumo UDC + MagClass.magazzino.scaricaUdcMpWip(udc_p, Request.UserHostName); + // sposta UDC da posizione corrente a nessuna... + } + } + } + } + } + /// + ///associa nuovo UDC ad elenco UDC + /// + /// UDC da associare come child + /// vettore di UDC da associare come parent + private void associaUdc(string newUdcChild, string[] UDC_P) + { + if (UDC_P.Length > 0) + { + // ciclo + foreach (string udc_p in UDC_P) + { + // se UDC è NON vuoto ed esiste + if (udc_p != "" && MagClass.magazzino.checkUDC(udc_p)) + { + MagClass.magazzino.associaUdcParent(newUdcChild, udc_p); + } + } + } + } + /// + /// verifica che il vettore di UDC abbia tutto lo stesso particolare e lo restituisce, altrimenti restituisce "" + /// + /// vettore di UDC da verificare + private string checkPartUDC(string[] UDC_P) + { + string answ = ""; + if (UDC_P.Length > 0) + { + // imposto il primo particolare... + answ = MagClass.magazzino.getParticolareByUDC(UDC_P[0]); + // ciclo + foreach (string udc_p in UDC_P) + { + if (MagClass.magazzino.getParticolareByUDC(udc_p) != answ) answ = ""; // se uno è diverso "azzero" + } + } + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string _testoPre) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + _testoPre); + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string testoLog, tipoLog tipo) + { + bool answ = false; + logger.lg.scriviLog(Postazione.IP + testoLog, tipo); + return answ; + } + /// + /// effettua reset dati + /// + public void doResetData() + { + // resetto i dati QtaTot e particolare... + qta = 0; + currParticolare = ""; + txtQta.Text = ""; + grViewDest.SelectedIndex = -1; + doChecks(); + } + /// + /// svuoto le note + /// + /// + /// + protected void btnEmptyNote_Click(object sender, EventArgs e) + { + txtNote.Text = ""; + } + /// + /// passo alla modalità IN + /// + /// + /// + protected void btnIn_Click(object sender, EventArgs e) + { + Response.Redirect("SterrTaglioIN.aspx"); + } + + /// + /// effettua refresh (su db) del blocco postazione + /// + /// + private void refreshBloccoPost(string codLinea) + { + // resetto usi linee precedenti.. + MagClass.magazzino.taAL.resetPost(Postazione.name); + // se la linea non è "base" = "Sel linea", finisce x "0" + if (codLinea.Substring(codLinea.Length - 1) != "0") + { + // salvo su DB che sto occupando linea... + MagClass.magazzino.taAL.updatePost(codLinea, Postazione.name); + } + } + + /// + /// aggiorno ods al binding.. + /// + /// + /// + protected void ods_DataBinding(object sender, EventArgs e) + { + // fix dell'ODS + checkFixOds(); + } + /// + /// verifica se attivo filtro company e imposta ods di conseguenza... + /// + private void checkFixOds() + { + } + /// + /// evento selezione grView destinazione: ricarico dati! + /// + /// + /// + protected void grViewDest_SelectedIndexChanged(object sender, EventArgs e) + { + // ricarico dati dell'UDC come particolare e quantità... + currUDC = grViewDest.SelectedDataKey["UDC"].ToString(); + if (MagClass.magazzino.checkUDC(currUDC)) + { + currParticolare = DataProxy.obj.taCartellini.stp_getByUdc(currUDC)[0].Particolare; + //qta = Convert.ToInt32(DataProxy.obj.taCartellini.stp_getByUdc(currUDC)[0].Qta); + } + Postazione.messaggiText = traduci("partSelected"); + Postazione.warningText = ""; + Postazione.CssClass = "stileComandoOk"; + doChecks(); + doUpdate(); + // fisso focus su note! + txtNote.Focus(); + } + /// + /// sistema modalità input + /// + private void setVisibility() + { + bool showBtn = false; + // ora controllo btn quantità + if (grViewDest.SelectedIndex >= 0) + { + showBtn = true; + } + divQta.Visible = showBtn; + } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + grViewDest.SelectedIndex = -1; + qta = 0; + currUDC = ""; + currParticolare = ""; + setVisibility(); + doUpdate(); + } + /// + /// update Qty x UDC selezionato... + /// + /// + /// + protected void lbtUpdQty_Click(object sender, EventArgs e) + { + MagClass.magazzino.taCartellini.updateQty(currUDC, MagClass.magazzino.CodSoggCurrUser, "U", eventoUDC_qta, qta); + currUDC = ""; + currParticolare = ""; + grViewDest.SelectedIndex = -1; + setVisibility(); + doUpdate(); + } + /// + /// Numero cesta inserito + /// + public string numCesta + { + get + { + return txtCesta.Text.Trim(); + } + set + { + txtCesta.Text = value; + } + } + /// + /// evento cambio num cesta/grappolo + /// + /// + /// + protected void txtCesta_TextChanged(object sender, EventArgs e) + { + txtCesta.Text = txtCesta.Text.ToUpper().Trim().PadLeft(4, '0').Substring(0, 4); + doUpdate(); + } + /// + /// fornisce in output la corretta classe css x icona + /// + /// + /// + public string cssGlyphByQty(object _qta) + { + string answ = "glyphicon glyphicon-pencil"; + int qtaUDC = 0; + try + { + qtaUDC = Convert.ToInt32(_qta); + } + catch { } + if (qtaUDC > 0) + { + answ = "glyphicon glyphicon-print"; + } + return answ; + } + /// + /// determina se sia possibile cancellare un record, se qta > 0 + /// + /// + /// + public bool canDelete(object _qta) + { + bool answ = false; + try + { + answ = Convert.ToInt32(_qta) == 0; + } + catch + { } + return answ; + } + } +} \ No newline at end of file diff --git a/GMW/WebUserControls/mod_sterrTaglioFC.ascx.designer.cs b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.designer.cs new file mode 100644 index 00000000..41dd45e6 --- /dev/null +++ b/GMW/WebUserControls/mod_sterrTaglioFC.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GMW.WebUserControls { + + + public partial class mod_sterrTaglioFC { + + /// + /// BundleReference1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; + + /// + /// BundleReference2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2; + + /// + /// lblParticolareAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblParticolareAttivo; + + /// + /// lblDescrAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDescrAttivo; + + /// + /// lblDisegno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDisegno; + + /// + /// lblBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBarcode; + + /// + /// txtBarcode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtBarcode; + + /// + /// divNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNote; + + /// + /// txtNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNote; + + /// + /// btnEmptyNote control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnEmptyNote; + + /// + /// lbtStampaUDC control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtStampaUDC; + + /// + /// lblAL control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAL; + + /// + /// grViewDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grViewDest; + + /// + /// odsDest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsDest; + + /// + /// txtCesta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtCesta; + + /// + /// divQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divQta; + + /// + /// txtQta control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtQta; + + /// + /// lbtUpdQty control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtUpdQty; + } +} diff --git a/GMW/WebUserControls/mod_testata.ascx b/GMW/WebUserControls/mod_testata.ascx index d33c4db8..92fc3f81 100644 --- a/GMW/WebUserControls/mod_testata.ascx +++ b/GMW/WebUserControls/mod_testata.ascx @@ -17,7 +17,7 @@
+ + + restituisce nome cookie di auth (o default...) + + restituisce la tabella diritti da session diff --git a/GMW/bin/VersGen.dll b/GMW/bin/VersGen.dll index 96b9db76..78104c7d 100644 Binary files a/GMW/bin/VersGen.dll and b/GMW/bin/VersGen.dll differ diff --git a/GMW_Term/Search.aspx b/GMW_Term/Search.aspx index a1999e15..164219e5 100644 --- a/GMW_Term/Search.aspx +++ b/GMW_Term/Search.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/Compact.Master" +<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/CompactBCode.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="GMW_Term.Search" %> <%@ Register Src="WebUserControls/mod_barcode.ascx" TagName="mod_barcode" TagPrefix="uc1" %> diff --git a/GMW_Term/Search.aspx.cs b/GMW_Term/Search.aspx.cs index a0e49caf..441ee4be 100644 --- a/GMW_Term/Search.aspx.cs +++ b/GMW_Term/Search.aspx.cs @@ -44,14 +44,7 @@ namespace GMW_Term private void checkVisibility() { bool filtMag = memLayer.ML.isInSessionObject("Particolare_sel"); - if (filtMag) - { - mod_barcode1.Visible = false; - } - else - { - mod_barcode1.Visible = true; - } + mod_barcode1.Visible = !filtMag; } } } diff --git a/GMW_Term/WebMasterPages/Compact.Master b/GMW_Term/WebMasterPages/Compact.Master index fa428000..51fae9c7 100644 --- a/GMW_Term/WebMasterPages/Compact.Master +++ b/GMW_Term/WebMasterPages/Compact.Master @@ -1,11 +1,11 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Compact.master.cs" Inherits="GMW_Term.Compact" %> +<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Compact.master.cs" Inherits="GMW_Term.WebMasterPages.Compact" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%@ Register Src="../WebUserControls/mod_menuTop.ascx" TagName="mod_menuTop" TagPrefix="uc1" %> <%@ Register Src="../WebUserControls/mod_currentTask.ascx" TagName="mod_currentTask" TagPrefix="uc2" %> - + GMW Terminus diff --git a/GMW_Term/WebMasterPages/Compact.Master.cs b/GMW_Term/WebMasterPages/Compact.Master.cs index 22c4b149..f6a59990 100644 --- a/GMW_Term/WebMasterPages/Compact.Master.cs +++ b/GMW_Term/WebMasterPages/Compact.Master.cs @@ -4,7 +4,7 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -namespace GMW_Term +namespace GMW_Term.WebMasterPages { public partial class Compact : System.Web.UI.MasterPage { diff --git a/GMW_Term/WebMasterPages/Compact.Master.designer.cs b/GMW_Term/WebMasterPages/Compact.Master.designer.cs index ee27dd32..2a645bbb 100644 --- a/GMW_Term/WebMasterPages/Compact.Master.designer.cs +++ b/GMW_Term/WebMasterPages/Compact.Master.designer.cs @@ -7,11 +7,20 @@ // //------------------------------------------------------------------------------ -namespace GMW_Term { +namespace GMW_Term.WebMasterPages { public partial class Compact { + /// + /// Head1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlHead Head1; + /// /// head control. /// diff --git a/GMW_Term/bin/GMW_Term.dll b/GMW_Term/bin/GMW_Term.dll index a0f7d174..a8dd65f7 100644 Binary files a/GMW_Term/bin/GMW_Term.dll and b/GMW_Term/bin/GMW_Term.dll differ diff --git a/GMW_Term/bin/GMW_data.dll b/GMW_Term/bin/GMW_data.dll index 12050147..f11f4452 100644 Binary files a/GMW_Term/bin/GMW_data.dll and b/GMW_Term/bin/GMW_data.dll differ diff --git a/GMW_Term/bin/SteamWare.dll b/GMW_Term/bin/SteamWare.dll index 44f1ee35..80634d4d 100644 Binary files a/GMW_Term/bin/SteamWare.dll and b/GMW_Term/bin/SteamWare.dll differ diff --git a/GMW_Term/bin/SteamWare.xml b/GMW_Term/bin/SteamWare.xml index 9797a877..dd8e6e28 100644 --- a/GMW_Term/bin/SteamWare.xml +++ b/GMW_Term/bin/SteamWare.xml @@ -1476,6 +1476,11 @@ restituisce il nome della pagina corrente + + + restituisce nome cookie di auth (o default...) + + restituisce la tabella diritti da session diff --git a/GMW_data/DS_magazzino.Designer.cs b/GMW_data/DS_magazzino.Designer.cs index 0f988f2b..e894c971 100644 --- a/GMW_data/DS_magazzino.Designer.cs +++ b/GMW_data/DS_magazzino.Designer.cs @@ -23182,7 +23182,7 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[20]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[21]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM dbo.ElencoCartellini"; @@ -23332,14 +23332,23 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno this._commandCollection[18].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.NVarChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[19] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[19].Connection = this.Connection; - this._commandCollection[19].CommandText = "dbo.stp_UDC_updateQty"; + this._commandCollection[19].CommandText = "dbo.stp_UDC_updateNotePosizione"; this._commandCollection[19].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[19].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[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodEvento", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxPosizione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@note", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[19].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.NVarChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[20].Connection = this.Connection; + this._commandCollection[20].CommandText = "dbo.stp_UDC_updateQty"; + this._commandCollection[20].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[20].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[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodEvento", global::System.Data.SqlDbType.VarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[20].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -23793,7 +23802,7 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_magazzino.ElencoCartelliniDataTable updateQty(string UDC, string CodSoggetto, string CodTipoDichiaraz, string CodEvento, global::System.Nullable Qta) { + public virtual DS_magazzino.ElencoCartelliniDataTable updateNotePosizione(string UDC, global::System.Nullable IdxPosizione, string note, string CodSoggetto) { this.Adapter.SelectCommand = this.CommandCollection[19]; if ((UDC == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -23801,6 +23810,41 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno else { this.Adapter.SelectCommand.Parameters[1].Value = ((string)(UDC)); } + if ((IdxPosizione.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((int)(IdxPosizione.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + if ((note == null)) { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = ((string)(note)); + } + if ((CodSoggetto == null)) { + this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[4].Value = ((string)(CodSoggetto)); + } + DS_magazzino.ElencoCartelliniDataTable dataTable = new DS_magazzino.ElencoCartelliniDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_magazzino.ElencoCartelliniDataTable updateQty(string UDC, string CodSoggetto, string CodTipoDichiaraz, string CodEvento, global::System.Nullable Qta) { + this.Adapter.SelectCommand = this.CommandCollection[20]; + if ((UDC == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(UDC)); + } if ((CodSoggetto == null)) { this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; } @@ -40720,31 +40764,38 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT AL, UDC, DataCreaz, CodSoggetto FROM dbo.AL2UDC"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "dbo.stp_AL2UDC_getByAL"; + this._commandCollection[1].CommandText = "dbo.stp_AL2UDC_deleteQuery"; this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[1].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[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@AL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_AL2UDC_getByUDC"; + this._commandCollection[2].CommandText = "dbo.stp_AL2UDC_getByAL"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].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[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@AL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_AL2UDC_moveUdcDtx"; + this._commandCollection[3].CommandText = "dbo.stp_AL2UDC_getByUDC"; this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[3].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[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SourceAL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DestAL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.NChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[4].Connection = this.Connection; + this._commandCollection[4].CommandText = "dbo.stp_AL2UDC_moveUdcDtx"; + this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[4].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[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SourceAL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DestAL", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodSoggetto", global::System.Data.SqlDbType.NChar, 17, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -40776,7 +40827,7 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_magazzino.AL2UDCDataTable getByAL(string AL) { - this.Adapter.SelectCommand = this.CommandCollection[1]; + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((AL == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -40793,7 +40844,7 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_magazzino.AL2UDCDataTable getByUDC(string UDC) { - this.Adapter.SelectCommand = this.CommandCollection[2]; + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((UDC == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -41009,11 +41060,45 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ return this.Update(Original_AL, Original_UDC, DataCreaz, CodSoggetto, Original_AL, Original_UDC, Original_DataCreaz, Original_CodSoggetto); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int deleteQuery(string AL, string UDC) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((AL == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(AL)); + } + if ((UDC == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(UDC)); + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int moveUdcDtx(string SourceAL, string DestAL, string CodSoggetto) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((SourceAL == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/GMW_data/DS_magazzino.xsd b/GMW_data/DS_magazzino.xsd index f4fc68f8..272cdd4d 100644 --- a/GMW_data/DS_magazzino.xsd +++ b/GMW_data/DS_magazzino.xsd @@ -458,6 +458,20 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno + + + + dbo.stp_UDC_updateNotePosizione + + + + + + + + + + @@ -3894,6 +3908,18 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ + + + + dbo.stp_AL2UDC_deleteQuery + + + + + + + + @@ -3916,7 +3942,7 @@ SELECT AL, UDC, DataCreaz, CodSoggetto FROM AL2UDC WHERE (AL = @AL) AND (UDC = @ - + dbo.stp_AL2UDC_moveUdcDtx @@ -5259,7 +5285,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5316,7 +5342,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5348,7 +5374,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5370,7 +5396,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5397,7 +5423,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5446,14 +5472,14 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + - + @@ -5489,7 +5515,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5546,7 +5572,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5574,7 +5600,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5621,7 +5647,7 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - + @@ -5815,21 +5841,21 @@ SELECT Trattamento, AL, DataTrattEnd, Durezza, Punzone, DataDur, CodSoggettoDur, - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GMW_data/DS_magazzino.xss b/GMW_data/DS_magazzino.xss index 2794462e..10112161 100644 --- a/GMW_data/DS_magazzino.xss +++ b/GMW_data/DS_magazzino.xss @@ -6,7 +6,7 @@ --> - + @@ -16,9 +16,9 @@ - + - + @@ -38,9 +38,9 @@ - - - + + + @@ -204,7 +204,7 @@ -39 - 499 + 518 @@ -212,11 +212,15 @@ 87 - 336 + 254 - 52 - 336 + -27 + 254 + + + -27 + 289 diff --git a/GMW_data/MagClass.cs b/GMW_data/MagClass.cs index b5ac0c37..70ec2c41 100644 --- a/GMW_data/MagClass.cs +++ b/GMW_data/MagClass.cs @@ -1037,7 +1037,7 @@ namespace GMW_data // insert nuovo UDC con codice impostato try { - tabUdc = DataProxy.obj.taCartellini.stp_insNewFullWithAL(AL, SourceAL,DataMatrix,CodStatoUdcOut, CodCella, CodCS, CodBilanciaTrim, annoTrim, CodClienteTrim, ParticolareTrim, CodImpiantoTrim, CodStampoTrim, EsponenteTrim, FiguraTrim, DataRif, TurnoRif, CodImballoTrim, CodSoggettoTrim, Tara, IdxPosizione, CodTipoDichiarazioneTrim, codEventoTrim, Quantita, PesoTot, PesoCad, CodStatoTrim, UDC_parentTrim, doDeleteUdcTara, noteTrim); + tabUdc = DataProxy.obj.taCartellini.stp_insNewFullWithAL(AL, SourceAL, DataMatrix, CodStatoUdcOut, CodCella, CodCS, CodBilanciaTrim, annoTrim, CodClienteTrim, ParticolareTrim, CodImpiantoTrim, CodStampoTrim, EsponenteTrim, FiguraTrim, DataRif, TurnoRif, CodImballoTrim, CodSoggettoTrim, Tara, IdxPosizione, CodTipoDichiarazioneTrim, codEventoTrim, Quantita, PesoTot, PesoCad, CodStatoTrim, UDC_parentTrim, doDeleteUdcTara, noteTrim); answ = UDC; } catch @@ -1145,6 +1145,7 @@ namespace GMW_data { IdxPosizione = memLayer.ML.confReadInt(defIdxPosizTrim); } + //int IdxPosizione = memLayer.ML.confReadInt(defIdxPosizTrim); // controllo di avere codice soggetto e particolare validi (!="") if (ParticolareTrim != "" && CodSoggettoTrim != "") { @@ -1303,6 +1304,24 @@ namespace GMW_data { taCartellini.updateNote(UDC, note, CodSoggCurrUser); } + /// + /// aggiorna posizione dell'UDC + /// + /// + /// + public void updatePosizioneUDC(string UDC, int idxPosizione) + { + taCartellini.updateIdxPosizione(UDC, idxPosizione, CodSoggCurrUser); + } + /// + /// aggiorna note e posizione dell'UDC + /// + /// + /// + public void updateNotePosizioneUDC(string UDC, string note, int idxPosizione) + { + taCartellini.updateNotePosizione(UDC, idxPosizione, note, CodSoggCurrUser); + } #endregion @@ -1545,10 +1564,12 @@ namespace GMW_data bool answ = false; try { - answ = (taVParticolariOverwiew.getByParticolareFull(Particolare, CodCS).Rows.Count > 0); + answ = (utils.obj.taSelParticolari.getByConditioValue(Particolare, "*").Rows.Count > 0); + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in check particolare:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION); } - catch - { } return answ; } /// @@ -2131,7 +2152,7 @@ namespace GMW_data // restituisce ok answ = esitoOperazione.ok; } - catch(Exception exc) + catch (Exception exc) { logger.lg.scriviLog(string.Format("Errore in trasferimento dati LDP verso AS400: {0}", exc), tipoLog.EXCEPTION); } diff --git a/GMW_data/TermClass.cs b/GMW_data/TermClass.cs index bf00791e..809c4b16 100644 --- a/GMW_data/TermClass.cs +++ b/GMW_data/TermClass.cs @@ -6,419 +6,432 @@ using SteamWare; namespace GMW_data { - /// - /// classe gestione operazioni con terminalino - /// - public class TermClass - { - #region area table adapters + /// + /// classe gestione operazioni con terminalino + /// + public class TermClass + { + #region area table adapters - // variabile di tipo table adapter + // variabile di tipo table adapter #if false - public DS_magazzinoTableAdapters.AnagMagTableAdapter taAnagMag; - public DS_magazzinoTableAdapters.BlocchiTableAdapter taBlocchi; - public DS_magazzinoTableAdapters.CelleTableAdapter taCelle; - public DS_magazzinoTableAdapters.TipoCellaTableAdapter taTipoCella; - public DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter taCartellini; - public DS_magazzinoTableAdapters.PosizioneUdcCorrenteTableAdapter taPosUdcCorr; - public DS_magazzinoTableAdapters.PosizioneUdcStoricoTableAdapter taPosUdcStorico; - public DS_magazzinoTableAdapters.V_MagazziniOverviewTableAdapter taMagOverw; - public DS_magazzinoTableAdapters.V_DettMagPartTableAdapter taDettMagPart; - public DS_magazzinoTableAdapters.v_UdcDetailTableAdapter taDettUDC; - public DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter taElencoListePrelievo; - public DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter taElencoCartellini; - public DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter taRigheListePrelievo; - public DS_magazzinoTableAdapters.TipoListaPrelievoTableAdapter taTipoListaPrelievo; - public DS_magazzinoTableAdapters.V_ParticolariOverviewTableAdapter taVParticolariOverwiew; - public DS_magazzinoTableAdapters.v_particolariEsponenteFiguraTableAdapter taPartExpFig; + public DS_magazzinoTableAdapters.AnagMagTableAdapter taAnagMag; + public DS_magazzinoTableAdapters.BlocchiTableAdapter taBlocchi; + public DS_magazzinoTableAdapters.CelleTableAdapter taCelle; + public DS_magazzinoTableAdapters.TipoCellaTableAdapter taTipoCella; + public DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter taCartellini; + public DS_magazzinoTableAdapters.PosizioneUdcCorrenteTableAdapter taPosUdcCorr; + public DS_magazzinoTableAdapters.PosizioneUdcStoricoTableAdapter taPosUdcStorico; + public DS_magazzinoTableAdapters.V_MagazziniOverviewTableAdapter taMagOverw; + public DS_magazzinoTableAdapters.V_DettMagPartTableAdapter taDettMagPart; + public DS_magazzinoTableAdapters.v_UdcDetailTableAdapter taDettUDC; + public DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter taElencoListePrelievo; + public DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter taElencoCartellini; + public DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter taRigheListePrelievo; + public DS_magazzinoTableAdapters.TipoListaPrelievoTableAdapter taTipoListaPrelievo; + public DS_magazzinoTableAdapters.V_ParticolariOverviewTableAdapter taVParticolariOverwiew; + public DS_magazzinoTableAdapters.v_particolariEsponenteFiguraTableAdapter taPartExpFig; #endif - /// - /// init dei table adapters - /// - protected void initTA() - { - // istanzio oggetto + /// + /// init dei table adapters + /// + protected void initTA() + { + // istanzio oggetto #if false - taAnagMag = new GMW_data.DS_magazzinoTableAdapters.AnagMagTableAdapter(); - taBlocchi = new GMW_data.DS_magazzinoTableAdapters.BlocchiTableAdapter(); - taCelle = new GMW_data.DS_magazzinoTableAdapters.CelleTableAdapter(); - taTipoCella = new GMW_data.DS_magazzinoTableAdapters.TipoCellaTableAdapter(); - taCartellini = new GMW_data.DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter(); - taPosUdcCorr = new GMW_data.DS_magazzinoTableAdapters.PosizioneUdcCorrenteTableAdapter(); - taPosUdcStorico = new GMW_data.DS_magazzinoTableAdapters.PosizioneUdcStoricoTableAdapter(); - taMagOverw = new GMW_data.DS_magazzinoTableAdapters.V_MagazziniOverviewTableAdapter(); - taDettMagPart = new GMW_data.DS_magazzinoTableAdapters.V_DettMagPartTableAdapter(); - taDettUDC = new GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter(); - taElencoListePrelievo = new GMW_data.DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter(); - taElencoCartellini = new GMW_data.DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter(); - taRigheListePrelievo = new GMW_data.DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter(); - taTipoListaPrelievo = new GMW_data.DS_magazzinoTableAdapters.TipoListaPrelievoTableAdapter(); - taVParticolariOverwiew = new GMW_data.DS_magazzinoTableAdapters.V_ParticolariOverviewTableAdapter(); - taPartExpFig = new GMW_data.DS_magazzinoTableAdapters.v_particolariEsponenteFiguraTableAdapter(); + taAnagMag = new GMW_data.DS_magazzinoTableAdapters.AnagMagTableAdapter(); + taBlocchi = new GMW_data.DS_magazzinoTableAdapters.BlocchiTableAdapter(); + taCelle = new GMW_data.DS_magazzinoTableAdapters.CelleTableAdapter(); + taTipoCella = new GMW_data.DS_magazzinoTableAdapters.TipoCellaTableAdapter(); + taCartellini = new GMW_data.DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter(); + taPosUdcCorr = new GMW_data.DS_magazzinoTableAdapters.PosizioneUdcCorrenteTableAdapter(); + taPosUdcStorico = new GMW_data.DS_magazzinoTableAdapters.PosizioneUdcStoricoTableAdapter(); + taMagOverw = new GMW_data.DS_magazzinoTableAdapters.V_MagazziniOverviewTableAdapter(); + taDettMagPart = new GMW_data.DS_magazzinoTableAdapters.V_DettMagPartTableAdapter(); + taDettUDC = new GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter(); + taElencoListePrelievo = new GMW_data.DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter(); + taElencoCartellini = new GMW_data.DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter(); + taRigheListePrelievo = new GMW_data.DS_magazzinoTableAdapters.RigheListePrelievoTableAdapter(); + taTipoListaPrelievo = new GMW_data.DS_magazzinoTableAdapters.TipoListaPrelievoTableAdapter(); + taVParticolariOverwiew = new GMW_data.DS_magazzinoTableAdapters.V_ParticolariOverviewTableAdapter(); + taPartExpFig = new GMW_data.DS_magazzinoTableAdapters.v_particolariEsponenteFiguraTableAdapter(); #endif - } - /// - /// effettua setup dei connection strings da web.config delal singola applicazione - /// - protected virtual void setupConnectionStringBase() - { - // connections del db + } + /// + /// effettua setup dei connection strings da web.config delal singola applicazione + /// + protected virtual void setupConnectionStringBase() + { + // connections del db #if false - taAnagMag.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taBlocchi.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taCelle.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taTipoCella.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taCartellini.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taPosUdcCorr.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taPosUdcStorico.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taMagOverw.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taDettMagPart.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taDettUDC.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taElencoListePrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taElencoCartellini.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taRigheListePrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taTipoListaPrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taVParticolariOverwiew.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); - taPartExpFig.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taAnagMag.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taBlocchi.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taCelle.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taTipoCella.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taCartellini.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taPosUdcCorr.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taPosUdcStorico.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taMagOverw.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taDettMagPart.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taDettUDC.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taElencoListePrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taElencoCartellini.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taRigheListePrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taTipoListaPrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taVParticolariOverwiew.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taPartExpFig.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); #endif - } + } - #endregion + #endregion - #region Inizializzazione + #region Inizializzazione - protected TermClass() - { - initTA(); - setupConnectionStringBase(); - } + protected TermClass() + { + // init oggetto + initTA(); + setupConnectionStringBase(); + } - /// - /// oggetto static per fare chiamate sul magazzino - /// - public static TermClass Ter = new TermClass(); + /// + /// oggetto static per fare chiamate sul magazzino + /// + public static TermClass Ter = new TermClass(); - #endregion + #endregion - #region metodi protected + #region metodi protected #if false - /// - /// aggiunge le righe liste di prelievo necessarie a soddisfare la richiesta in logica FIFO dato un elenco di cartellini, la qta totale da allocare e la lista attuale - /// - /// - /// - /// - private void allocaRigheListaPrelievo(decimal QtaTot, string codListaAttuale, DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini) - { - //ricavo il valore UDC della riga del più vecchio - string udcAttuale; - bool qtaOk = false; - bool dataFinished = false; - int progrUdc = 0; - int numUdcDisponibili = tabellaElencoCartellini.Rows.Count; - // contiene la quantità della riga attuale - decimal qtaRiga; - // somma progressiva della qta allocata - calcolo da db! - decimal qtaAllocata = taElencoListePrelievo.getByCodLista(codListaAttuale)[0].Prelevato; - //ciclo WHILE per lo riempimento FIFO con UDC secondo richiesta a partire da elenco fornito - while (!qtaOk && !dataFinished) - { - /* - * crea una riga in righelistaprelievo passando come valori - * il codlista attuale ricavato da sopr - * l'UDC dal primo della tabella getOlderUDC - * - * - * recupero quantità dalla riga corrente; - * - * imposto proposto a 1; - * imposto prelevato 0; - * taRighelistePreliveo.Insert; - * - * qtaAllocata = qtaAllocata + Qta di questa riga (riuso il valore della colonna QTA - * tabella[contatore]; contatore++; - * qtaOk = (qtaAllocata >= qtaRichiesta) - * dataFinished = (contatore >= numRighe); - * - * */ - // ricavo la riga più vecchia - qtaRiga = tabellaElencoCartellini[progrUdc].Qta; - udcAttuale = tabellaElencoCartellini[progrUdc].UDC; - // eseguo query di insert - taRigheListePrelievo.Insert(codListaAttuale, udcAttuale, qtaRiga, true, false); + /// + /// aggiunge le righe liste di prelievo necessarie a soddisfare la richiesta in logica FIFO dato un elenco di cartellini, la qta totale da allocare e la lista attuale + /// + /// + /// + /// + private void allocaRigheListaPrelievo(decimal QtaTot, string codListaAttuale, DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini) + { + //ricavo il valore UDC della riga del più vecchio + string udcAttuale; + bool qtaOk = false; + bool dataFinished = false; + int progrUdc = 0; + int numUdcDisponibili = tabellaElencoCartellini.Rows.Count; + // contiene la quantità della riga attuale + decimal qtaRiga; + // somma progressiva della qta allocata - calcolo da db! + decimal qtaAllocata = taElencoListePrelievo.getByCodLista(codListaAttuale)[0].Prelevato; + //ciclo WHILE per lo riempimento FIFO con UDC secondo richiesta a partire da elenco fornito + while (!qtaOk && !dataFinished) + { + /* + * crea una riga in righelistaprelievo passando come valori + * il codlista attuale ricavato da sopr + * l'UDC dal primo della tabella getOlderUDC + * + * + * recupero quantità dalla riga corrente; + * + * imposto proposto a 1; + * imposto prelevato 0; + * taRighelistePreliveo.Insert; + * + * qtaAllocata = qtaAllocata + Qta di questa riga (riuso il valore della colonna QTA + * tabella[contatore]; contatore++; + * qtaOk = (qtaAllocata >= qtaRichiesta) + * dataFinished = (contatore >= numRighe); + * + * */ + // ricavo la riga più vecchia + qtaRiga = tabellaElencoCartellini[progrUdc].Qta; + udcAttuale = tabellaElencoCartellini[progrUdc].UDC; + // eseguo query di insert + taRigheListePrelievo.Insert(codListaAttuale, udcAttuale, qtaRiga, true, false); - //incremento qta allocata - qtaAllocata = (qtaAllocata + qtaRiga); - //incremento contatore - progrUdc++; + //incremento qta allocata + qtaAllocata = (qtaAllocata + qtaRiga); + //incremento contatore + progrUdc++; - // verifico le condizioni, false se non cambia nulla true se cambia e si esce dal while - qtaOk = (qtaAllocata >= QtaTot); - dataFinished = (progrUdc >= numUdcDisponibili); - } - } + // verifico le condizioni, false se non cambia nulla true se cambia e si esce dal while + qtaOk = (qtaAllocata >= QtaTot); + dataFinished = (progrUdc >= numUdcDisponibili); + } + } #endif - #endregion + #endregion - #region Metodi esposti + #region Metodi esposti - /// - /// Verifica il login utente andando a controllare il CodSoggetto da RilPro e salvando in sessione un oggetto user_std x l'utente corrispondente al cod soggetto secondo la tab soggetti2utente - /// - /// - /// tipo di errore codificato - public esitoLoginTerm doUserLogin(string CodSoggetto) - { - esitoLoginTerm answ = esitoLoginTerm.errore; - try - { - // verifico che il cod operatore passato sia valido per RilPro.AnagOperatori e Soggetti2Utente - int trovatiAnagOp = DataProxy.obj.taAnagOperatore.getByCodSoggetto(CodSoggetto).Rows.Count; - int trovatiS2U = DataProxy.obj.taSogg2Oper.getByCodSoggetto(CodSoggetto).Rows.Count; - if (trovatiAnagOp == 1) - { - if (trovatiS2U == 1) - { - // è ok, proseguo facendo avvio user - DS_Applicazione.Soggetti2UtenteRow rigaOp = DataProxy.obj.taSogg2Oper.getByCodSoggetto(CodSoggetto)[0]; - // inizializzo utente con dati operatore - user_std _utente = new user_std(); - user_std.UtSn.isForcedUser = true; - bool fatto = _utente.startUpUtente(rigaOp.DOMINIO, rigaOp.USER_NAME); - if (fatto) - { - answ = esitoLoginTerm.ok; - logger.lg.scriviLog(String.Format("Forced user identity ok: logged as \t {0}\\{1}", user_std.UtSn.dominio, user_std.UtSn.utente), tipoLog.STARTUP); - } - } - else - { - logger.lg.scriviLog(string.Format("Attenzione: trovati {0} utenti in RilPro AnagOperatori e {1} utenti in Soggetti2Utente per il CodSoggetto {2}: login impossibile!", trovatiAnagOp, trovatiS2U, CodSoggetto), tipoLog.ERROR); - answ = esitoLoginTerm.errore_noUser; - } - } - else - { - logger.lg.scriviLog(string.Format("Attenzione: trovati {0} utenti in RilPro AnagOperatori e {1} utenti in Soggetti2Utente per il CodSoggetto {2}: login impossibile!", trovatiAnagOp, trovatiS2U, CodSoggetto), tipoLog.ERROR); - answ = esitoLoginTerm.errore_noCodSogg; - } - } - catch (Exception e) - { - logger.lg.scriviLog(string.Format("Errore in TermClass.doUserLogin per il CodSoggetto {0}: eccezione {1}", CodSoggetto, e), tipoLog.FATAL); - } - return answ; - } - /// - /// verifica se il codice barcode letto sia un particoalre con codice tipo "P" - /// - /// - /// - public bool isParticolare(string barcodeIN) - { - bool answ = false; - try - { - answ = utils.obj.taSelParticolari.getByConditioValue(barcodeIN, "P").Rows.Count == 1; - } - catch - { } - return answ; - } - /// - /// verifica se il codice barcode letto sia un anima - /// - /// - /// - public bool isAnima(string valore) - { - bool answ = false; - try - { - answ = utils.obj.taSelParticolari.getByConditioValue(valore, "A").Rows.Count == 1; - } - catch - { } - return answ; - } - /// - /// verifica se il codice barcode letto sia - /// - FinitoLiquidi - /// - NON consumato ( maggiore di 0 ) - /// - NON spedito ( minore di 200 ) - /// - /// UDC da verificare - /// - public bool isFinitoLiquidiOK(string UDC) - { - bool answ = false; - try - { - answ = DataProxy.obj.taCartellini.getByUdcStatoPosiz(UDC, "FinLiq", 1, 199).Rows.Count == 1; - } - catch - { } - return answ; - } - /// - /// verifica il codice barcode letto e restituisce il tipo di valore corrisponente - /// - /// - /// - public tipoCodiceBarcode riconosciBarcode(string barcodeIN) - { - tipoCodiceBarcode answ = tipoCodiceBarcode.ND; - if (barcodeIN != "") - { - // cerco se sia un particolare... - if (utils.obj.taSelParticolari.getByConditioValue(barcodeIN, "*").Rows.Count == 1) - { - answ = tipoCodiceBarcode.Particolare; - } - // se non lo è continuo - if (answ == tipoCodiceBarcode.ND) - { - switch (barcodeIN.Substring(0, 1)) - { - case "O": - answ = tipoCodiceBarcode.Operatore; - break; - case "K": - answ = tipoCodiceBarcode.ListaPrelievo; - break; - //case "P": - //case "A": - // answ = tipoCodiceBarcode.Particolare; - // break; - case "U": - answ = tipoCodiceBarcode.UDC; - break; - case "S": - answ = tipoCodiceBarcode.Cella; - break; - default: - // cerco se la stringa intera abbia un match con le celle... - if (MagClass.magazzino.taCelle.getByCodCella(barcodeIN).Rows.Count == 1) - { - answ = tipoCodiceBarcode.Cella; - } - break; - } - } - } - return answ; - } - /// - /// effettua il reset di tutti i valori in sesisone salvati a valle della scansione di un barcode - /// - /// true/false se resettare UDC selezionato - /// true/false se resettare Cella selezionata - /// true/false se resettare Particolare selezionato - public void resetScanBarcode(bool resetUdc, bool resetCella, bool resetParticolare) - { - if (resetCella) - { - memLayer.ML.emptySessionVal("IdxCella_sel"); - memLayer.ML.emptySessionVal("codCella_sel"); - } - if (resetParticolare) - { - memLayer.ML.emptySessionVal("Particolare_sel"); - } - if (resetUdc) - { - memLayer.ML.emptySessionVal("UDC_sel"); - } - } + /// + /// Verifica il login utente andando a controllare il CodSoggetto da RilPro e salvando in sessione un oggetto user_std x l'utente corrispondente al cod soggetto secondo la tab soggetti2utente + /// + /// + /// tipo di errore codificato + public esitoLoginTerm doUserLogin(string CodSoggetto) + { + esitoLoginTerm answ = esitoLoginTerm.errore; + try + { + // verifico che il cod operatore passato sia valido per RilPro.AnagOperatori e Soggetti2Utente + int trovatiAnagOp = DataProxy.obj.taAnagOperatore.getByCodSoggetto(CodSoggetto).Rows.Count; + int trovatiS2U = DataProxy.obj.taSogg2Oper.getByCodSoggetto(CodSoggetto).Rows.Count; + if (trovatiAnagOp == 1) + { + if (trovatiS2U == 1) + { + // è ok, proseguo facendo avvio user + DS_Applicazione.Soggetti2UtenteRow rigaOp = DataProxy.obj.taSogg2Oper.getByCodSoggetto(CodSoggetto)[0]; + // inizializzo utente con dati operatore + user_std _utente = new user_std(); + user_std.UtSn.isForcedUser = true; + bool fatto = _utente.startUpUtente(rigaOp.DOMINIO, rigaOp.USER_NAME); + if (fatto) + { + answ = esitoLoginTerm.ok; + logger.lg.scriviLog(String.Format("Forced user identity ok: logged as \t {0}\\{1}", user_std.UtSn.dominio, user_std.UtSn.utente), tipoLog.STARTUP); + } + } + else + { + logger.lg.scriviLog(string.Format("Attenzione: trovati {0} utenti in RilPro AnagOperatori e {1} utenti in Soggetti2Utente per il CodSoggetto {2}: login impossibile!", trovatiAnagOp, trovatiS2U, CodSoggetto), tipoLog.ERROR); + answ = esitoLoginTerm.errore_noUser; + } + } + else + { + logger.lg.scriviLog(string.Format("Attenzione: trovati {0} utenti in RilPro AnagOperatori e {1} utenti in Soggetti2Utente per il CodSoggetto {2}: login impossibile!", trovatiAnagOp, trovatiS2U, CodSoggetto), tipoLog.ERROR); + answ = esitoLoginTerm.errore_noCodSogg; + } + } + catch (Exception e) + { + logger.lg.scriviLog(string.Format("Errore in TermClass.doUserLogin per il CodSoggetto {0}: eccezione {1}", CodSoggetto, e), tipoLog.FATAL); + } + return answ; + } + /// + /// verifica se il codice barcode letto sia un particoalre con codice tipo "P" + /// + /// + /// + public bool isParticolare(string barcodeIN) + { + bool answ = false; + try + { + answ = utils.obj.taSelParticolari.getByConditioValue(barcodeIN, "P").Rows.Count == 1; + } + catch + { } + return answ; + } + /// + /// verifica se il codice barcode letto sia un anima + /// + /// + /// + public bool isAnima(string valore) + { + bool answ = false; + try + { + answ = utils.obj.taSelParticolari.getByConditioValue(valore, "A").Rows.Count == 1; + } + catch + { } + return answ; + } + /// + /// verifica se il codice barcode letto sia + /// - FinitoLiquidi + /// - NON consumato ( maggiore di 0 ) + /// - NON spedito ( minore di 200 ) + /// + /// UDC da verificare + /// + public bool isFinitoLiquidiOK(string UDC) + { + bool answ = false; + try + { + answ = DataProxy.obj.taCartellini.getByUdcStatoPosiz(UDC, "FinLiq", 1, 199).Rows.Count == 1; + } + catch + { } + return answ; + } + /// + /// verifica il codice barcode letto e restituisce il tipo di valore corrisponente + /// + /// + /// + public tipoCodiceBarcode riconosciBarcode(string barcodeIN) + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + if (barcodeIN != "") + { + // controllo se in sessione ci sia la stessa verifica e nel caso NON la rifaccio su DB... + if (memLayer.ML.StringCacheObj("lastBarcodeIN") == barcodeIN) + { + answ = (tipoCodiceBarcode)memLayer.ML.objCacheObj("lastBarcodeType"); + } + else + { + // salvo richiesta barcode in cache.. + memLayer.ML.setCacheVal("lastBarcodeIN", barcodeIN); + // cerco se sia un particolare... + if (utils.obj.taSelParticolari.getByConditioValue(barcodeIN, "*").Rows.Count == 1) + { + answ = tipoCodiceBarcode.Particolare; + } + // se non lo è continuo + if (answ == tipoCodiceBarcode.ND) + { + switch (barcodeIN.Substring(0, 1)) + { + case "O": + answ = tipoCodiceBarcode.Operatore; + break; + case "K": + answ = tipoCodiceBarcode.ListaPrelievo; + break; + //case "P": + //case "A": + // answ = tipoCodiceBarcode.Particolare; + // break; + case "U": + answ = tipoCodiceBarcode.UDC; + break; + case "S": + answ = tipoCodiceBarcode.Cella; + break; + default: + // cerco se la stringa intera abbia un match con le celle... + if (MagClass.magazzino.taCelle.getByCodCella(barcodeIN).Rows.Count == 1) + { + answ = tipoCodiceBarcode.Cella; + } + break; + } + } + // salvo in cache decodifica + memLayer.ML.setCacheVal("lastBarcodeType", answ); + } + } + return answ; + } + /// + /// effettua il reset di tutti i valori in sessione salvati a valle della scansione di un barcode + /// + /// true/false se resettare UDC selezionato + /// true/false se resettare Cella selezionata + /// true/false se resettare Particolare selezionato + public void resetScanBarcode(bool resetUdc, bool resetCella, bool resetParticolare) + { + if (resetUdc) + { + memLayer.ML.emptySessionVal("UDC_sel"); + } + if (resetCella) + { + memLayer.ML.emptySessionVal("IdxCella_sel"); + memLayer.ML.emptySessionVal("codCella_sel"); + } + if (resetParticolare) + { + memLayer.ML.emptySessionVal("Particolare_sel"); + } + } - #endregion - } + #endregion + } } /// /// definisce i tipi di codice che il barcode può leggere /// public enum tipoCodiceBarcode { - /// - /// Tipo non riconosciuto - /// - ND, - /// - /// [O] - il barcode rappresenta un codice operatore - /// - Operatore, - /// - /// [K] - il barcode rappresenta una lista di prelievo - /// - ListaPrelievo, - /// - /// [U] - il barcode rappresenta un UDC - /// - UDC, - /// - /// il barcode rappresenta un particolare - /// - Particolare, - /// - /// Cella [S] - /// - Cella, - /// - /// codice gitterbox - /// - Gitterbox, - /// - /// Codice PartNumber come sottoinsieme (iniziale ) di datamatrix BMW - /// - PartNumber, - /// - /// Codice datamatrix - /// - DataMatrix, - /// - /// codice che indica un comando (prefisso da web.config) - /// - Comando, - /// - /// Assieme Logico - /// - AL, - /// - /// Trattamento Termico - /// - TT, - /// - /// Codice di imballo - /// - Imballo, - /// - /// Marcatore DataOra - /// - DateTime + /// + /// Tipo non riconosciuto + /// + ND, + /// + /// [O] - il barcode rappresenta un codice operatore + /// + Operatore, + /// + /// [K] - il barcode rappresenta una lista di prelievo + /// + ListaPrelievo, + /// + /// [U] - il barcode rappresenta un UDC + /// + UDC, + /// + /// il barcode rappresenta un particolare + /// + Particolare, + /// + /// Cella [S] + /// + Cella, + /// + /// codice gitterbox + /// + Gitterbox, + /// + /// Codice PartNumber come sottoinsieme (iniziale ) di datamatrix BMW + /// + PartNumber, + /// + /// Codice datamatrix + /// + DataMatrix, + /// + /// codice che indica un comando (prefisso da web.config) + /// + Comando, + /// + /// Assieme Logico + /// + AL, + /// + /// Trattamento Termico + /// + TT, + /// + /// Codice di imballo + /// + Imballo, + /// + /// Marcatore DataOra + /// + DateTime } /// /// elenco degli esiti per una sessione di login da terminalino /// public enum esitoLoginTerm { - /// - /// tutto ok, come true - /// - ok, - /// - /// non è andata, errore generico - /// - errore, - /// - /// errore x mancanza record in tab operatori di RilPro x CodSoggetto - /// - errore_noCodSogg, - /// - /// errore mancanza username corrisponende all'operatore il cui cod soggetto è stato passato - /// - errore_noUser + /// + /// tutto ok, come true + /// + ok, + /// + /// non è andata, errore generico + /// + errore, + /// + /// errore x mancanza record in tab operatori di RilPro x CodSoggetto + /// + errore_noCodSogg, + /// + /// errore mancanza username corrisponende all'operatore il cui cod soggetto è stato passato + /// + errore_noUser } \ No newline at end of file diff --git a/GMW_data/bin/Debug/SteamWare.xml b/GMW_data/bin/Debug/SteamWare.xml index 0831f569..835dda1d 100644 --- a/GMW_data/bin/Debug/SteamWare.xml +++ b/GMW_data/bin/Debug/SteamWare.xml @@ -1476,6 +1476,11 @@ restituisce il nome della pagina corrente + + + restituisce nome cookie di auth (o default...) + + restituisce la tabella diritti da session diff --git a/GMW_data/bin/SP_test/GMW_data.dll b/GMW_data/bin/SP_test/GMW_data.dll index 553c0202..f20b4d18 100644 Binary files a/GMW_data/bin/SP_test/GMW_data.dll and b/GMW_data/bin/SP_test/GMW_data.dll differ diff --git a/GMW_data/bin/SP_test/SteamWare.dll b/GMW_data/bin/SP_test/SteamWare.dll index 44f1ee35..71b3b98e 100644 Binary files a/GMW_data/bin/SP_test/SteamWare.dll and b/GMW_data/bin/SP_test/SteamWare.dll differ diff --git a/GMW_data/bin/TK_prod/GMW_data.dll b/GMW_data/bin/TK_prod/GMW_data.dll index 62af616c..a4606c70 100644 Binary files a/GMW_data/bin/TK_prod/GMW_data.dll and b/GMW_data/bin/TK_prod/GMW_data.dll differ diff --git a/GMW_data/bin/TK_prod/SteamWare.dll b/GMW_data/bin/TK_prod/SteamWare.dll index ef6889bb..80634d4d 100644 Binary files a/GMW_data/bin/TK_prod/SteamWare.dll and b/GMW_data/bin/TK_prod/SteamWare.dll differ diff --git a/ReleaseClienti/TK_prod/GMW.zip b/ReleaseClienti/TK_prod/GMW.zip index 23d8fbb1..9218bdf8 100644 Binary files a/ReleaseClienti/TK_prod/GMW.zip and b/ReleaseClienti/TK_prod/GMW.zip differ diff --git a/ReleaseClienti/TK_prod/TK_GMW_Term.zip b/ReleaseClienti/TK_prod/TK_GMW_Term.zip index 271d06e0..e86facdd 100644 Binary files a/ReleaseClienti/TK_prod/TK_GMW_Term.zip and b/ReleaseClienti/TK_prod/TK_GMW_Term.zip differ diff --git a/ReleaseClienti/TK_test/GMW.zip b/ReleaseClienti/TK_test/GMW.zip index 0fdeef3b..a4dbc783 100644 Binary files a/ReleaseClienti/TK_test/GMW.zip and b/ReleaseClienti/TK_test/GMW.zip differ diff --git a/ReleaseClienti/TK_test/TK_GMW_TestTerm.zip b/ReleaseClienti/TK_test/TK_GMW_TestTerm.zip index f89c9dc6..daa49ad7 100644 Binary files a/ReleaseClienti/TK_test/TK_GMW_TestTerm.zip and b/ReleaseClienti/TK_test/TK_GMW_TestTerm.zip differ diff --git a/VersGen/GMW.cs b/VersGen/GMW.cs index 841fbf7a..186fda09 100644 --- a/VersGen/GMW.cs +++ b/VersGen/GMW.cs @@ -5,7 +5,7 @@ using System.Reflection; -[assembly: AssemblyVersion("2.8.741.1756")] -[assembly: AssemblyFileVersion("2.8.741.1756")] +[assembly: AssemblyVersion("2.8.755.1788")] +[assembly: AssemblyFileVersion("2.8.755.1788")] [assembly: AssemblyCopyright("Steamware © 2007-2014")] [assembly: AssemblyCompany("Steamware")] diff --git a/VersGen/GMW.tt b/VersGen/GMW.tt index 412fcc85..6edf036d 100644 --- a/VersGen/GMW.tt +++ b/VersGen/GMW.tt @@ -6,8 +6,8 @@ using System.Reflection; -[assembly: AssemblyVersion("2.8.741.<#= this.RevisionNumber #>")] -[assembly: AssemblyFileVersion("2.8.741.<#= this.RevisionNumber #>")] +[assembly: AssemblyVersion("2.8.755.<#= this.RevisionNumber #>")] +[assembly: AssemblyFileVersion("2.8.755.<#= this.RevisionNumber #>")] [assembly: AssemblyCopyright("Steamware © 2007-<#= DateTime.Now.Year #>")] [assembly: AssemblyCompany("Steamware")] <#+