From d46447aa1b127e5e2313b804d1b92f17be8decfb Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 18:46:08 +0200 Subject: [PATCH 1/9] =?UTF-8?q?Aggiunta=20classi=20di=20base=20x=20eredita?= =?UTF-8?q?riet=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MP-ADM/BasePage.cs | 30 ++++++++++++++++++++++++++++++ MP-ADM/BaseUserControl.cs | 37 +++++++++++++++++++++++++++++++++++++ MP-ADM/MP-ADM.csproj | 6 ++++++ 3 files changed, 73 insertions(+) create mode 100644 MP-ADM/BasePage.cs create mode 100644 MP-ADM/BaseUserControl.cs diff --git a/MP-ADM/BasePage.cs b/MP-ADM/BasePage.cs new file mode 100644 index 00000000..dd4aad1a --- /dev/null +++ b/MP-ADM/BasePage.cs @@ -0,0 +1,30 @@ +using SteamWare; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace MP_ADM +{ + public class BasePage : System.Web.UI.Page + { + /// + /// effettua traduzione del lemma + /// + /// + /// + public string traduci(string lemma) + { + return user_std.UtSn.Traduci(lemma); + } + /// + /// effettua traduzione in inglese del lemma + /// + /// + /// + public string traduciEn(string lemma) + { + return user_std.UtSn.TraduciEn(lemma); + } + } +} \ No newline at end of file diff --git a/MP-ADM/BaseUserControl.cs b/MP-ADM/BaseUserControl.cs new file mode 100644 index 00000000..5ffb8037 --- /dev/null +++ b/MP-ADM/BaseUserControl.cs @@ -0,0 +1,37 @@ +using MapoDb; +using SteamWare; +using System; +using System.Data; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MP_ADM +{ + public class BaseUserControl : System.Web.UI.UserControl + { + /// + /// Oggetto datalayer specifico NON singleton x scalare + /// + internal DataLayer DataLayerObj = new DataLayer(); + + + /// + /// effettua traduzione del lemma + /// + /// + /// + public string traduci(string lemma) + { + return user_std.UtSn.Traduci(lemma); + } + /// + /// effettua traduzione in inglese del lemma + /// + /// + /// + public string traduciEn(string lemma) + { + return user_std.UtSn.TraduciEn(lemma); + } + } +} \ No newline at end of file diff --git a/MP-ADM/MP-ADM.csproj b/MP-ADM/MP-ADM.csproj index 6ecaf08c..dcbcb9ce 100644 --- a/MP-ADM/MP-ADM.csproj +++ b/MP-ADM/MP-ADM.csproj @@ -655,6 +655,12 @@ Barcode.aspx + + ASPXCodeBehind + + + ASPXCodeBehind + BCode.aspx ASPXCodeBehind From fd70297ef652d0412d6e888f985602438c7697d1 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 18:46:16 +0200 Subject: [PATCH 2/9] cambio x gestioneODL da classi di base --- MP-ADM/WebUserControls/mod_gestioneODL.ascx | 2 +- .../WebUserControls/mod_gestioneODL.ascx.cs | 32 +++---------------- .../mod_gestioneODL.ascx.designer.cs | 2 +- MP-ADM/gestioneODL.aspx | 2 +- MP-ADM/gestioneODL.aspx.cs | 4 +-- MP-ADM/gestioneODL.aspx.designer.cs | 5 +-- 6 files changed, 13 insertions(+), 34 deletions(-) diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx b/MP-ADM/WebUserControls/mod_gestioneODL.ascx index a3f69ae5..2716b6a5 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestioneODL.ascx.cs" - Inherits="MoonPro_site.WebUserControls.mod_gestioneODL" %> + Inherits="MP_ADM.WebUserControls.mod_gestioneODL" %> <%@ Register Src="mod_newOdl.ascx" TagName="mod_newOdl" TagPrefix="uc1" %> diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs index 5676381b..67710722 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs @@ -5,14 +5,10 @@ using System.Data; using System.Web.UI; using System.Web.UI.WebControls; -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_gestioneODL : System.Web.UI.UserControl + public partial class mod_gestioneODL : BaseUserControl { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); /// /// dimensione pagina @@ -59,7 +55,7 @@ namespace MoonPro_site.WebUserControls protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // salvo in session il valore selezionato... - SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); // mostro edit quantità... divEditQta.Visible = true; lbtNewODL.Visible = enableCreateNew; @@ -169,30 +165,12 @@ namespace MoonPro_site.WebUserControls #region are public - /// - /// effettua traduzione del lemma - /// - /// - /// - public string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } - /// - /// effettua traduzione in inglese del lemma - /// - /// - /// - public string traduciEn(string lemma) - { - return user_std.UtSn.TraduciEn(lemma); - } /// /// resetta la selezione dei valori in caso di modifiche su altri controlli /// public void resetSelezione() { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); grView.SelectedIndex = -1; grView.DataBind(); idxMaccEdit = ""; @@ -364,7 +342,7 @@ namespace MoonPro_site.WebUserControls if (numPzEditable) { // recupero da config il max... - int numPzMaxFix = 50; + int numPzMaxFix = 100; try { numPzMaxFix = memLayer.ML.cdvi("numPzMaxFix"); diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs index 6932ff3e..b849dfd2 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { diff --git a/MP-ADM/gestioneODL.aspx b/MP-ADM/gestioneODL.aspx index 8efd8308..71116f4d 100644 --- a/MP-ADM/gestioneODL.aspx +++ b/MP-ADM/gestioneODL.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="MPADM | ODL" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneODL.aspx.cs" Inherits="MoonPro_site.gestioneODL" %> +<%@ Page Title="MPADM | ODL" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneODL.aspx.cs" Inherits="MP_ADM.gestioneODL" %> <%@ Register src="WebUserControls/mod_gestioneODL.ascx" tagname="mod_gestioneODL" tagprefix="uc1" %> diff --git a/MP-ADM/gestioneODL.aspx.cs b/MP-ADM/gestioneODL.aspx.cs index a19912dd..3121d991 100644 --- a/MP-ADM/gestioneODL.aspx.cs +++ b/MP-ADM/gestioneODL.aspx.cs @@ -1,8 +1,8 @@ using System; -namespace MoonPro_site +namespace MP_ADM { - public partial class gestioneODL : System.Web.UI.Page + public partial class gestioneODL : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/gestioneODL.aspx.designer.cs b/MP-ADM/gestioneODL.aspx.designer.cs index 6ad6d319..8ed003ee 100644 --- a/MP-ADM/gestioneODL.aspx.designer.cs +++ b/MP-ADM/gestioneODL.aspx.designer.cs @@ -7,7 +7,8 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { +namespace MP_ADM +{ public partial class gestioneODL { @@ -19,6 +20,6 @@ namespace MoonPro_site { /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonPro_site.WebUserControls.mod_gestioneODL mod_gestioneODL1; + protected global::MP_ADM.WebUserControls.mod_gestioneODL mod_gestioneODL1; } } From e87129f8746591a7b49abd26164bc7f13aa5cb5a Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 18:54:23 +0200 Subject: [PATCH 3/9] fix update in progress icon --- MP-ADM/WebUserControls/mod_menuTop.ascx | 77 +++++++++---------- .../mod_menuTop.ascx.designer.cs | 32 ++++---- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/MP-ADM/WebUserControls/mod_menuTop.ascx b/MP-ADM/WebUserControls/mod_menuTop.ascx index b65eea23..165b6c21 100644 --- a/MP-ADM/WebUserControls/mod_menuTop.ascx +++ b/MP-ADM/WebUserControls/mod_menuTop.ascx @@ -1,51 +1,50 @@ <%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_menuTop" - CodeBehind="mod_menuTop.ascx.cs" %> + CodeBehind="mod_menuTop.ascx.cs" %> <%-- Gestione resize --%> - -
 
diff --git a/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs b/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs index 7422a59a..80c6de3b 100644 --- a/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls { - - - public partial class mod_menuTop { - +namespace MoonPro_site.WebUserControls +{ + + + public partial class mod_menuTop + { + /// /// Controllo HiddenHeight. /// @@ -20,7 +22,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.HiddenField HiddenHeight; - + /// /// Controllo HiddenWidth. /// @@ -29,7 +31,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.HiddenField HiddenWidth; - + /// /// Controllo btnUpdate. /// @@ -38,7 +40,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.LinkButton btnUpdate; - + /// /// Controllo btnLogOut. /// @@ -47,7 +49,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.LinkButton btnLogOut; - + /// /// Controllo lastUpdate. /// @@ -56,7 +58,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lastUpdate; - + /// /// Controllo updtPage. /// @@ -65,7 +67,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.UpdateProgress updtPage; - + /// /// Controllo Image1. /// @@ -74,7 +76,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Image Image1; - + /// /// Controllo Image2. /// @@ -83,7 +85,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Image Image2; - + /// /// Controllo hlGuida. /// @@ -92,7 +94,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.HyperLink hlGuida; - + /// /// Controllo imgHelp. /// @@ -101,7 +103,7 @@ namespace MoonPro_site.WebUserControls { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Image imgHelp; - + /// /// Controllo hlSteamware. /// From 81ea19eb0afdd09b3ec8f02154d601ed94e7ca7a Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 19:01:35 +0200 Subject: [PATCH 4/9] Ancora conversione a BasePage x WebForms --- MP-ADM/ApplicationInsights.config | 3 -- MP-ADM/BCode.aspx.cs | 48 ++++++++++++------------ MP-ADM/Barcode.aspx.cs | 2 +- MP-ADM/CTrackBCode.aspx.cs | 44 +++++++++++----------- MP-ADM/MP-ADM.csproj | 3 -- MP-ADM/anagArticoli.aspx.cs | 2 +- MP-ADM/aperturaImpianti.aspx | 2 +- MP-ADM/aperturaImpianti.aspx.cs | 7 +++- MP-ADM/aperturaImpianti.aspx.designer.cs | 24 +++++++----- MP-ADM/approvazioneProd.aspx.cs | 33 ++++++++-------- MP-ADM/calendChiusura.aspx.cs | 9 +++-- 11 files changed, 90 insertions(+), 87 deletions(-) delete mode 100644 MP-ADM/ApplicationInsights.config diff --git a/MP-ADM/ApplicationInsights.config b/MP-ADM/ApplicationInsights.config deleted file mode 100644 index ec406213..00000000 --- a/MP-ADM/ApplicationInsights.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/MP-ADM/BCode.aspx.cs b/MP-ADM/BCode.aspx.cs index cf2b3a4b..81bc4168 100644 --- a/MP-ADM/BCode.aspx.cs +++ b/MP-ADM/BCode.aspx.cs @@ -3,30 +3,30 @@ using System; namespace MP_ADM { - public partial class BCode : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class BCode : BasePage { - if (!Page.IsPostBack) - { - checkEnabled(); - string codPre = memLayer.ML.CRS("OptAdmBCode_CodPre"); - mod_barcode.codOrdPre = codPre != "" ? codPre : "OPR"; - mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; - mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); - mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); - } + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + checkEnabled(); + string codPre = memLayer.ML.CRS("OptAdmBCode_CodPre"); + mod_barcode.codOrdPre = codPre != "" ? codPre : "OPR"; + mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; + mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); + mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); + } + } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmBCodeEnabled"); + divContent.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: Gestione BarCode disabilitata"; + } + lblDataImportOut.Text = messaggio; + } } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmBCodeEnabled"); - divContent.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: Gestione BarCode disabilitata"; - } - lblDataImportOut.Text = messaggio; - } - } } \ No newline at end of file diff --git a/MP-ADM/Barcode.aspx.cs b/MP-ADM/Barcode.aspx.cs index c95c720a..041a71ab 100644 --- a/MP-ADM/Barcode.aspx.cs +++ b/MP-ADM/Barcode.aspx.cs @@ -2,7 +2,7 @@ namespace MP_ADM { - public partial class Barcode : System.Web.UI.Page + public partial class Barcode : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/CTrackBCode.aspx.cs b/MP-ADM/CTrackBCode.aspx.cs index fab68265..7e005126 100644 --- a/MP-ADM/CTrackBCode.aspx.cs +++ b/MP-ADM/CTrackBCode.aspx.cs @@ -3,28 +3,28 @@ using System; namespace MP_ADM { - public partial class CTrackBCode : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class CTrackBCode : BasePage { - ((MoonPro)this.Master).headCssClass = "bg-secondary text-warning"; - ((MoonPro)this.Master).mainCssClass = "table-secondary"; - checkEnabled(); - string codPre = memLayer.ML.CRS("OptAdmCTrack_CodPre"); - mod_barcode.codOrdPre = codPre != "" ? codPre : "OPR"; - mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptCTrack_enbSelFase"); - mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptCTrack_CodGruppo"); + protected void Page_Load(object sender, EventArgs e) + { + ((MoonPro)this.Master).headCssClass = "bg-secondary text-warning"; + ((MoonPro)this.Master).mainCssClass = "table-secondary"; + checkEnabled(); + string codPre = memLayer.ML.CRS("OptAdmCTrack_CodPre"); + mod_barcode.codOrdPre = codPre != "" ? codPre : "OPR"; + mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptCTrack_enbSelFase"); + mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptCTrack_CodGruppo"); + } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmCTrackEnabled"); + divContent.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: Gestione CTrack disabilitata"; + } + lblDataImportOut.Text = messaggio; + } } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmCTrackEnabled"); - divContent.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: Gestione CTrack disabilitata"; - } - lblDataImportOut.Text = messaggio; - } - } } \ No newline at end of file diff --git a/MP-ADM/MP-ADM.csproj b/MP-ADM/MP-ADM.csproj index dcbcb9ce..8cbda36f 100644 --- a/MP-ADM/MP-ADM.csproj +++ b/MP-ADM/MP-ADM.csproj @@ -282,9 +282,6 @@ - - PreserveNewest - diff --git a/MP-ADM/anagArticoli.aspx.cs b/MP-ADM/anagArticoli.aspx.cs index 39d4469a..0759f2fc 100644 --- a/MP-ADM/anagArticoli.aspx.cs +++ b/MP-ADM/anagArticoli.aspx.cs @@ -2,7 +2,7 @@ namespace MP_ADM { - public partial class anagArticoli : System.Web.UI.Page + public partial class anagArticoli : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/aperturaImpianti.aspx b/MP-ADM/aperturaImpianti.aspx index c7a4e246..55c8b2d3 100644 --- a/MP-ADM/aperturaImpianti.aspx +++ b/MP-ADM/aperturaImpianti.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="MPADM | apertura impianti" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="aperturaImpianti" Codebehind="aperturaImpianti.aspx.cs" %> +<%@ Page Title="MPADM | apertura impianti" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="MP_ADM.aperturaImpianti" Codebehind="aperturaImpianti.aspx.cs" %> <%@ Register Src="~/WebUserControls/mod_aperturaImpianti.ascx" tagname="mod_aperturaImpianti" tagprefix="uc1" %> diff --git a/MP-ADM/aperturaImpianti.aspx.cs b/MP-ADM/aperturaImpianti.aspx.cs index c0429b4d..eec5987e 100644 --- a/MP-ADM/aperturaImpianti.aspx.cs +++ b/MP-ADM/aperturaImpianti.aspx.cs @@ -1,9 +1,12 @@ using System; -public partial class aperturaImpianti : System.Web.UI.Page +namespace MP_ADM { - protected void Page_Load(object sender, EventArgs e) + public partial class aperturaImpianti : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } } diff --git a/MP-ADM/aperturaImpianti.aspx.designer.cs b/MP-ADM/aperturaImpianti.aspx.designer.cs index c4858b8f..0cd265e6 100644 --- a/MP-ADM/aperturaImpianti.aspx.designer.cs +++ b/MP-ADM/aperturaImpianti.aspx.designer.cs @@ -7,16 +7,20 @@ // //------------------------------------------------------------------------------ +namespace MP_ADM +{ -public partial class aperturaImpianti { - - /// - /// Controllo mod_aperturaImpianti1. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::mod_aperturaImpianti mod_aperturaImpianti1; + public partial class aperturaImpianti + { + + /// + /// Controllo mod_aperturaImpianti1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::mod_aperturaImpianti mod_aperturaImpianti1; + } } diff --git a/MP-ADM/approvazioneProd.aspx.cs b/MP-ADM/approvazioneProd.aspx.cs index 0d68413f..3ec88ffd 100644 --- a/MP-ADM/approvazioneProd.aspx.cs +++ b/MP-ADM/approvazioneProd.aspx.cs @@ -3,23 +3,22 @@ using System; namespace MP_ADM { - public partial class approvazioneProd : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class approvazioneProd : BasePage { - - checkEnabled(); + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmApprProdEnabled"); + divContent.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: gestione approvazione produzione disabilitata"; + } + lblDataImportOut.Text = messaggio; + } } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmApprProdEnabled"); - divContent.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: gestione approvazione produzione disabilitata"; - } - lblDataImportOut.Text = messaggio; - } - } } \ No newline at end of file diff --git a/MP-ADM/calendChiusura.aspx.cs b/MP-ADM/calendChiusura.aspx.cs index c0817b8d..58336ed7 100644 --- a/MP-ADM/calendChiusura.aspx.cs +++ b/MP-ADM/calendChiusura.aspx.cs @@ -1,9 +1,12 @@ using System; -public partial class calendChiusura : System.Web.UI.Page +namespace MP_ADM { - protected void Page_Load(object sender, EventArgs e) + public partial class calendChiusura : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } -} +} \ No newline at end of file From bef828efafcc30e57be5da4c05d9bf03aebf97bb Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 19:16:44 +0200 Subject: [PATCH 5/9] Continuo fix pagine derivate da classe base --- MP-ADM/BasePage.cs | 24 +- MP-ADM/BaseUserControl.cs | 2 - MP-ADM/DataImport.aspx.cs | 66 ++- MP-ADM/Default.aspx.cs | 10 +- MP-ADM/GestKIT.aspx.cs | 110 ++--- MP-ADM/HwSwInfo.aspx.cs | 8 +- .../mod_gestioneDatiMacchine.ascx | 2 +- .../mod_gestioneDatiMacchine.ascx.cs | 2 +- .../mod_gestioneDatiMacchine.ascx.designer.cs | 47 +- MP-ADM/WebUserControls/mod_login.ascx | 2 +- MP-ADM/WebUserControls/mod_login.ascx.cs | 453 +++++++++--------- .../mod_login.ascx.designer.cs | 269 ++++++----- MP-ADM/forceUser.aspx | 7 +- MP-ADM/forceUser.aspx.cs | 67 ++- MP-ADM/forceUser.aspx.designer.cs | 25 +- MP-ADM/gestPromesseODL.aspx.cs | 8 +- MP-ADM/gestioneDatiMacchine.aspx | 2 +- MP-ADM/gestioneDatiMacchine.aspx.cs | 4 +- MP-ADM/gestioneDatiMacchine.aspx.designer.cs | 5 +- MP-ADM/login.aspx | 8 +- MP-ADM/login.aspx.cs | 31 +- MP-ADM/login.aspx.designer.cs | 16 +- MP-ADM/menu.aspx | 2 +- MP-ADM/menu.aspx.cs | 4 +- MP-ADM/menu.aspx.designer.cs | 3 +- MP-ADM/test.aspx | 2 +- MP-ADM/test.aspx.cs | 9 +- MP-ADM/test.aspx.designer.cs | 107 +++-- MP-ADM/testUtente.aspx.cs | 2 +- 29 files changed, 656 insertions(+), 641 deletions(-) diff --git a/MP-ADM/BasePage.cs b/MP-ADM/BasePage.cs index dd4aad1a..59b6b9f9 100644 --- a/MP-ADM/BasePage.cs +++ b/MP-ADM/BasePage.cs @@ -1,4 +1,5 @@ -using SteamWare; +using MapoDb; +using SteamWare; using System; using System.Collections.Generic; using System.Linq; @@ -7,7 +8,26 @@ using System.Web; namespace MP_ADM { public class BasePage : System.Web.UI.Page - { + { + /// + /// Prox pagina da aprire + /// + protected string _nextPage + { + get + { + string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); + if (pagina == "") + { + pagina = "menu.aspx"; + } + return pagina; + } + } + /// + /// Oggetto datalayer specifico + /// + internal DataLayer DataLayerObj = new DataLayer(); /// /// effettua traduzione del lemma /// diff --git a/MP-ADM/BaseUserControl.cs b/MP-ADM/BaseUserControl.cs index 5ffb8037..2cafedd1 100644 --- a/MP-ADM/BaseUserControl.cs +++ b/MP-ADM/BaseUserControl.cs @@ -13,8 +13,6 @@ namespace MP_ADM /// Oggetto datalayer specifico NON singleton x scalare ///
internal DataLayer DataLayerObj = new DataLayer(); - - /// /// effettua traduzione del lemma /// diff --git a/MP-ADM/DataImport.aspx.cs b/MP-ADM/DataImport.aspx.cs index 7b9f246f..b02f6fce 100644 --- a/MP-ADM/DataImport.aspx.cs +++ b/MP-ADM/DataImport.aspx.cs @@ -4,43 +4,39 @@ using System; namespace MP_ADM { - public partial class DataImport : System.Web.UI.Page - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class DataImport : BasePage { - checkEnabled(); - } + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); - lbtProImportIS.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: import disabilitato"; - } - lblDataImportOut.Text = messaggio; - } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); + lbtProImportIS.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: import disabilitato"; + } + lblDataImportOut.Text = messaggio; + } - /// - /// Esegue import dati - /// - /// - /// - protected void lbtProImportIS_Click(object sender, EventArgs e) - { - bool OptAdmDB_IS_EnabFileImp = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); - // se abilitato... - if (OptAdmDB_IS_EnabFileImp) - { - // chiamo import... - DataLayerObj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0); - } + /// + /// Esegue import dati + /// + /// + /// + protected void lbtProImportIS_Click(object sender, EventArgs e) + { + bool OptAdmDB_IS_EnabFileImp = memLayer.ML.CRB("OptAdmDB_IS_EnabFileImp"); + // se abilitato... + if (OptAdmDB_IS_EnabFileImp) + { + // chiamo import... + DataLayerObj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0); + } + } } - } } \ No newline at end of file diff --git a/MP-ADM/Default.aspx.cs b/MP-ADM/Default.aspx.cs index a37844fb..0db11a0e 100644 --- a/MP-ADM/Default.aspx.cs +++ b/MP-ADM/Default.aspx.cs @@ -2,11 +2,11 @@ namespace MP_ADM { - public partial class _Default : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class _Default : System.Web.UI.Page { - Response.Redirect("./login.aspx"); + protected void Page_Load(object sender, EventArgs e) + { + Response.Redirect("./login.aspx"); + } } - } } diff --git a/MP-ADM/GestKIT.aspx.cs b/MP-ADM/GestKIT.aspx.cs index f680aad8..89455c07 100644 --- a/MP-ADM/GestKIT.aspx.cs +++ b/MP-ADM/GestKIT.aspx.cs @@ -3,65 +3,65 @@ using System; namespace MP_ADM { - public partial class GestKIT : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class GestKIT : BasePage { - checkEnabled(); - string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); - mod_barcode.codOrdPre = codPre != "" ? codPre : "KIT"; - mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; - mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); - mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); - mod_barcode.eh_comandoRegistrato += Mod_barcode_eh_comandoRegistrato; - mod_barcode.eh_dataRead += Mod_barcode_eh_dataRead; - mod_gestKIT.eh_selKit += Mod_gestKIT_eh_selKit; - } + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); + mod_barcode.codOrdPre = codPre != "" ? codPre : "KIT"; + mod_gestPromODL.codOrdPre = mod_barcode.codOrdPre; + mod_gestPromODL.enableSelFase = memLayer.ML.CRB("OptBCode_enbSelFase"); + mod_gestPromODL.CodGruppo = memLayer.ML.CRS("OptBCode_CodGruppo"); + mod_barcode.eh_comandoRegistrato += Mod_barcode_eh_comandoRegistrato; + mod_barcode.eh_dataRead += Mod_barcode_eh_dataRead; + mod_gestKIT.eh_selKit += Mod_gestKIT_eh_selKit; + } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); - divContent.Visible = optPar; - lblDataImportOut.Visible = !optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: Gestione KIT disabilitata"; - lblDataImportOut.Text = messaggio; - } - } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); + divContent.Visible = optPar; + lblDataImportOut.Visible = !optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: Gestione KIT disabilitata"; + lblDataImportOut.Text = messaggio; + } + } - private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) - { - // invio ultimo kit creato a barcode... - mod_barcode.BCodeVal = mod_gestKIT.lastKitMade; - mod_barcode.processInput(); - } + private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) + { + // invio ultimo kit creato a barcode... + mod_barcode.BCodeVal = mod_gestKIT.lastKitMade; + mod_barcode.processInput(); + } - private void Mod_barcode_eh_dataRead(object sender, EventArgs e) - { - // verifico input su KIT x lettura "grezza" - string rawInput = mod_barcode.rawInput; - mod_gestKIT.lastInput = rawInput; - mod_gestKIT.doUpdate(); - } + private void Mod_barcode_eh_dataRead(object sender, EventArgs e) + { + // verifico input su KIT x lettura "grezza" + string rawInput = mod_barcode.rawInput; + mod_gestKIT.lastInput = rawInput; + mod_gestKIT.doUpdate(); + } - private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) - { - // verifico input su KIT x comando completo - string BCodeVal = mod_barcode.BCodeVal; - // se è un ORDINE... procedo! - if (BCodeVal.IndexOf("OPR") == 0) - { - // aggiungo ordine... - mod_gestKIT.addOrdArt(mod_barcode.codOrd, mod_barcode.codArt, mod_barcode.descArt, mod_barcode.qta); - mod_gestKIT.lastInput = ""; - } - else - { - mod_gestKIT.lastInput = mod_barcode.BCodeVal; - } - mod_gestKIT.doUpdate(); + private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) + { + // verifico input su KIT x comando completo + string BCodeVal = mod_barcode.BCodeVal; + // se è un ORDINE... procedo! + if (BCodeVal.IndexOf("OPR") == 0) + { + // aggiungo ordine... + mod_gestKIT.addOrdArt(mod_barcode.codOrd, mod_barcode.codArt, mod_barcode.descArt, mod_barcode.qta); + mod_gestKIT.lastInput = ""; + } + else + { + mod_gestKIT.lastInput = mod_barcode.BCodeVal; + } + mod_gestKIT.doUpdate(); + } } - } } \ No newline at end of file diff --git a/MP-ADM/HwSwInfo.aspx.cs b/MP-ADM/HwSwInfo.aspx.cs index 56090d7a..5f8a7fb4 100644 --- a/MP-ADM/HwSwInfo.aspx.cs +++ b/MP-ADM/HwSwInfo.aspx.cs @@ -7,11 +7,11 @@ using System.Web.UI.WebControls; namespace MP_ADM { - public partial class HwSwInfo : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class HwSwInfo : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx index c931a8c8..fe9b1a85 100644 --- a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx +++ b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_gestioneDatiMacchine.ascx.cs" - Inherits="MoonPro_site.WebUserControls.mod_gestioneDatiMacchine" %> + Inherits="MP_ADM.WebUserControls.mod_gestioneDatiMacchine" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_gestioneDatiMacchine { - + public partial class mod_gestioneDatiMacchine + { + /// - /// grView control. + /// Controllo grView. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.GridView grView; - + /// - /// lblNumRec control. + /// Controllo lblNumRec. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblNumRec; - + /// - /// lblWarning control. + /// Controllo lblWarning. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblWarning; - + /// - /// ods control. + /// Controllo ods. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; } diff --git a/MP-ADM/WebUserControls/mod_login.ascx b/MP-ADM/WebUserControls/mod_login.ascx index 52e6a68f..7205f707 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx +++ b/MP-ADM/WebUserControls/mod_login.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_login" Codebehind="mod_login.ascx.cs" %> +<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_login" Codebehind="mod_login.ascx.cs" %> diff --git a/MP-ADM/WebUserControls/mod_login.ascx.cs b/MP-ADM/WebUserControls/mod_login.ascx.cs index 7c5831e6..15a60cca 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx.cs +++ b/MP-ADM/WebUserControls/mod_login.ascx.cs @@ -2,85 +2,97 @@ using SteamWare; using System; using System.Web.UI; -/// -/// classe gestione login e forzatura login -/// -public partial class mod_login : SteamWare.ApplicationUserControl +namespace MP_ADM.WebUserControls { - #region area protected/private - - #region area proprietà - - private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale; - - #endregion - - #region area metodi - /// - /// imposta la modalità di login tra normale / forceUser + /// classe gestione login e forzatura login /// - private void setLoginMode() + public partial class mod_login : SteamWare.ApplicationUserControl { - switch (_isForceUser) - { - case SteamWare.loginMode.normale: - pnlForceUser.Visible = false; - pnlSelectUser.Visible = false; - break; - case SteamWare.loginMode.forceUser: - pnlForceUser.Visible = true; - pnlSelectUser.Visible = false; - break; - case SteamWare.loginMode.standardUser: - pnlForceUser.Visible = false; - pnlSelectUser.Visible = true; - break; - default: - break; - } - } + #region area protected/private - protected override void traduciObj() - { - lblPwd.Text = user_std.UtSn.Traduci("lblPwd"); - lblUser.Text = user_std.UtSn.Traduci("lblUser"); - lblDominio.Text = user_std.UtSn.Traduci("lblDominio"); - lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente"); - btnOk.Text = user_std.UtSn.Traduci("btnCommit"); - btnOkUserStd.Text = user_std.UtSn.Traduci("btnCommit"); - } + #region area proprietà - /// - /// prova a verificare se l'utente sia ok x AD credentials - /// - private void AdLogin() - { - lblMessage.Text = "User not authenticated..."; - if (Page.User.Identity.IsAuthenticated) + private SteamWare.loginMode _isForceUser = SteamWare.loginMode.normale; + + #endregion + + #region area metodi + + /// + /// imposta la modalità di login tra normale / forceUser + /// + private void setLoginMode() { - //recupera user windows se c'è... - string ad_name = Page.User.Identity.Name; - string delimStr = "\\"; - char[] delimiter = delimStr.ToCharArray(); - string[] dom_user = ad_name.Split(delimiter, 2); - // passo al controllo di verifica ADuserOk... - user_std _utente = new user_std(); - if (_utente.ADuserOk(dom_user[0], dom_user[1])) + switch (_isForceUser) { - bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); - if (fatto) + case SteamWare.loginMode.normale: + pnlForceUser.Visible = false; + pnlSelectUser.Visible = false; + break; + case SteamWare.loginMode.forceUser: + pnlForceUser.Visible = true; + pnlSelectUser.Visible = false; + break; + case SteamWare.loginMode.standardUser: + pnlForceUser.Visible = false; + pnlSelectUser.Visible = true; + break; + default: + break; + } + } + + protected override void traduciObj() + { + lblPwd.Text = user_std.UtSn.Traduci("lblPwd"); + lblUser.Text = user_std.UtSn.Traduci("lblUser"); + lblDominio.Text = user_std.UtSn.Traduci("lblDominio"); + lblTitolo.Text = user_std.UtSn.Traduci("ForzaUtente"); + btnOk.Text = user_std.UtSn.Traduci("btnCommit"); + btnOkUserStd.Text = user_std.UtSn.Traduci("btnCommit"); + } + + /// + /// prova a verificare se l'utente sia ok x AD credentials + /// + private void AdLogin() + { + lblMessage.Text = "User not authenticated..."; + if (Page.User.Identity.IsAuthenticated) + { + //recupera user windows se c'è... + string ad_name = Page.User.Identity.Name; + string delimStr = "\\"; + char[] delimiter = delimStr.ToCharArray(); + string[] dom_user = ad_name.Split(delimiter, 2); + // passo al controllo di verifica ADuserOk... + user_std _utente = new user_std(); + if (_utente.ADuserOk(dom_user[0], dom_user[1])) { - SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO); - if (Login_ok != null) + bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); + if (fatto) { - Login_ok(this, new EventArgs()); + SteamWare.logger.lg.scriviLog(string.Format("L'utente {0} ({1}) ha effettuato il login correttamente", _utente.CognomeNome, _utente.userNameAD), SteamWare.tipoLog.INFO); + if (Login_ok != null) + { + Login_ok(this, new EventArgs()); + } + } + else + { + lblMessage.Text = String.Format("{0}
There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); + SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); + } } } else { - lblMessage.Text = String.Format("{0}
There are some problems instatiating user: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, problemi ad istanziare l'utente {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.ERROR); + lblMessage.Text = String.Format("{0}
user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); + SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING); if (Login_Error != null) { Login_Error(this, new EventArgs()); @@ -89,63 +101,64 @@ public partial class mod_login : SteamWare.ApplicationUserControl } else { - lblMessage.Text = String.Format("{0}
user not allowed: {1}/{2}", user_std.UtSn.Traduci("AccessFail"), dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(String.Format("Utente non autorizzato: {0}/{1}", dom_user[0], dom_user[1]), SteamWare.tipoLog.WARNING); + lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth"); + SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING); if (Login_Error != null) { Login_Error(this, new EventArgs()); } } } - else - { - lblMessage.Text = user_std.UtSn.Traduci("AccessFail") + user_std.UtSn.Traduci("UsrNotAuth"); - SteamWare.logger.lg.scriviLog(String.Format("Accesso fallito, utente non autenticato"), SteamWare.tipoLog.WARNING); - if (Login_Error != null) - { - Login_Error(this, new EventArgs()); - } - } - } - /// - /// effettua verifiche e se concesso permette di forzare l'accesso utente - /// - private void ForceUserIdentity() - { - if (Page.User.Identity.IsAuthenticated) + /// + /// effettua verifiche e se concesso permette di forzare l'accesso utente + /// + private void ForceUserIdentity() { - bool _allowForceUser = false; - try + if (Page.User.Identity.IsAuthenticated) { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); - } - catch - { - _allowForceUser = false; - } - if (_allowForceUser) - { - if (authKey.Text == "forzaInter") // verifica passphrase... + bool _allowForceUser = false; + try { - user_std _utente = new user_std(); - user_std.UtSn.isForcedUser = true; - bool fatto = _utente.startUpUtente(dominio.Text, user.Text); - if (fatto) + _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + } + catch + { + _allowForceUser = false; + } + if (_allowForceUser) + { + if (authKey.Text == "forzaInter") // verifica passphrase... { - string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); - if (Login_ok != null) + user_std _utente = new user_std(); + user_std.UtSn.isForcedUser = true; + bool fatto = _utente.startUpUtente(dominio.Text, user.Text); + if (fatto) { - Login_ok(this, new EventArgs()); + string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); + if (Login_ok != null) + { + Login_ok(this, new EventArgs()); + } + } + } + else + { + lblMessage.Text = String.Format("{0}
key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail")); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); } } } else { - lblMessage.Text = String.Format("{0}
key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail")); - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); - string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); if (Login_Error != null) { @@ -155,155 +168,145 @@ public partial class mod_login : SteamWare.ApplicationUserControl } else { - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); - string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); + lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); if (Login_Error != null) { Login_Error(this, new EventArgs()); } + string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); } } - else + /// + /// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard + /// + private void StdUserIdentity() { - lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); - if (Login_Error != null) + if (Page.User.Identity.IsAuthenticated) { - Login_Error(this, new EventArgs()); - } - string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); - } - } - /// - /// se concesso il generico ForceUser permette di forzare l'accesso utente ad uno degli standard - /// - private void StdUserIdentity() - { - if (Page.User.Identity.IsAuthenticated) - { - bool _allowForceUser = false; - try - { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); - } - catch - { - _allowForceUser = false; - } - if (_allowForceUser) - { - //leggo e codifico utente indicato - string delimStr = "\\"; - char[] delimiter = delimStr.ToCharArray(); - string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2); - //forzo login! - user_std _utente = new user_std(); - user_std.UtSn.isForcedUser = true; - bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); - if (fatto) + bool _allowForceUser = false; + try { - string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); - if (Login_ok != null) + _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + } + catch + { + _allowForceUser = false; + } + if (_allowForceUser) + { + //leggo e codifico utente indicato + string delimStr = "\\"; + char[] delimiter = delimStr.ToCharArray(); + string[] dom_user = ddlStdUser.SelectedValue.Split(delimiter, 2); + //forzo login! + user_std _utente = new user_std(); + user_std.UtSn.isForcedUser = true; + bool fatto = _utente.startUpUtente(dom_user[0], dom_user[1]); + if (fatto) { - Login_ok(this, new EventArgs()); + string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dom_user[0], dom_user[1]); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO); + if (Login_ok != null) + { + Login_ok(this, new EventArgs()); + } + } + + } + else + { + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); + if (Login_Error != null) + { + Login_Error(this, new EventArgs()); } } - } else { - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); - string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); + lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); if (Login_Error != null) { Login_Error(this, new EventArgs()); } + string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text); + SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); } } - else + + /// + /// fa login con force user e controllo pwd + /// + /// + /// + protected void btnOk_Click(object sender, EventArgs e) { - lblMessage.Text = string.Format("{0}
user not authenticated!
", user_std.UtSn.Traduci("AccessFail")); - if (Login_Error != null) + ForceUserIdentity(); + } + /// + /// fa login utente tipo standard + /// + /// + /// + protected void btnOkUserStd_Click(object sender, EventArgs e) + { + StdUserIdentity(); + } + + #endregion + + #endregion + + #region area public + + #region eventi pubblici esposti + + public event EventHandler Login_ok; + public event EventHandler Login_Error; + + #endregion + + #region area proprietà + + /// + /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser + /// + public SteamWare.loginMode modoLogin + { + get { - Login_Error(this, new EventArgs()); + return _isForceUser; + } + set + { + _isForceUser = value; } - string _rigaLog = String.Format("\t Someone tried to force user - real user: \t - not autenticated - \t tried to log as \t {0}\\{1}", dominio.Text, user.Text); - SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); } - } - /// - /// fa login con force user e controllo pwd - /// - /// - /// - protected void btnOk_Click(object sender, EventArgs e) - { - ForceUserIdentity(); - } - /// - /// fa login utente tipo standard - /// - /// - /// - protected void btnOkUserStd_Click(object sender, EventArgs e) - { - StdUserIdentity(); - } + #endregion - #endregion - #endregion - - #region area public - - #region eventi pubblici esposti - - public event EventHandler Login_ok; - public event EventHandler Login_Error; - - #endregion - - #region area proprietà - - /// - /// modalità funzionamento controllo tra normale (ActiveDirectory e user auth di default) e forceUser - /// - public SteamWare.loginMode modoLogin - { - get + /// + /// avvio pagina + /// + protected override void Page_Load(object sender, EventArgs e) { - return _isForceUser; - } - set - { - _isForceUser = value; + base.Page_Load(sender, e); + //carico da web.config i default values + loadDefaultsWebConfig(); + // procedo... + setLoginMode(); + Session.RemoveAll(); + if (_isForceUser == SteamWare.loginMode.normale) + { + AdLogin(); + } } + + #endregion + } - - #endregion - - - /// - /// avvio pagina - /// - protected override void Page_Load(object sender, EventArgs e) - { - base.Page_Load(sender, e); - //carico da web.config i default values - loadDefaultsWebConfig(); - // procedo... - setLoginMode(); - Session.RemoveAll(); - if (_isForceUser == SteamWare.loginMode.normale) - { - AdLogin(); - } - } - - #endregion - } diff --git a/MP-ADM/WebUserControls/mod_login.ascx.designer.cs b/MP-ADM/WebUserControls/mod_login.ascx.designer.cs index 1285a2c5..2647edf4 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_login.ascx.designer.cs @@ -1,140 +1,143 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ +namespace MP_ADM.WebUserControls +{ -public partial class mod_login { - - /// - /// pnlForceUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pnlForceUser; - - /// - /// lblTitolo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblTitolo; - - /// - /// lblPwd control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblPwd; - - /// - /// authKey control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox authKey; - - /// - /// lblDominio control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblDominio; - - /// - /// dominio control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox dominio; - - /// - /// lblUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblUser; - - /// - /// user control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox user; - - /// - /// btnOk control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnOk; - - /// - /// pnlSelectUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pnlSelectUser; - - /// - /// ddlStdUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlStdUser; - - /// - /// btnOkUserStd control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnOkUserStd; - - /// - /// lblMessage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblMessage; - - /// - /// HypLinkSSO control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO; + public partial class mod_login + { + + /// + /// Controllo pnlForceUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Panel pnlForceUser; + + /// + /// Controllo lblTitolo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblTitolo; + + /// + /// Controllo lblPwd. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblPwd; + + /// + /// Controllo authKey. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox authKey; + + /// + /// Controllo lblDominio. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblDominio; + + /// + /// Controllo dominio. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox dominio; + + /// + /// Controllo lblUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblUser; + + /// + /// Controllo user. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox user; + + /// + /// Controllo btnOk. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnOk; + + /// + /// Controllo pnlSelectUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Panel pnlSelectUser; + + /// + /// Controllo ddlStdUser. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlStdUser; + + /// + /// Controllo btnOkUserStd. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnOkUserStd; + + /// + /// Controllo lblMessage. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// Controllo HypLinkSSO. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.HyperLink HypLinkSSO; + } } diff --git a/MP-ADM/forceUser.aspx b/MP-ADM/forceUser.aspx index 425767f2..ec4c177a 100644 --- a/MP-ADM/forceUser.aspx +++ b/MP-ADM/forceUser.aspx @@ -1,9 +1,10 @@ <%@ Page Language="C#" MasterPageFile="~/WebMasterPages/AjaxSimple.master" AutoEventWireup="true" - Inherits="forceUser" Title="MPADM | ForceUser" Codebehind="forceUser.aspx.cs" %> + Inherits="MP_ADM.forceUser" Title="MPADM | ForceUser" Codebehind="forceUser.aspx.cs" %> + +<%@ Register Src="~/WebUserControls/mod_login.ascx" TagPrefix="uc1" TagName="mod_login" %> -<%@ Register Src="WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
- +
diff --git a/MP-ADM/forceUser.aspx.cs b/MP-ADM/forceUser.aspx.cs index aa1271b6..62184ad9 100644 --- a/MP-ADM/forceUser.aspx.cs +++ b/MP-ADM/forceUser.aspx.cs @@ -1,45 +1,36 @@ using System; -public partial class forceUser : System.Web.UI.Page +namespace MP_ADM { - protected string _nextPage + public partial class forceUser : BasePage { - get + + protected void Page_Load(object sender, EventArgs e) { - string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") - { - pagina = "menu.aspx"; - } - return pagina; + mod_login.modoLogin = SteamWare.loginMode.forceUser; + } + + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + mod_login.Login_ok += new EventHandler(Mod_login1_Login_ok); + mod_login.Login_Error += new EventHandler(Mod_login1_Login_Error); + } + + void Mod_login1_Login_Error(object sender, EventArgs e) + { + //Response.Redirect("./unauthorized.aspx"); + } + + void Mod_login1_Login_ok(object sender, EventArgs e) + { + Response.Redirect(_nextPage); + } + protected override void OnUnload(EventArgs e) + { + base.OnUnload(e); + mod_login.Login_ok -= new EventHandler(Mod_login1_Login_ok); + mod_login.Login_Error -= new EventHandler(Mod_login1_Login_Error); } } - - protected void Page_Load(object sender, EventArgs e) - { - Mod_login1.modoLogin = SteamWare.loginMode.forceUser; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - Mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok); - Mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error); - } - - void Mod_login1_Login_Error(object sender, EventArgs e) - { - //Response.Redirect("./unauthorized.aspx"); - } - - void Mod_login1_Login_ok(object sender, EventArgs e) - { - Response.Redirect(_nextPage); - } - protected override void OnUnload(EventArgs e) - { - base.OnUnload(e); - Mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok); - Mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error); - } -} +} \ No newline at end of file diff --git a/MP-ADM/forceUser.aspx.designer.cs b/MP-ADM/forceUser.aspx.designer.cs index 75d56583..fe23e924 100644 --- a/MP-ADM/forceUser.aspx.designer.cs +++ b/MP-ADM/forceUser.aspx.designer.cs @@ -7,17 +7,20 @@ // //------------------------------------------------------------------------------ - - -public partial class forceUser +namespace MP_ADM { - /// - /// Controllo Mod_login1. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::mod_login Mod_login1; + + public partial class forceUser + { + + /// + /// Controllo mod_login. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::MP_ADM.WebUserControls.mod_login mod_login; + } } diff --git a/MP-ADM/gestPromesseODL.aspx.cs b/MP-ADM/gestPromesseODL.aspx.cs index 6dd65ff1..aba9602b 100644 --- a/MP-ADM/gestPromesseODL.aspx.cs +++ b/MP-ADM/gestPromesseODL.aspx.cs @@ -7,11 +7,11 @@ using System.Web.UI.WebControls; namespace MP_ADM { - public partial class gestPromesseODL : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class gestPromesseODL : BasePage { + protected void Page_Load(object sender, EventArgs e) + { + } } - } } \ No newline at end of file diff --git a/MP-ADM/gestioneDatiMacchine.aspx b/MP-ADM/gestioneDatiMacchine.aspx index 23c13396..7f3faef3 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx +++ b/MP-ADM/gestioneDatiMacchine.aspx @@ -1,4 +1,4 @@ -<%@ Page Title="MPADM | Gest Dati Macc" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneDatiMacchine.aspx.cs" Inherits="MoonPro_site.gestioneDatiMacchine" %> +<%@ Page Title="MPADM | Gest Dati Macc" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="gestioneDatiMacchine.aspx.cs" Inherits="MP_ADM.gestioneDatiMacchine" %> <%@ Register src="WebUserControls/mod_gestioneDatiMacchine.ascx" tagname="mod_gestioneDatiMacchine" tagprefix="uc1" %> diff --git a/MP-ADM/gestioneDatiMacchine.aspx.cs b/MP-ADM/gestioneDatiMacchine.aspx.cs index 27affcc3..d97016a4 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx.cs +++ b/MP-ADM/gestioneDatiMacchine.aspx.cs @@ -1,8 +1,8 @@ using System; -namespace MoonPro_site +namespace MP_ADM { - public partial class gestioneDatiMacchine : System.Web.UI.Page + public partial class gestioneDatiMacchine : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/gestioneDatiMacchine.aspx.designer.cs b/MP-ADM/gestioneDatiMacchine.aspx.designer.cs index 02df0ad6..d0e334ec 100644 --- a/MP-ADM/gestioneDatiMacchine.aspx.designer.cs +++ b/MP-ADM/gestioneDatiMacchine.aspx.designer.cs @@ -7,7 +7,8 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { +namespace MP_ADM +{ public partial class gestioneDatiMacchine { @@ -19,6 +20,6 @@ namespace MoonPro_site { /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonPro_site.WebUserControls.mod_gestioneDatiMacchine mod_gestioneDatiMacchine1; + protected global::MP_ADM.WebUserControls.mod_gestioneDatiMacchine mod_gestioneDatiMacchine1; } } diff --git a/MP-ADM/login.aspx b/MP-ADM/login.aspx index e7bf1113..ef03141b 100644 --- a/MP-ADM/login.aspx +++ b/MP-ADM/login.aspx @@ -1,8 +1,10 @@ -<%@ Page Title="MPADM | Login" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro_noAjax.master" AutoEventWireup="true" Inherits="MoonPro_site.login" Codebehind="login.aspx.cs" %> +<%@ Page Title="MPADM | Login" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro_noAjax.master" AutoEventWireup="true" Inherits="MP_ADM.login" Codebehind="login.aspx.cs" %> + +<%@ Register Src="~/WebUserControls/mod_login.ascx" TagPrefix="uc1" TagName="mod_login" %> + -<%@ Register Src="~/WebUserControls/mod_login.ascx" TagName="mod_login" TagPrefix="uc1" %>
- +
diff --git a/MP-ADM/login.aspx.cs b/MP-ADM/login.aspx.cs index 7b09792f..508db0e5 100644 --- a/MP-ADM/login.aspx.cs +++ b/MP-ADM/login.aspx.cs @@ -1,48 +1,35 @@ using System; -namespace MoonPro_site +namespace MP_ADM { - public partial class login : System.Web.UI.Page + public partial class login : BasePage { - protected string _nextPage - { - get - { - string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); - if (pagina == "") - { - pagina = "menu.aspx"; - } - return pagina; - } - } - protected void Page_Load(object sender, EventArgs e) { - Mod_login1.modoLogin = SteamWare.loginMode.normale; + mod_login.modoLogin = SteamWare.loginMode.normale; } protected override void OnInit(EventArgs e) { base.OnInit(e); - Mod_login1.Login_ok += new EventHandler(Mod_login1_Login_ok); - Mod_login1.Login_Error += new EventHandler(Mod_login1_Login_Error); + mod_login.Login_ok += new EventHandler(mod_login_Login_ok); + mod_login.Login_Error += new EventHandler(mod_login_Login_Error); } - void Mod_login1_Login_Error(object sender, EventArgs e) + void mod_login_Login_Error(object sender, EventArgs e) { Response.Redirect("./unauthorized.aspx"); } - void Mod_login1_Login_ok(object sender, EventArgs e) + void mod_login_Login_ok(object sender, EventArgs e) { Response.Redirect(_nextPage); } protected override void OnUnload(EventArgs e) { base.OnUnload(e); - Mod_login1.Login_ok -= new EventHandler(Mod_login1_Login_ok); - Mod_login1.Login_Error -= new EventHandler(Mod_login1_Login_Error); + mod_login.Login_ok -= new EventHandler(mod_login_Login_ok); + mod_login.Login_Error -= new EventHandler(mod_login_Login_Error); } } } \ No newline at end of file diff --git a/MP-ADM/login.aspx.designer.cs b/MP-ADM/login.aspx.designer.cs index 3568f4a5..499453f8 100644 --- a/MP-ADM/login.aspx.designer.cs +++ b/MP-ADM/login.aspx.designer.cs @@ -7,18 +7,20 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { - - - public partial class login { - +namespace MP_ADM +{ + + + public partial class login + { + /// - /// Controllo Mod_login1. + /// Controllo mod_login. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::mod_login Mod_login1; + protected global::MP_ADM.WebUserControls.mod_login mod_login; } } diff --git a/MP-ADM/menu.aspx b/MP-ADM/menu.aspx index 99078a93..9879fd6a 100644 --- a/MP-ADM/menu.aspx +++ b/MP-ADM/menu.aspx @@ -1,4 +1,4 @@ -<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="MoonPro_site.menu" Title="MPADM" Codebehind="menu.aspx.cs" %> +<%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" Inherits="MP_ADM.menu" Title="MPADM" Codebehind="menu.aspx.cs" %> <%@ Register Src="~/WebUserControls/mod_main_help.ascx" TagName="mod_main_help" TagPrefix="uc2" %> diff --git a/MP-ADM/menu.aspx.cs b/MP-ADM/menu.aspx.cs index 4ab870ca..f50fba71 100644 --- a/MP-ADM/menu.aspx.cs +++ b/MP-ADM/menu.aspx.cs @@ -1,6 +1,6 @@ -namespace MoonPro_site +namespace MP_ADM { - public partial class menu : System.Web.UI.Page + public partial class menu : BasePage { } } \ No newline at end of file diff --git a/MP-ADM/menu.aspx.designer.cs b/MP-ADM/menu.aspx.designer.cs index d61736b5..32f00939 100644 --- a/MP-ADM/menu.aspx.designer.cs +++ b/MP-ADM/menu.aspx.designer.cs @@ -7,7 +7,8 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site { +namespace MP_ADM +{ public partial class menu { diff --git a/MP-ADM/test.aspx b/MP-ADM/test.aspx index 0949ad31..3c4c8698 100644 --- a/MP-ADM/test.aspx +++ b/MP-ADM/test.aspx @@ -1,5 +1,5 @@ <%@ Page Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" - Inherits="test" Title="Untitled Page" CodeBehind="test.aspx.cs" %> + Inherits="MP_ADM.test" Title="TEST Page" CodeBehind="test.aspx.cs" %> <%@ Register Assembly="SteamWare" Namespace="SteamWare" TagPrefix="cc1" %> diff --git a/MP-ADM/test.aspx.cs b/MP-ADM/test.aspx.cs index 3ee0225f..f11db90d 100644 --- a/MP-ADM/test.aspx.cs +++ b/MP-ADM/test.aspx.cs @@ -1,9 +1,12 @@ using System; -public partial class test : System.Web.UI.Page +namespace MP_ADM { - protected void Page_Load(object sender, EventArgs e) + public partial class test : BasePage { - lblOut.Text = string.Format("H: {0} - W: {1}", Session["WindowHeight"], Session["WindowWidth"]); + protected void Page_Load(object sender, EventArgs e) + { + lblOut.Text = string.Format("H: {0} - W: {1}", Session["WindowHeight"], Session["WindowWidth"]); + } } } diff --git a/MP-ADM/test.aspx.designer.cs b/MP-ADM/test.aspx.designer.cs index 7daffb1c..dffaf421 100644 --- a/MP-ADM/test.aspx.designer.cs +++ b/MP-ADM/test.aspx.designer.cs @@ -1,59 +1,62 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ +namespace MP_ADM +{ -public partial class test { - - /// - /// Image1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image1; - - /// - /// Image4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image4; - - /// - /// Image2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image2; - - /// - /// Image3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Image Image3; - - /// - /// lblOut control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblOut; + public partial class test + { + + /// + /// Controllo Image1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// Controllo Image4. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image4; + + /// + /// Controllo Image2. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image2; + + /// + /// Controllo Image3. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Image Image3; + + /// + /// Controllo lblOut. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblOut; + } } diff --git a/MP-ADM/testUtente.aspx.cs b/MP-ADM/testUtente.aspx.cs index cb47df2b..80d0038a 100644 --- a/MP-ADM/testUtente.aspx.cs +++ b/MP-ADM/testUtente.aspx.cs @@ -3,7 +3,7 @@ using System.Web.UI; namespace MP_ADM { - public partial class testUtente : System.Web.UI.Page + public partial class testUtente : BasePage { protected void Page_Load(object sender, EventArgs e) { From 000ad35f181dfdea74d9eb0e833cce3cb5117db6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 7 Sep 2020 19:21:46 +0200 Subject: [PATCH 6/9] typo reformat web.config --- MP-ADM/Web.config | 710 +++++++++++++++++++++++----------------------- 1 file changed, 356 insertions(+), 354 deletions(-) diff --git a/MP-ADM/Web.config b/MP-ADM/Web.config index d82e9796..a7a989e7 100644 --- a/MP-ADM/Web.config +++ b/MP-ADM/Web.config @@ -4,356 +4,358 @@ https://go.microsoft.com/fwlink/?LinkId=169433 --> - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + From 300e27ee261bb3376073aa3397cfb70165268634 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 9 Sep 2020 11:39:45 +0200 Subject: [PATCH 7/9] Completamento porting a BaseUserControl x MP_ADM --- MP-ADM/BasePage.cs | 2 +- MP-ADM/BaseUserControl.cs | 99 ++ MP-ADM/Planner.aspx.cs | 144 +- MP-ADM/StoricoTC.aspx.cs | 2 +- MP-ADM/WebMasterPages/AjaxSimple.master.cs | 2 +- .../WebMasterPages/MoonPro.master.designer.cs | 2 +- MP-ADM/WebUserControls/cmp_HwSwInfo.ascx | 2 +- MP-ADM/WebUserControls/cmp_HwSwInfo.ascx.cs | 2 +- .../WebUserControls/mod_anagArticoli.ascx.cs | 6 +- MP-ADM/WebUserControls/mod_approvProd.ascx.cs | 289 ++-- .../mod_approvazioneODL.ascx.cs | 282 ++-- MP-ADM/WebUserControls/mod_barcode.ascx.cs | 1309 ++++++++-------- MP-ADM/WebUserControls/mod_fixCal.ascx.cs | 12 +- .../mod_fixCal.ascx.designer.cs | 44 +- MP-ADM/WebUserControls/mod_footer.ascx.cs | 12 +- MP-ADM/WebUserControls/mod_gestKIT.ascx.cs | 475 +++--- .../WebUserControls/mod_gestPromODL.ascx.cs | 1196 ++++++++------- .../mod_gestPromODL_OUT.ascx.cs | 1311 ++++++++--------- .../mod_gestioneDatiMacchine.ascx.cs | 48 +- .../mod_gestioneODL.ascx.designer.cs | 2 +- MP-ADM/WebUserControls/mod_login.ascx.cs | 10 +- MP-ADM/WebUserControls/mod_main_help.ascx | 88 +- MP-ADM/WebUserControls/mod_menuBottom.ascx.cs | 19 +- .../mod_menuBottom.ascx.designer.cs | 78 +- MP-ADM/WebUserControls/mod_menuTop.ascx | 4 +- MP-ADM/WebUserControls/mod_menuTop.ascx.cs | 305 ++-- .../mod_menuTop.ascx.designer.cs | 2 +- .../mod_menuTopCompact.ascx.cs | 192 +-- MP-ADM/WebUserControls/mod_newOdl.ascx | 2 +- MP-ADM/WebUserControls/mod_newOdl.ascx.cs | 302 ++-- .../mod_newOdl.ascx.designer.cs | 159 +- .../mod_newPromessaODL.ascx.cs | 524 ++++--- .../mod_ricercaGenerica.ascx.cs | 14 +- MP-ADM/WebUserControls/mod_storicoTC.ascx.cs | 2 +- MP-ADM/WebUserControls/mod_unauthorized.ascx | 29 +- .../WebUserControls/mod_unauthorized.ascx.cs | 9 +- .../mod_unauthorized.ascx.designer.cs | 40 +- MP-ADM/approvazioneODL.aspx.cs | 32 +- MP-ADM/approvazioneODL.aspx.designer.cs | 2 +- MP-ADM/calendChiusura.aspx | 2 +- MP-ADM/calendChiusura.aspx.designer.cs | 11 +- 41 files changed, 3476 insertions(+), 3591 deletions(-) diff --git a/MP-ADM/BasePage.cs b/MP-ADM/BasePage.cs index 59b6b9f9..769033c7 100644 --- a/MP-ADM/BasePage.cs +++ b/MP-ADM/BasePage.cs @@ -16,7 +16,7 @@ namespace MP_ADM { get { - string pagina = SteamWare.memLayer.ML.StringSessionObj("nextPage"); + string pagina = memLayer.ML.StringSessionObj("nextPage"); if (pagina == "") { pagina = "menu.aspx"; diff --git a/MP-ADM/BaseUserControl.cs b/MP-ADM/BaseUserControl.cs index 2cafedd1..a154ac97 100644 --- a/MP-ADM/BaseUserControl.cs +++ b/MP-ADM/BaseUserControl.cs @@ -9,10 +9,74 @@ namespace MP_ADM { public class BaseUserControl : System.Web.UI.UserControl { + #region gestione eventi + + public event EventHandler eh_nuovoValore; + public event EventHandler eh_resetSelezione; + public event EventHandler eh_selValore; + + + /// + /// Solleva evento nuovo valore + /// + public void raiseNewVal() + { + // evento come nuovo... + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } + } + + public void raiseSelNew() + { + // sollevo evento nuovo valore... + if (eh_selValore != null) + { + eh_selValore(this, new EventArgs()); + } + } + /// + /// Solleva evento reset + /// + public void raiseReset() + { + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + + #endregion + /// /// Oggetto datalayer specifico NON singleton x scalare /// internal DataLayer DataLayerObj = new DataLayer(); + + /// + /// UID formattato con "_" + /// + public string uid + { + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + /// + /// titolo pagina + /// + public string titolo + { + get + { + return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", ""); + } + } + + #region utils + /// /// effettua traduzione del lemma /// @@ -31,5 +95,40 @@ namespace MP_ADM { return user_std.UtSn.TraduciEn(lemma); } + + /// + /// formatta in minuti/sec partendo da min.cent + /// + /// + /// + public string minSec(object minCent) + { + string answ = ""; + try + { + answ = string.Format("{0:mm}:{0:ss}", minCent2Sec(Convert.ToDecimal(minCent.ToString().Replace(".", ",")))); + } + catch + { } + return answ; + } + /// + /// conversione da tempo minuti centesimali a minuti/secondi + /// + /// + /// + protected TimeSpan minCent2Sec(decimal valore) + { + TimeSpan answ = new TimeSpan(0, 0, 1); + try + { + answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60)); + } + catch + { } + return answ; + } + + #endregion } } \ No newline at end of file diff --git a/MP-ADM/Planner.aspx.cs b/MP-ADM/Planner.aspx.cs index cdccd8ab..0ebad8ab 100644 --- a/MP-ADM/Planner.aspx.cs +++ b/MP-ADM/Planner.aspx.cs @@ -3,98 +3,98 @@ using System; namespace MP_ADM { - public partial class Planner : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class Planner : BasePage { - if(!Page.IsPostBack) - { - toggleVisibility(); - } - checkEnabled(); - string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); - mod_planStats.eh_reset += Mod_planStats_eh_reset; - mod_planStats.eh_selVal += Mod_planStats_eh_selVal; - mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev; - } + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + toggleVisibility(); + } + checkEnabled(); + string codPre = memLayer.ML.CRS("OptAdmKit_CodPre"); + mod_planStats.eh_reset += Mod_planStats_eh_reset; + mod_planStats.eh_selVal += Mod_planStats_eh_selVal; + mod_planCreate.eh_ucev += Mod_planCreate_eh_ucev; + } - private void Mod_planCreate_eh_ucev(object sender, EventArgs e) - { - // se trovo evento select/reset mostro/nascondo dettagli... - ucEvent evento = (ucEvent)e; - switch (evento.tipoEvento) - { - case ucEvType.ReqUpdateParent: - mod_planStats.doReset(); - mod_gestPromODL_OUT.resetSelezione(); - break; - default: - break; - } - } + private void Mod_planCreate_eh_ucev(object sender, EventArgs e) + { + // se trovo evento select/reset mostro/nascondo dettagli... + ucEvent evento = (ucEvent)e; + switch (evento.tipoEvento) + { + case ucEvType.ReqUpdateParent: + mod_planStats.doReset(); + mod_gestPromODL_OUT.resetSelezione(); + break; + default: + break; + } + } - protected void lbtToggle_Click(object sender, EventArgs e) - { - toggleVisibility(); - } + protected void lbtToggle_Click(object sender, EventArgs e) + { + toggleVisibility(); + } - private void toggleVisibility() - { - divPromOUT.Visible = !divPromOUT.Visible; - tgIcon.Attributes["class"] = divPromOUT.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down"; - } - private void Mod_planStats_eh_selVal(object sender, EventArgs e) - { - fixSelStat(); - } + private void toggleVisibility() + { + divPromOUT.Visible = !divPromOUT.Visible; + tgIcon.Attributes["class"] = divPromOUT.Visible ? "fa fa-chevron-up" : "fa fa-chevron-down"; + } + private void Mod_planStats_eh_selVal(object sender, EventArgs e) + { + fixSelStat(); + } - private void Mod_planStats_eh_reset(object sender, EventArgs e) - { - fixSelStat(); - } + private void Mod_planStats_eh_reset(object sender, EventArgs e) + { + fixSelStat(); + } - protected void fixSelStat() - { - mod_planCreate.CodGruppo = mod_planStats.CodGruppo; - mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina; - mod_planCreate.CodArticolo = mod_planStats.CodArticolo; - mod_planCreate.doUpdate(); - } + protected void fixSelStat() + { + mod_planCreate.CodGruppo = mod_planStats.CodGruppo; + mod_planCreate.IdxMacchina = mod_planStats.IdxMacchina; + mod_planCreate.CodArticolo = mod_planStats.CodArticolo; + mod_planCreate.doUpdate(); + } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); - divContent.Visible = optPar; - lblDataImportOut.Visible = !optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: Gestione KIT disabilitata"; - lblDataImportOut.Text = messaggio; - } - } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmKitEnabled"); + divContent.Visible = optPar; + lblDataImportOut.Visible = !optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: Gestione KIT disabilitata"; + lblDataImportOut.Text = messaggio; + } + } - private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) - { + private void Mod_gestKIT_eh_selKit(object sender, EventArgs e) + { #if false // invio ultimo kit creato a barcode... mod_barcode.BCodeVal = mod_gestKIT.lastKitMade; mod_barcode.processInput(); #endif - } + } - private void Mod_barcode_eh_dataRead(object sender, EventArgs e) - { + private void Mod_barcode_eh_dataRead(object sender, EventArgs e) + { #if false // verifico input su KIT x lettura "grezza" string rawInput = mod_barcode.rawInput; mod_gestKIT.lastInput = rawInput; mod_gestKIT.doUpdate(); #endif - } + } - private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) - { + private void Mod_barcode_eh_comandoRegistrato(object sender, EventArgs e) + { #if false // verifico input su KIT x comando completo string BCodeVal = mod_barcode.BCodeVal; @@ -111,6 +111,6 @@ namespace MP_ADM } mod_gestKIT.doUpdate(); #endif + } } - } } \ No newline at end of file diff --git a/MP-ADM/StoricoTC.aspx.cs b/MP-ADM/StoricoTC.aspx.cs index c4d2c5dd..0b6b21f1 100644 --- a/MP-ADM/StoricoTC.aspx.cs +++ b/MP-ADM/StoricoTC.aspx.cs @@ -2,7 +2,7 @@ namespace MP_ADM { - public partial class StoricoTC : System.Web.UI.Page + public partial class StoricoTC : BasePage { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/WebMasterPages/AjaxSimple.master.cs b/MP-ADM/WebMasterPages/AjaxSimple.master.cs index 29c4c87c..bc961687 100644 --- a/MP-ADM/WebMasterPages/AjaxSimple.master.cs +++ b/MP-ADM/WebMasterPages/AjaxSimple.master.cs @@ -6,6 +6,6 @@ public partial class AjaxSimple : System.Web.UI.MasterPage protected override void OnLoad(EventArgs e) { base.OnLoad(e); - Page.Title = SteamWare.memLayer.ML.CRS("_titoloPagina"); + Page.Title = memLayer.ML.CRS("_titoloPagina"); } } diff --git a/MP-ADM/WebMasterPages/MoonPro.master.designer.cs b/MP-ADM/WebMasterPages/MoonPro.master.designer.cs index 794bc26c..e9d3c276 100644 --- a/MP-ADM/WebMasterPages/MoonPro.master.designer.cs +++ b/MP-ADM/WebMasterPages/MoonPro.master.designer.cs @@ -63,7 +63,7 @@ public partial class MoonPro { /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonPro_site.WebUserControls.mod_menuTop Mod_menuTop1; + protected global::MP_ADM.WebUserControls.mod_menuTop Mod_menuTop1; /// /// Controllo UpdatePanel1. diff --git a/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx b/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx index cd59fce9..ac810dac 100644 --- a/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx +++ b/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx @@ -19,7 +19,7 @@
Module
-

<%: SteamWare.memLayer.ML.confReadString("CodModulo") %>

+

<%: memLayer.ML.confReadString("CodModulo") %>

diff --git a/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx.cs b/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx.cs index ed314d83..c87dae36 100644 --- a/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx.cs +++ b/MP-ADM/WebUserControls/cmp_HwSwInfo.ascx.cs @@ -7,7 +7,7 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class cmp_HwSwInfo : System.Web.UI.UserControl + public partial class cmp_HwSwInfo : BaseUserControl { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs b/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs index 4d160e49..ce08ac7b 100644 --- a/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs +++ b/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs @@ -6,7 +6,7 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_anagArticoli : System.Web.UI.UserControl + public partial class mod_anagArticoli : BaseUserControl { /// @@ -37,7 +37,7 @@ namespace MP_ADM.WebUserControls protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // salvo in session il valore selezionato... - SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); // sollevo evento nuovo valore... if (eh_selValore != null) { @@ -167,7 +167,7 @@ namespace MP_ADM.WebUserControls /// public void resetSelezione() { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); grView.SelectedIndex = -1; grView.DataBind(); lblWarning.Visible = false; diff --git a/MP-ADM/WebUserControls/mod_approvProd.ascx.cs b/MP-ADM/WebUserControls/mod_approvProd.ascx.cs index fa76d94f..59907a25 100644 --- a/MP-ADM/WebUserControls/mod_approvProd.ascx.cs +++ b/MP-ADM/WebUserControls/mod_approvProd.ascx.cs @@ -6,161 +6,148 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_approvProd : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class mod_approvProd : BaseUserControl { - if (!Page.IsPostBack) - { - grView.PageSize = pageSize; - } - } - /// - /// dimensione pagina - /// - public int pageSize - { - get - { - int answ = 10; - try + protected void Page_Load(object sender, EventArgs e) { - answ = Convert.ToInt32(txtPageSize.Text); + if (!Page.IsPostBack) + { + grView.PageSize = pageSize; + } } - catch - { } - return answ; - } - set - { - txtPageSize.Text = value.ToString(); - } - } - /// - /// wrapper traduzione - /// - /// - /// - public string traduci(object lemma) - { - return user_std.UtSn.Traduci(lemma.ToString()); - } - /// - /// seleziona/deseleziona le righe indicate... - /// - /// - /// - protected void btnSelAll_Click(object sender, EventArgs e) - { - // seleziono tutti i valori visibili nel datagrid - CheckBox chkbox = ((CheckBox)sender); - bool isChecked = chkbox.Checked; - if (!isChecked) - { - chkbox.ToolTip = traduci("btnSelAll"); - } - else - { - chkbox.ToolTip = traduci("btnDeselAll"); - } - foreach (GridViewRow riga in grView.Rows) - { - ((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked; - } - } - /// - /// conferma dati produzione verso As400 - /// - /// - /// - protected void lbtApprovaProd_Click(object sender, EventArgs e) - { - foreach (GridViewRow riga in grView.Rows) - { - int IdxODL = 0; - DateTime DataRif = DateTime.Now.Date; - if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible) + /// + /// dimensione pagina + /// + public int pageSize { - try - { - IdxODL = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text); - DataRif = Convert.ToDateTime(((Label)riga.FindControl("lblDataRif")).Text); - } - catch - { } - DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif); + get + { + int answ = 10; + try + { + answ = Convert.ToInt32(txtPageSize.Text); + } + catch + { } + return answ; + } + set + { + txtPageSize.Text = value.ToString(); + } + } + /// + /// seleziona/deseleziona le righe indicate... + /// + /// + /// + protected void btnSelAll_Click(object sender, EventArgs e) + { + // seleziono tutti i valori visibili nel datagrid + CheckBox chkbox = ((CheckBox)sender); + bool isChecked = chkbox.Checked; + if (!isChecked) + { + chkbox.ToolTip = traduci("btnSelAll"); + } + else + { + chkbox.ToolTip = traduci("btnDeselAll"); + } + foreach (GridViewRow riga in grView.Rows) + { + ((CheckBox)riga.FindControl("chkSelect")).Checked = isChecked; + } + } + /// + /// conferma dati produzione verso As400 + /// + /// + /// + protected void lbtApprovaProd_Click(object sender, EventArgs e) + { + foreach (GridViewRow riga in grView.Rows) + { + int IdxODL = 0; + DateTime DataRif = DateTime.Now.Date; + if (((CheckBox)riga.FindControl("chkSelect")).Checked && ((CheckBox)riga.FindControl("chkSelect")).Visible) + { + try + { + IdxODL = Convert.ToInt32(((Label)riga.FindControl("lblIdxODL")).Text); + DataRif = Convert.ToDateTime(((Label)riga.FindControl("lblDataRif")).Text); + } + catch + { } + DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif); + } + } + grView.DataBind(); + } + /// + /// salvo comando + /// + /// + /// + protected void lbt_Command(object sender, CommandEventArgs e) + { + memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); + } + /// + /// evento selezione riga: salvo tempo e qta nei campi input... + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // ricavo i dati selezionati + int IdxODL = 0; + DateTime DataRif = DateTime.Now.Date; + try + { + IdxODL = Convert.ToInt32(grView.SelectedDataKey[0]); + DataRif = Convert.ToDateTime(grView.SelectedDataKey[1]); + } + catch + { } + // gestione buttons approvazione + string _comando = ""; + if (memLayer.ML.isInSessionObject("nextObjCommand")) + { + _comando = memLayer.ML.StringSessionObj("nextObjCommand"); + memLayer.ML.emptySessionVal("nextObjCommand"); + } + switch (_comando) + { + case "Approva": + DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif); + break; + default: + break; + } + grView.SelectedIndex = -1; + grView.DataBind(); + } + /// + /// cambio dim pagina + /// + /// + /// + protected void txtPageSize_TextChanged(object sender, EventArgs e) + { + grView.PageSize = pageSize; + } + /// + /// effettua caricamento interventi pending + /// + /// + /// + protected void lbtImportPending_Click(object sender, EventArgs e) + { + // forzo rilettura dati da approvare... + DataLayerObj.taAs400.ImportDati_ElencoConfermeProd(); + // update tab... + grView.DataBind(); } - } - grView.DataBind(); } - /// - /// salvo comando - /// - /// - /// - protected void lbt_Command(object sender, CommandEventArgs e) - { - SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); - } - /// - /// evento selezione riga: salvo tempo e qta nei campi input... - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - // ricavo i dati selezionati - int IdxODL = 0; - DateTime DataRif = DateTime.Now.Date; - try - { - IdxODL = Convert.ToInt32(grView.SelectedDataKey[0]); - DataRif = Convert.ToDateTime(grView.SelectedDataKey[1]); - } - catch - { } - // gestione buttons approvazione - string _comando = ""; - if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand")) - { - _comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand"); - SteamWare.memLayer.ML.emptySessionVal("nextObjCommand"); - } - switch (_comando) - { - case "Approva": - DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif); - break; - default: - break; - } - grView.SelectedIndex = -1; - grView.DataBind(); - } - /// - /// cambio dim pagina - /// - /// - /// - protected void txtPageSize_TextChanged(object sender, EventArgs e) - { - grView.PageSize = pageSize; - } - /// - /// effettua caricamento interventi pending - /// - /// - /// - protected void lbtImportPending_Click(object sender, EventArgs e) - { - // forzo rilettura dati da approvare... - DataLayerObj.taAs400.ImportDati_ElencoConfermeProd(); - // update tab... - grView.DataBind(); - } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_approvazioneODL.ascx.cs b/MP-ADM/WebUserControls/mod_approvazioneODL.ascx.cs index ecee21bb..f343e6d9 100644 --- a/MP-ADM/WebUserControls/mod_approvazioneODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_approvazioneODL.ascx.cs @@ -6,167 +6,131 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_approvazioneODL : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class mod_approvazioneODL : BaseUserControl { - if (!Page.IsPostBack) - { - grView.PageSize = pageSize; - } - } - /// - /// dimensione pagina - /// - public int pageSize - { - get - { - int answ = 10; - try + protected void Page_Load(object sender, EventArgs e) { - answ = Convert.ToInt32(txtPageSize.Text); + if (!Page.IsPostBack) + { + grView.PageSize = pageSize; + } + } + /// + /// dimensione pagina + /// + public int pageSize + { + get + { + int answ = 10; + try + { + answ = Convert.ToInt32(txtPageSize.Text); + } + catch + { } + return answ; + } + set + { + txtPageSize.Text = value.ToString(); + } + } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + } + /// + /// salvo comando + /// + /// + /// + protected void lbt_Command(object sender, CommandEventArgs e) + { + memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); + } + /// + /// evento selezione riga: salvo tempo e qta nei campi input... + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // ricavo i dati selezionati + int idxOdl = 0; + try + { + idxOdl = Convert.ToInt32(grView.SelectedValue); + } + catch + { } + MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; + // gestione buttons approvazione + string _comando = ""; + if (memLayer.ML.isInSessionObject("nextObjCommand")) + { + _comando = memLayer.ML.StringSessionObj("nextObjCommand"); + memLayer.ML.emptySessionVal("nextObjCommand"); + } + switch (_comando) + { + case "Approva": + DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true); + break; + case "Rifiuta": + DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false); + break; + default: + break; + } + grView.SelectedIndex = -1; + grView.DataBind(); + } + /// + /// cambio dim pagina + /// + /// + /// + protected void txtPageSize_TextChanged(object sender, EventArgs e) + { + grView.PageSize = pageSize; + } + /// + /// Classe css colore testo calcolato in abse ai TC + /// + /// + /// + /// + public string cssFromTempi(object _tcAssegnato, object _tcAttrezzato) + { + string answ = "text-dark"; + double tcAssegnato = 0; + double tcAttrezzato = 0; + double.TryParse(_tcAssegnato.ToString(), out tcAssegnato); + double.TryParse(_tcAttrezzato.ToString(), out tcAttrezzato); + if (tcAttrezzato > tcAssegnato) + { + answ = "text-danger"; + } + else + if (tcAttrezzato < tcAssegnato) + { + answ = "text-success"; + } + return answ; } - catch - { } - return answ; - } - set - { - txtPageSize.Text = value.ToString(); - } } - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - grView.SelectedIndex = -1; - grView.DataBind(); - } - /// - /// salvo comando - /// - /// - /// - protected void lbt_Command(object sender, CommandEventArgs e) - { - SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); - } - /// - /// evento selezione riga: salvo tempo e qta nei campi input... - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - // ricavo i dati selezionati - int idxOdl = 0; - try - { - idxOdl = Convert.ToInt32(grView.SelectedValue); - } - catch - { } - MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; - // gestione buttons approvazione - string _comando = ""; - if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand")) - { - _comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand"); - SteamWare.memLayer.ML.emptySessionVal("nextObjCommand"); - } - switch (_comando) - { - case "Approva": - DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true); - break; - case "Rifiuta": - DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false); - break; - default: - break; - } - grView.SelectedIndex = -1; - grView.DataBind(); - } - /// - /// cambio dim pagina - /// - /// - /// - protected void txtPageSize_TextChanged(object sender, EventArgs e) - { - grView.PageSize = pageSize; - } - /// - /// formatta in minuti/sec partendo da min.cent - /// - /// - /// - public string minSec(object minCent) - { - string answ = ""; - try - { - answ = string.Format("{0:mm}:{0:ss}", minCent2Sec(Convert.ToDecimal(minCent.ToString().Replace(".", ",")))); - } - catch - { } - return answ; - } - /// - /// conversione da tempo minuti centesimali a minuti/secondi - /// - /// - /// - protected TimeSpan minCent2Sec(decimal valore) - { - TimeSpan answ = new TimeSpan(0, 0, 1); - try - { - answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60)); - } - catch - { } - return answ; - } - /// - /// Classe css colore testo calcolato in abse ai TC - /// - /// - /// - /// - public string cssFromTempi(object _tcAssegnato, object _tcAttrezzato) - { - string answ = "text-dark"; - double tcAssegnato = 0; - double tcAttrezzato = 0; - double.TryParse(_tcAssegnato.ToString(), out tcAssegnato); - double.TryParse(_tcAttrezzato.ToString(), out tcAttrezzato); - if (tcAttrezzato > tcAssegnato) - { - answ = "text-danger"; - } - else - if (tcAttrezzato < tcAssegnato) - { - answ = "text-success"; - } - return answ; - } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_barcode.ascx.cs b/MP-ADM/WebUserControls/mod_barcode.ascx.cs index 1f467abb..f608d7a4 100644 --- a/MP-ADM/WebUserControls/mod_barcode.ascx.cs +++ b/MP-ADM/WebUserControls/mod_barcode.ascx.cs @@ -7,703 +7,672 @@ using System.Web.UI; namespace MP_ADM.WebUserControls { - public partial class mod_barcode : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); + public partial class mod_barcode : BaseUserControl + { - #region setup VARS + #region setup VARS - /// - /// RegExp x RESET / CANCEL - /// - protected string regExp_KO = memLayer.ML.cdv("regExp_KO"); - /// - /// RegExp x CONFERMA - /// - protected string regExp_OK = memLayer.ML.cdv("regExp_OK"); - /// - /// RegExp x START KIT - /// - protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart"); - /// - /// RegExp x SAVE KIT - /// - protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave"); - /// - /// RegExp x Find --> replace (se vettore è | delimited) - /// - protected string regExp_Find = memLayer.ML.cdv("regExp_Find"); - /// - /// RegExp x Replace da Find (se vettore è | delimited) - /// - protected string regExp_Replace = memLayer.ML.cdv("regExp_Replace"); + /// + /// RegExp x RESET / CANCEL + /// + protected string regExp_KO = memLayer.ML.cdv("regExp_KO"); + /// + /// RegExp x CONFERMA + /// + protected string regExp_OK = memLayer.ML.cdv("regExp_OK"); + /// + /// RegExp x START KIT + /// + protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart"); + /// + /// RegExp x SAVE KIT + /// + protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave"); + /// + /// RegExp x Find --> replace (se vettore è | delimited) + /// + protected string regExp_Find = memLayer.ML.cdv("regExp_Find"); + /// + /// RegExp x Replace da Find (se vettore è | delimited) + /// + protected string regExp_Replace = memLayer.ML.cdv("regExp_Replace"); - #endregion + #endregion - #region variabili in sessione + #region variabili in sessione - /// - /// UID formattato con "_" - /// - public string uid - { - get - { - return this.UniqueID.Replace("$", "_").Replace("-", "_"); - } - } - /// - /// Valore validazione codici ORDINE come STARTING (es: OPR,KIT) - /// - public string codOrdPre - { - get - { - return memLayer.ML.StringSessionObj(string.Format("codOrdPre_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("codOrdPre_{0}", uid), value); - } - } - public string codArt - { - get - { - return memLayer.ML.StringSessionObj(string.Format("codArt_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("codArt_{0}", uid), value); - } - } - public string descArt - { - get - { - return memLayer.ML.StringSessionObj(string.Format("descArt_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("descArt_{0}", uid), value); - } - } - public string kitCode - { - get - { - return memLayer.ML.StringSessionObj(string.Format("kitCode_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("kitCode_{0}", uid), value); - } - } - public string codOrd - { - get - { - return memLayer.ML.StringSessionObj(string.Format("codOrd_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("codOrd_{0}", uid), value); - } - } - public int qta - { - get - { - return memLayer.ML.IntSessionObj(string.Format("qta_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("qta_{0}", uid), value); - } - } - public string idxMacc - { - get - { - return memLayer.ML.StringSessionObj(string.Format("idxMacc_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("idxMacc_{0}", uid), value); - } - } - public string nomeMacc - { - get - { - return memLayer.ML.StringSessionObj(string.Format("nomeMacc_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("nomeMacc_{0}", uid), value); - } - } - public string codGruppo - { - get - { - return memLayer.ML.StringSessionObj(string.Format("codGruppo_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("codGruppo_{0}", uid), value); - } - } - /// - /// Verifica se il cod ordine è OK: - /// coerenza tra ordine e iniziale ordine (OPR/KIT) - /// - public bool checkOrdOk - { - get - { - return codOrd.StartsWith(codOrdPre); - } - } - /// - /// titolo pagina - /// - public string titolo - { - get - { - return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", ""); - } - } - #endregion - #region area protected - - /// - /// dictionary comandi ammessi - /// - protected Dictionary _comandi = new Dictionary(); - /// - /// dictionary dei valori ammessi - /// - protected Dictionary _tabValori = new Dictionary(); - /// - /// oggetto comando locale alla classe - /// - protected SteamWare.inputComando comando - { - get - { - SteamWare.inputComando answ; - if (memLayer.ML.isInSessionObject("barcodeCmd")) + /// + /// Valore validazione codici ORDINE come STARTING (es: OPR,KIT) + /// + public string codOrdPre { - answ = (SteamWare.inputComando)memLayer.ML.objSessionObj("barcodeCmd"); - } - else - { - answ = new SteamWare.inputComando(); - } - return answ; - } - set - { - memLayer.ML.setSessionVal("barcodeCmd", value, false); - } - } - /// - /// oggetto comando locale alla classe - /// - public string rawInput - { - get - { - string answ; - if (memLayer.ML.isInSessionObject("barcodeRaw")) - { - answ = memLayer.ML.StringSessionObj("barcodeRaw"); - } - else - { - answ = ""; - } - return answ; - } - set - { - memLayer.ML.setSessionVal("barcodeRaw", value, false); - } - } - /// - /// al caricamento della pagina... - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - if (!Page.IsPostBack) - { - resetData(); - } - - DetectAgent(); - myInitialize(); - } - /// - /// inizializzazione specifica barcode - /// - private void myInitialize() - { - if (!Page.IsPostBack) - { - lblInput.Text = traduci("PregoInserireBarcode"); - comando = new SteamWare.inputComando(); - } - } - - public string BCodeVal - { - get - { - return txtInput.Text.Trim().ToUpper(); - } - set - { - txtInput.Text = value; - } - } - - /// - /// barcode completato con invio... - /// - /// - /// - protected void txtInput_TextChanged(object sender, EventArgs e) - { - processInput(); - } - - public void processInput() - { - comando.isValid = false; - bool gotIt = false; - gotIt = checkComandi(); - if (!gotIt) - { - gotIt = checkMacc(); - } - if (!gotIt) - { - gotIt = checkIntServ(); - } - // ora check globale... - checkParam(); - // verifico se c'è stato input evento - if (comando.isValid) - { - if (comando.currCmdIn != "" || comando.descrComando != "") - { - txtInput2show = comando.descrComando; - } - else - { - txtInput2show = "---"; - } - if (comando.valore != "") - { - txtVal2show = comando.valoreTrad; - } - else - { - txtVal2show = "---"; - } - if (eh_comandoRegistrato != null) - { - eh_comandoRegistrato(this, new EventArgs()); - } - } - else - { - lblInput.Text = traduci("ComandoSconosciuto"); - lblValore.Text = BCodeVal; - comando = new SteamWare.inputComando(); - rawInput = BCodeVal; - if (eh_dataRead != null) - { - eh_dataRead(this, new EventArgs()); - } - } - BCodeVal = ""; - } - - private bool checkComandi() - { - bool answ = false; - // controllo eventuali comandi CUSTOM - if (BCodeVal == regExp_KO) - { - comando.isValid = true; - answ = true; - resetData(); - } - else if (BCodeVal == regExp_KitStart) - { - comando.isValid = true; - answ = true; - resetData(); - } - else if (BCodeVal == regExp_KitSave) - { - comando.isValid = true; - answ = true; - resetData(); - } - else if (BCodeVal == regExp_OK) - { - // comando valido SE ho ordine coerente... - if (checkOrdOk) - { - comando.isValid = true; - // recupero il codGruppo da macchina... (primo) - if (codGruppo == "") - { - var tabAG = DataLayerObj.taAG.getFaseByIdxMacc(idxMacc); - if (tabAG.Rows.Count > 0) + get { - codGruppo = tabAG[0].CodGruppo; + return memLayer.ML.StringSessionObj(string.Format("codOrdPre_{0}", uid)); } - } - // controllo se ho tutti i dati necessari... - if (codOrd != "" && codArt != "" && codGruppo != "" && idxMacc != "" && qta > 0) - { - // recupero TC promessa da ultimo per articolo/macchina - decimal TCiclo = 0; - int pzPallet = 1; - DS_ProdTempi.ODLDataTable tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, idxMacc); - // se non lo trovo prendo da SOLO ARTICOLO - if (tabODL.Rows.Count == 0) + set { - tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, ""); + memLayer.ML.setSessionVal(string.Format("codOrdPre_{0}", uid), value); } - // recupero TCiclo - if (tabODL.Rows.Count > 0) + } + public string codArt + { + get { - TCiclo = tabODL[0].TCAssegnato; - pzPallet = tabODL[0].PzPallet; + return memLayer.ML.StringSessionObj(string.Format("codArt_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("codArt_{0}", uid), value); + } + } + public string descArt + { + get + { + return memLayer.ML.StringSessionObj(string.Format("descArt_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("descArt_{0}", uid), value); + } + } + public string kitCode + { + get + { + return memLayer.ML.StringSessionObj(string.Format("kitCode_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("kitCode_{0}", uid), value); + } + } + public string codOrd + { + get + { + return memLayer.ML.StringSessionObj(string.Format("codOrd_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("codOrd_{0}", uid), value); + } + } + public int qta + { + get + { + return memLayer.ML.IntSessionObj(string.Format("qta_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("qta_{0}", uid), value); + } + } + public string idxMacc + { + get + { + return memLayer.ML.StringSessionObj(string.Format("idxMacc_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("idxMacc_{0}", uid), value); + } + } + public string nomeMacc + { + get + { + return memLayer.ML.StringSessionObj(string.Format("nomeMacc_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("nomeMacc_{0}", uid), value); + } + } + public string codGruppo + { + get + { + return memLayer.ML.StringSessionObj(string.Format("codGruppo_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("codGruppo_{0}", uid), value); + } + } + /// + /// Verifica se il cod ordine è OK: + /// coerenza tra ordine e iniziale ordine (OPR/KIT) + /// + public bool checkOrdOk + { + get + { + return codOrd.StartsWith(codOrdPre); + } + } + + #endregion + + #region area protected + + /// + /// dictionary comandi ammessi + /// + protected Dictionary _comandi = new Dictionary(); + /// + /// dictionary dei valori ammessi + /// + protected Dictionary _tabValori = new Dictionary(); + /// + /// oggetto comando locale alla classe + /// + protected inputComando comando + { + get + { + inputComando answ; + if (memLayer.ML.isInSessionObject("barcodeCmd")) + { + answ = (inputComando)memLayer.ML.objSessionObj("barcodeCmd"); + } + else + { + answ = new inputComando(); + } + return answ; + } + set + { + memLayer.ML.setSessionVal("barcodeCmd", value, false); + } + } + /// + /// oggetto comando locale alla classe + /// + public string rawInput + { + get + { + string answ; + if (memLayer.ML.isInSessionObject("barcodeRaw")) + { + answ = memLayer.ML.StringSessionObj("barcodeRaw"); + } + else + { + answ = ""; + } + return answ; + } + set + { + memLayer.ML.setSessionVal("barcodeRaw", value, false); + } + } + /// + /// al caricamento della pagina... + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + resetData(); + } + + DetectAgent(); + myInitialize(); + } + /// + /// inizializzazione specifica barcode + /// + private void myInitialize() + { + if (!Page.IsPostBack) + { + lblInput.Text = traduci("PregoInserireBarcode"); + comando = new inputComando(); + } + } + + public string BCodeVal + { + get + { + return txtInput.Text.Trim().ToUpper(); + } + set + { + txtInput.Text = value; + } + } + + /// + /// barcode completato con invio... + /// + /// + /// + protected void txtInput_TextChanged(object sender, EventArgs e) + { + processInput(); + } + + public void processInput() + { + comando.isValid = false; + bool gotIt = false; + gotIt = checkComandi(); + if (!gotIt) + { + gotIt = checkMacc(); + } + if (!gotIt) + { + gotIt = checkIntServ(); + } + // ora check globale... + checkParam(); + // verifico se c'è stato input evento + if (comando.isValid) + { + if (comando.currCmdIn != "" || comando.descrComando != "") + { + txtInput2show = comando.descrComando; + } + else + { + txtInput2show = "---"; + } + if (comando.valore != "") + { + txtVal2show = comando.valoreTrad; + } + else + { + txtVal2show = "---"; + } + if (eh_comandoRegistrato != null) + { + eh_comandoRegistrato(this, new EventArgs()); + } } - // se non lo trovo è valore default da config DB (oppure 59...) else { - TCiclo = memLayer.ML.CRI("TCicloStd"); + lblInput.Text = traduci("ComandoSconosciuto"); + lblValore.Text = BCodeVal; + comando = new inputComando(); + rawInput = BCodeVal; + if (eh_dataRead != null) + { + eh_dataRead(this, new EventArgs()); + } } - if (TCiclo == 0) + BCodeVal = ""; + } + + private bool checkComandi() + { + bool answ = false; + // controllo eventuali comandi CUSTOM + if (BCodeVal == regExp_KO) { - TCiclo = 59; + comando.isValid = true; + answ = true; + resetData(); } - // creo nuova PROMESSA ODL... - DataLayerObj.taPODL.insertQuery(codOrd, codOrd, true, codArt, codGruppo, idxMacc, qta, TCiclo, DateTime.Now, 1, pzPallet, descArt); - } - } - // resetto ricaricando - Response.Redirect(titolo); - } - return answ; - } - - private void resetData() - { - // resetto - idxMacc = ""; - nomeMacc = ""; - codArt = ""; - descArt = ""; - codGruppo = ""; - codOrd = ""; - qta = 0; - } - - private bool checkMacc() - { - bool answ = false; - // verifico se il barcode è di una macchina... - var risultato = DataLayerObj.taMacchine.GetByIdx(BCodeVal); - if (risultato.Rows.Count > 0) - { - idxMacc = BCodeVal; - comando.valore = BCodeVal; - comando.isValid = true; - answ = true; - // recupero altri dati - var rRes = risultato[0]; - nomeMacc = rRes.Descrizione; - // imposto il gruppo cercandolo... - var gruppi = DataLayerObj.taAG.getByIdxMacc(BCodeVal); - if (gruppi.Rows.Count > 0) - { - // salvo primo... - codGruppo = gruppi[0].CodGruppo; - } - } - return answ; - } - - /// - /// verifica parametri in sessione x i valori eventualmente da mettere al comando... - /// - private void checkParam() - { - // ho macchina ed articolo? - bool hasAllData = (idxMacc != "" && codArt != ""); - string valOut = ""; - if (codArt != "") - { - valOut += string.Format("{0}
Art: {1} | qta: {2:N0} | kit: {3}
{4}", codOrd, codArt, qta, kitCode, descArt); - } - if (idxMacc != "") - { - valOut += string.Format("
{0} | {1}", idxMacc, nomeMacc); - } - // imposto... - comando.valoreTrad = valOut; - // controllo se ho tutto... - comando.descrComando = ""; - if (idxMacc == "") - { - comando.descrComando += " - Manca Impianto - "; - } - if (codArt == "" || codOrd == "") - { - comando.descrComando += " - Manca Ordine Produzione - "; - } - if (!checkOrdOk) - { - comando.descrComando += " - Tipo Ordine errato - "; - } - if (hasAllData && checkOrdOk) - { - comando.descrComando = "Confermare caricamento"; - } - } - - private bool checkIntServ() - { - bool answ = false; - // IN PRIMIS se c'è in config preprocesso BCode x Find-Replace - string BCodeFilt = BCodeVal; - if (regExp_Find != "") - { - // splitto i vettori - var vettFind = regExp_Find.Split('|'); - var vettRepl = regExp_Replace.Split('|'); - // se ho tanti find quanti replace procedo... - if (vettFind.Length == vettRepl.Length) - { - for (int i = 0; i < vettFind.Length; i++) - { - BCodeFilt = BCodeFilt.Replace(vettFind[i], vettRepl[i]); - } - } - else - { - logger.lg.scriviLog(string.Format("Attenzione: problema in decodifica barcode find/replace, i parametri non corrispondono una volta esplosi i vettori:{0}find: {1}{0}replace: {2}", Environment.NewLine, regExp_Find, regExp_Replace)); - } - } - // cerco esplicitamente sul DB IntegrationServices... - var risultato = DataLayerObj.taIS_TrDati.getOrdini(BCodeFilt); - if (risultato.Rows.Count > 0) - { - var rRes = risultato[0]; - // verifico da config COME decodificare IS... - string BCodeIS_DType = memLayer.ML.cdv("BCodeIS_DType"); - // verifico corrispondano i formati... - if (rRes.DataType == BCodeIS_DType) - { - // cerco i dati e decodifico... togliendo eventuale VETTORE "[..]" - var jsonData = risultato[0].ValueOUT.Replace("[", "").Replace("]", ""); - try - { - if (BCodeIS_DType == "Colcom_Order") + else if (BCodeVal == regExp_KitStart) { - // a seconda del tipo decodifico... - ISTD_OrderColcom currVal = JsonConvert.DeserializeObject(jsonData); - comando.isValid = true; - answ = true; - // salvo ordine / articolo / qta - codOrd = currVal.CodOrdine; - codArt = currVal.CodArticolo; - descArt = currVal.DescrArticolo; - kitCode = currVal.KitCode; - qta = (int)currVal.Qta; - comando.valore = jsonData;// string.Format("{0}#{1}#{2:N0}", codOrd, codArt, qta); - comando.currCmdIn = "OrdArtQta"; + comando.isValid = true; + answ = true; + resetData(); } - } - catch (Exception exc) - { - logger.lg.scriviLog(string.Format("Errore in decodifica obj JSON:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION); - } + else if (BCodeVal == regExp_KitSave) + { + comando.isValid = true; + answ = true; + resetData(); + } + else if (BCodeVal == regExp_OK) + { + // comando valido SE ho ordine coerente... + if (checkOrdOk) + { + comando.isValid = true; + // recupero il codGruppo da macchina... (primo) + if (codGruppo == "") + { + var tabAG = DataLayerObj.taAG.getFaseByIdxMacc(idxMacc); + if (tabAG.Rows.Count > 0) + { + codGruppo = tabAG[0].CodGruppo; + } + } + // controllo se ho tutti i dati necessari... + if (codOrd != "" && codArt != "" && codGruppo != "" && idxMacc != "" && qta > 0) + { + // recupero TC promessa da ultimo per articolo/macchina + decimal TCiclo = 0; + int pzPallet = 1; + DS_ProdTempi.ODLDataTable tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, idxMacc); + // se non lo trovo prendo da SOLO ARTICOLO + if (tabODL.Rows.Count == 0) + { + tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, ""); + } + // recupero TCiclo + if (tabODL.Rows.Count > 0) + { + TCiclo = tabODL[0].TCAssegnato; + pzPallet = tabODL[0].PzPallet; + } + // se non lo trovo è valore default da config DB (oppure 59...) + else + { + TCiclo = memLayer.ML.CRI("TCicloStd"); + } + if (TCiclo == 0) + { + TCiclo = 59; + } + // creo nuova PROMESSA ODL... + DataLayerObj.taPODL.insertQuery(codOrd, codOrd, true, codArt, codGruppo, idxMacc, qta, TCiclo, DateTime.Now, 1, pzPallet, descArt); + } + } + // resetto ricaricando + Response.Redirect(titolo); + } + return answ; } - } - return answ; - } - /// - /// verifico se sia un valore compreso nell'elenco fornito - /// - private void isValore() - { - if (_tabValori.ContainsKey(BCodeVal)) // verifico se il comando digitato esista... - { - comando.isValid = true; - comando.valore = BCodeVal; - _tabValori.TryGetValue(BCodeVal, out comando.valoreTrad); - } - } - /// - /// verifica se il comando inserito sia valido - /// - private void isInputEvent() - { - if (_comandi.ContainsKey(BCodeVal)) // verifico se il comando digitato esista... - { - comando.isValid = true; - // salvo comando precedente (se c'è...) - comando.prevCmdIn = comando.currCmdIn; - comando.descrComandoPrev = comando.descrComando; - comando.currCmdIn = BCodeVal; - _comandi.TryGetValue(BCodeVal, out comando.descrComando); - } - } - /// - /// verifica quale browser usato e applica css corretto al div attorno al box - /// - private void DetectAgent() - { - System.Web.HttpBrowserCapabilities browser = Request.Browser; - if (browser.Browser == "IE") - { - pnlBarcodeBox.CssClass = "barcodeBoxIE"; - } - else - { - pnlBarcodeBox.CssClass = "barcodeBoxOther"; - } - } + private void resetData() + { + // resetto + idxMacc = ""; + nomeMacc = ""; + codArt = ""; + descArt = ""; + codGruppo = ""; + codOrd = ""; + qta = 0; + } + + private bool checkMacc() + { + bool answ = false; + // verifico se il barcode è di una macchina... + var risultato = DataLayerObj.taMacchine.GetByIdx(BCodeVal); + if (risultato.Rows.Count > 0) + { + idxMacc = BCodeVal; + comando.valore = BCodeVal; + comando.isValid = true; + answ = true; + // recupero altri dati + var rRes = risultato[0]; + nomeMacc = rRes.Descrizione; + // imposto il gruppo cercandolo... + var gruppi = DataLayerObj.taAG.getByIdxMacc(BCodeVal); + if (gruppi.Rows.Count > 0) + { + // salvo primo... + codGruppo = gruppi[0].CodGruppo; + } + } + return answ; + } + + /// + /// verifica parametri in sessione x i valori eventualmente da mettere al comando... + /// + private void checkParam() + { + // ho macchina ed articolo? + bool hasAllData = (idxMacc != "" && codArt != ""); + string valOut = ""; + if (codArt != "") + { + valOut += string.Format("{0}
Art: {1} | qta: {2:N0} | kit: {3}
{4}", codOrd, codArt, qta, kitCode, descArt); + } + if (idxMacc != "") + { + valOut += string.Format("
{0} | {1}", idxMacc, nomeMacc); + } + // imposto... + comando.valoreTrad = valOut; + // controllo se ho tutto... + comando.descrComando = ""; + if (idxMacc == "") + { + comando.descrComando += " - Manca Impianto - "; + } + if (codArt == "" || codOrd == "") + { + comando.descrComando += " - Manca Ordine Produzione - "; + } + if (!checkOrdOk) + { + comando.descrComando += " - Tipo Ordine errato - "; + } + if (hasAllData && checkOrdOk) + { + comando.descrComando = "Confermare caricamento"; + } + } + + private bool checkIntServ() + { + bool answ = false; + // IN PRIMIS se c'è in config preprocesso BCode x Find-Replace + string BCodeFilt = BCodeVal; + if (regExp_Find != "") + { + // splitto i vettori + var vettFind = regExp_Find.Split('|'); + var vettRepl = regExp_Replace.Split('|'); + // se ho tanti find quanti replace procedo... + if (vettFind.Length == vettRepl.Length) + { + for (int i = 0; i < vettFind.Length; i++) + { + BCodeFilt = BCodeFilt.Replace(vettFind[i], vettRepl[i]); + } + } + else + { + logger.lg.scriviLog(string.Format("Attenzione: problema in decodifica barcode find/replace, i parametri non corrispondono una volta esplosi i vettori:{0}find: {1}{0}replace: {2}", Environment.NewLine, regExp_Find, regExp_Replace)); + } + } + // cerco esplicitamente sul DB IntegrationServices... + var risultato = DataLayerObj.taIS_TrDati.getOrdini(BCodeFilt); + if (risultato.Rows.Count > 0) + { + var rRes = risultato[0]; + // verifico da config COME decodificare IS... + string BCodeIS_DType = memLayer.ML.cdv("BCodeIS_DType"); + // verifico corrispondano i formati... + if (rRes.DataType == BCodeIS_DType) + { + // cerco i dati e decodifico... togliendo eventuale VETTORE "[..]" + var jsonData = risultato[0].ValueOUT.Replace("[", "").Replace("]", ""); + try + { + if (BCodeIS_DType == "Colcom_Order") + { + // a seconda del tipo decodifico... + ISTD_OrderColcom currVal = JsonConvert.DeserializeObject(jsonData); + comando.isValid = true; + answ = true; + // salvo ordine / articolo / qta + codOrd = currVal.CodOrdine; + codArt = currVal.CodArticolo; + descArt = currVal.DescrArticolo; + kitCode = currVal.KitCode; + qta = (int)currVal.Qta; + comando.valore = jsonData;// string.Format("{0}#{1}#{2:N0}", codOrd, codArt, qta); + comando.currCmdIn = "OrdArtQta"; + } + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in decodifica obj JSON:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION); + } + } + } + return answ; + } + + /// + /// verifico se sia un valore compreso nell'elenco fornito + /// + private void isValore() + { + if (_tabValori.ContainsKey(BCodeVal)) // verifico se il comando digitato esista... + { + comando.isValid = true; + comando.valore = BCodeVal; + _tabValori.TryGetValue(BCodeVal, out comando.valoreTrad); + } + } + /// + /// verifica se il comando inserito sia valido + /// + private void isInputEvent() + { + if (_comandi.ContainsKey(BCodeVal)) // verifico se il comando digitato esista... + { + comando.isValid = true; + // salvo comando precedente (se c'è...) + comando.prevCmdIn = comando.currCmdIn; + comando.descrComandoPrev = comando.descrComando; + comando.currCmdIn = BCodeVal; + _comandi.TryGetValue(BCodeVal, out comando.descrComando); + } + } + /// + /// verifica quale browser usato e applica css corretto al div attorno al box + /// + private void DetectAgent() + { + System.Web.HttpBrowserCapabilities browser = Request.Browser; + if (browser.Browser == "IE") + { + pnlBarcodeBox.CssClass = "barcodeBoxIE"; + } + else + { + pnlBarcodeBox.CssClass = "barcodeBoxOther"; + } + } - #endregion + #endregion - #region area public + #region area public - /// - /// effettua al ettura da sessione del comando cliccato e lo inserisce come fosse barcode - /// - public void loadBtnClickComando() - { - BCodeVal = memLayer.ML.StringSessionObj("btnCmdPress"); - memLayer.ML.emptySessionVal("btnCmdPress"); - processInput(); - } + /// + /// effettua al ettura da sessione del comando cliccato e lo inserisce come fosse barcode + /// + public void loadBtnClickComando() + { + BCodeVal = memLayer.ML.StringSessionObj("btnCmdPress"); + memLayer.ML.emptySessionVal("btnCmdPress"); + processInput(); + } - /// - /// elenco dei comandi riconosciuti - /// - public Dictionary comandiAmmessi - { - get - { - return _comandi; - } - set - { - _comandi = value; - } - } - /// - /// tabella di valori ammissibili - /// - public Dictionary tabValori - { - get - { - return _tabValori; - } - set - { - _tabValori = value; - } - } - /// - /// evento comando registrato - /// - public event EventHandler eh_comandoRegistrato; - /// - /// evento lettura dati (grezza) effettuata - /// - public event EventHandler eh_dataRead; - /// - /// comando registrato dal barcode - /// - public SteamWare.inputComando comandoRegistrato - { - get - { - return comando; - } - } - /// - /// scrive nella label input - /// - public string txtInput2show - { - set - { - lblInput.Text = value; - } - } - /// - /// scrive nella label valore - /// - public string txtVal2show - { - set - { - lblValore.Text = value; - } - } - /// - /// scrive nella label richiesta - /// - public string txtRich2show - { - set - { - lblRichiesta.Text = value; - } - } - /// - /// reset del controllo - /// - public void resetMe() - { - comando = new SteamWare.inputComando(); - txtInput2show = "Prego inserire barcode"; - txtVal2show = ""; - txtRich2show = ""; - } - /// - /// wrapper traduzione termini - /// - /// - /// - public string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } + /// + /// elenco dei comandi riconosciuti + /// + public Dictionary comandiAmmessi + { + get + { + return _comandi; + } + set + { + _comandi = value; + } + } + /// + /// tabella di valori ammissibili + /// + public Dictionary tabValori + { + get + { + return _tabValori; + } + set + { + _tabValori = value; + } + } + /// + /// evento comando registrato + /// + public event EventHandler eh_comandoRegistrato; + /// + /// evento lettura dati (grezza) effettuata + /// + public event EventHandler eh_dataRead; + /// + /// comando registrato dal barcode + /// + public inputComando comandoRegistrato + { + get + { + return comando; + } + } + /// + /// scrive nella label input + /// + public string txtInput2show + { + set + { + lblInput.Text = value; + } + } + /// + /// scrive nella label valore + /// + public string txtVal2show + { + set + { + lblValore.Text = value; + } + } + /// + /// scrive nella label richiesta + /// + public string txtRich2show + { + set + { + lblRichiesta.Text = value; + } + } + /// + /// reset del controllo + /// + public void resetMe() + { + comando = new inputComando(); + txtInput2show = "Prego inserire barcode"; + txtVal2show = ""; + txtRich2show = ""; + } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_fixCal.ascx.cs b/MP-ADM/WebUserControls/mod_fixCal.ascx.cs index d50ca791..57fa0692 100644 --- a/MP-ADM/WebUserControls/mod_fixCal.ascx.cs +++ b/MP-ADM/WebUserControls/mod_fixCal.ascx.cs @@ -1,9 +1,13 @@ using System; -public partial class mod_fixCal : System.Web.UI.UserControl -{ - protected void Page_Load(object sender, EventArgs e) - { +namespace MP_ADM.WebUserControls +{ + public partial class mod_fixCal : BaseUserControl + { + protected void Page_Load(object sender, EventArgs e) + { + + } } } diff --git a/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs b/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs index cecce86d..2f963c8c 100644 --- a/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs @@ -10,23 +10,27 @@ -public partial class mod_fixCal { - - /// - /// TextBox1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox TextBox1; - - /// - /// CalendarExtender1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1; -} +namespace MP_ADM.WebUserControls +{ + public partial class mod_fixCal + { + + /// + /// TextBox1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox TextBox1; + + /// + /// CalendarExtender1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1; + } +} \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_footer.ascx.cs b/MP-ADM/WebUserControls/mod_footer.ascx.cs index 3ec6be7f..4437812e 100644 --- a/MP-ADM/WebUserControls/mod_footer.ascx.cs +++ b/MP-ADM/WebUserControls/mod_footer.ascx.cs @@ -2,12 +2,12 @@ namespace MP_ADM.WebUserControls { - public partial class mod_footer : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) + public partial class mod_footer : BaseUserControl { - lblLastUpdt.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss"); - lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); + protected void Page_Load(object sender, EventArgs e) + { + lblLastUpdt.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss"); + lblVers.Text = string.Format("v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestKIT.ascx.cs b/MP-ADM/WebUserControls/mod_gestKIT.ascx.cs index 6dfd25a1..b5bd5759 100644 --- a/MP-ADM/WebUserControls/mod_gestKIT.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestKIT.ascx.cs @@ -4,266 +4,243 @@ using System; namespace MP_ADM.WebUserControls { - public partial class mod_gestKIT : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - - public event EventHandler eh_selKit; - - #region setup VARS - - /// - /// RegExp x RESET / CANCEL - /// - protected string regExp_KO = memLayer.ML.cdv("regExp_KO"); - /// - /// RegExp x CONFERMA - /// - protected string regExp_OK = memLayer.ML.cdv("regExp_OK"); - /// - /// RegExp x START KIT - /// - protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart"); - /// - /// RegExp x SAVE KIT - /// - protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave"); - - #endregion - - #region variabili in sessione - - /// - /// UID formattato con "_" - /// - public string uid + public partial class mod_gestKIT : BaseUserControl { - get - { - return this.UniqueID.Replace("$", "_").Replace("-", "_"); - } - } - /// - /// titolo pagina - /// - public string titolo - { - get - { - return devicesAuthProxy.getPage(Request.Url).Replace(".aspx", ""); - } - } - public string codKitTemp - { - get - { - return memLayer.ML.StringSessionObj(string.Format("codKitTemp_{0}", uid)); - } - set - { - memLayer.ML.setSessionVal(string.Format("codKitTemp_{0}", uid), value); - hlCodKitTemp.Value = value; - grViewWSK.DataBind(); - } - } - /// - /// Ultimo Codice KIT creato - /// - public string lastKitMade - { - get - { - return memLayer.ML.StringSessionObj("lastKitMade"); - } - set - { - memLayer.ML.setSessionVal("lastKitMade", value); - } - } - /// - /// Aggiunge (in obj OrdineKit) l'ordine coi parametri indicati - /// - /// - /// - /// - /// - /// - public bool addOrdArt(string codOrd, string codArt, string descArt, int qta) - { - bool answ = false; - // verifico di avere un codiceKIT - checkCodKit(); - // salvo info x il cod temporaneo... - DataLayerObj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta); - // verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido... - string currCodArtKit = "###"; - var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1); - bool showPODL = false; - if (TksTab.Rows.Count > 0) - { - // verifico se ho aderenza 100%... - if (TksTab[0].TotalScore == 1) + public event EventHandler eh_selKit; + + #region setup VARS + + /// + /// RegExp x RESET / CANCEL + /// + protected string regExp_KO = memLayer.ML.cdv("regExp_KO"); + /// + /// RegExp x CONFERMA + /// + protected string regExp_OK = memLayer.ML.cdv("regExp_OK"); + /// + /// RegExp x START KIT + /// + protected string regExp_KitStart = memLayer.ML.cdv("regExp_KitStart"); + /// + /// RegExp x SAVE KIT + /// + protected string regExp_KitSave = memLayer.ML.cdv("regExp_KitSave"); + + #endregion + + #region variabili in sessione + + + + public string codKitTemp { - currCodArtKit = TksTab[0].CodArtParent; - showPODL = true; + get + { + return memLayer.ML.StringSessionObj(string.Format("codKitTemp_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("codKitTemp_{0}", uid), value); + hlCodKitTemp.Value = value; + grViewWSK.DataBind(); + } } - } - hfCodArtKit.Value = currCodArtKit; - divPODL.Visible = showPODL; - answ = true; - grViewWSK.DataBind(); - grViewKitSel.DataBind(); - grViewPODL.DataBind(); - grViewIstanzeKIT.DataBind(); - return answ; - } - - #endregion - - /// - /// Caricamento pagina - /// - /// - /// - protected void Page_Load(object sender, EventArgs e) - { - bool OptAdmKitEnabled = memLayer.ML.CRB("OptAdmKitEnabled"); - if (!Page.IsPostBack && OptAdmKitEnabled) - { - doReset(); - } - } - /// - /// Ultimo input registrato - /// - public string lastInput - { - get - { - return hlLastInput.Value; - } - set - { - hlLastInput.Value = value; - } - } - /// - /// Aggiorno controllo secondo ULTIMO input - /// - public void doUpdate() - { - // aggiorno label... - messOut = ""; - // controllo input (reset/inizio o salva...) - if (lastInput == regExp_KO) - { - // resetto dati - doReset(); - messOut = "Effettuato reset!"; - } - else if (lastInput == regExp_KitStart) - { - // resetto dati - doReset(); - messOut = "Inizio configurazione KIT"; - } - else if (lastInput == regExp_KitSave) - { - // controllo SE HO un kit selezionato... - string currCodArtKit = "###"; - var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1); - bool showPODL = false; - if (TksTab.Rows.Count > 0) + /// + /// Ultimo Codice KIT creato + /// + public string lastKitMade { - // verifico se ho aderenza 100%... - if (TksTab[0].TotalScore == 1) - { - currCodArtKit = TksTab[0].CodArtParent; - showPODL = true; - } + get + { + return memLayer.ML.StringSessionObj("lastKitMade"); + } + set + { + memLayer.ML.setSessionVal("lastKitMade", value); + } } - if (showPODL) + /// + /// Aggiunge (in obj OrdineKit) l'ordine coi parametri indicati + /// + /// + /// + /// + /// + /// + public bool addOrdArt(string codOrd, string codArt, string descArt, int qta) { - // in questo caso creo istanza! - creazioneIstanzaKit(currCodArtKit); + bool answ = false; + // verifico di avere un codiceKIT + checkCodKit(); + // salvo info x il cod temporaneo... + DataLayerObj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta); + // verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido... + string currCodArtKit = "###"; + var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1); + bool showPODL = false; + if (TksTab.Rows.Count > 0) + { + // verifico se ho aderenza 100%... + if (TksTab[0].TotalScore == 1) + { + currCodArtKit = TksTab[0].CodArtParent; + showPODL = true; + } + } + hfCodArtKit.Value = currCodArtKit; + divPODL.Visible = showPODL; + answ = true; + grViewWSK.DataBind(); + grViewKitSel.DataBind(); + grViewPODL.DataBind(); + grViewIstanzeKIT.DataBind(); + return answ; } - } - else if (lastInput == regExp_OK) - { - } - // ennesimo check cod TEMP - checkCodKit(); - } + #endregion - private void doReset() - { - // elimino eventuali record ODL - DataLayerObj.taWKS.deleteQuery(codKitTemp); - codKitTemp = ""; - divPODL.Visible = false; - checkCodKit(); - } - /// - /// Verifico SE HO un codKit Temporaneo sennò lo creo... - /// - private void checkCodKit() - { - if (codKitTemp == "") - { - // genero un NUOVO cod temp kit... - codKitTemp = string.Format("KIT_{0:yyMMdd_HHmmss}", DateTime.Now); - } - } - - public string messOut - { - set - { - lblOut.Text = value; - } - get - { - return lblOut.Text; - } - } - - protected void grViewKitSel_SelectedIndexChanged(object sender, EventArgs e) - { - // se ho selezionato recupero CHIAVE = CodArticolo del KIT - string CodArtParent = grViewKitSel.SelectedValue.ToString(); - // crea KIT x quel CodArtParent... - creazioneIstanzaKit(CodArtParent); - } - /// - /// Crea una NUOVA istanza KIT - /// - /// CodArt dell'Assieme/KIT - private void creazioneIstanzaKit(string CodArtParent) - { - // calcolo NUOVO codice kit... - var tabKey = DataLayerObj.taIstK.getNewKey(); - if (tabKey.Rows.Count == 1) - { - // stacco un NUOVO codice KIT - lastKitMade = tabKey[0].KeyKit; - // inserisco ISTANZA KIT! - DataLayerObj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp); - // faccio reset valori WKS... - doReset(); - // ora resetto ordine caricato... - messOut = string.Format("Creato NUOVA P.ODL cod {0} per il KIT {1}", lastKitMade, CodArtParent); - // sollevo evento x impostare lettura KIT a BARCODE (x conferma successiva...) - // sollevo evento nuovo valore... - if (eh_selKit != null) + /// + /// Caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) { - eh_selKit(this, new EventArgs()); + bool OptAdmKitEnabled = memLayer.ML.CRB("OptAdmKitEnabled"); + if (!Page.IsPostBack && OptAdmKitEnabled) + { + doReset(); + } + } + /// + /// Ultimo input registrato + /// + public string lastInput + { + get + { + return hlLastInput.Value; + } + set + { + hlLastInput.Value = value; + } + } + /// + /// Aggiorno controllo secondo ULTIMO input + /// + public void doUpdate() + { + // aggiorno label... + messOut = ""; + // controllo input (reset/inizio o salva...) + if (lastInput == regExp_KO) + { + // resetto dati + doReset(); + messOut = "Effettuato reset!"; + } + else if (lastInput == regExp_KitStart) + { + // resetto dati + doReset(); + messOut = "Inizio configurazione KIT"; + } + else if (lastInput == regExp_KitSave) + { + // controllo SE HO un kit selezionato... + string currCodArtKit = "###"; + var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1); + bool showPODL = false; + if (TksTab.Rows.Count > 0) + { + // verifico se ho aderenza 100%... + if (TksTab[0].TotalScore == 1) + { + currCodArtKit = TksTab[0].CodArtParent; + showPODL = true; + } + } + if (showPODL) + { + // in questo caso creo istanza! + creazioneIstanzaKit(currCodArtKit); + } + } + else if (lastInput == regExp_OK) + { + + } + // ennesimo check cod TEMP + checkCodKit(); + } + + private void doReset() + { + // elimino eventuali record ODL + DataLayerObj.taWKS.deleteQuery(codKitTemp); + codKitTemp = ""; + divPODL.Visible = false; + checkCodKit(); + } + /// + /// Verifico SE HO un codKit Temporaneo sennò lo creo... + /// + private void checkCodKit() + { + if (codKitTemp == "") + { + // genero un NUOVO cod temp kit... + codKitTemp = string.Format("KIT_{0:yyMMdd_HHmmss}", DateTime.Now); + } + } + + public string messOut + { + set + { + lblOut.Text = value; + } + get + { + return lblOut.Text; + } + } + + protected void grViewKitSel_SelectedIndexChanged(object sender, EventArgs e) + { + // se ho selezionato recupero CHIAVE = CodArticolo del KIT + string CodArtParent = grViewKitSel.SelectedValue.ToString(); + // crea KIT x quel CodArtParent... + creazioneIstanzaKit(CodArtParent); + } + /// + /// Crea una NUOVA istanza KIT + /// + /// CodArt dell'Assieme/KIT + private void creazioneIstanzaKit(string CodArtParent) + { + // calcolo NUOVO codice kit... + var tabKey = DataLayerObj.taIstK.getNewKey(); + if (tabKey.Rows.Count == 1) + { + // stacco un NUOVO codice KIT + lastKitMade = tabKey[0].KeyKit; + // inserisco ISTANZA KIT! + DataLayerObj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp); + // faccio reset valori WKS... + doReset(); + // ora resetto ordine caricato... + messOut = string.Format("Creato NUOVA P.ODL cod {0} per il KIT {1}", lastKitMade, CodArtParent); + // sollevo evento x impostare lettura KIT a BARCODE (x conferma successiva...) + // sollevo evento nuovo valore... + if (eh_selKit != null) + { + eh_selKit(this, new EventArgs()); + } + } } - } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestPromODL.ascx.cs b/MP-ADM/WebUserControls/mod_gestPromODL.ascx.cs index cafad97d..ff3d2e0a 100644 --- a/MP-ADM/WebUserControls/mod_gestPromODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestPromODL.ascx.cs @@ -7,633 +7,597 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_gestPromODL : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - /// - /// Determina se sia solo readonly il controllo... - /// - public bool readOnly; - /// - /// Chiave PRE selezione tipo richiesta ordine - /// - public string codOrdPre + public partial class mod_gestPromODL : BaseUserControl { - get - { - return hfCodPre.Value.Trim(); - } - set - { - hfCodPre.Value = value; - } - } - /// - /// dimensione pagina - /// - public int pageSize - { - get - { - int answ = 10; - try + /// + /// Determina se sia solo readonly il controllo... + /// + public bool readOnly; + /// + /// Chiave PRE selezione tipo richiesta ordine + /// + public string codOrdPre { - answ = Convert.ToInt32(txtPageSize.Text); + get + { + return hfCodPre.Value.Trim(); + } + set + { + hfCodPre.Value = value; + } } - catch - { } - return answ; - } - set - { - txtPageSize.Text = value.ToString(); - } - } - - /// - /// Abilitazione modifica selettore fase - /// - public bool enableSelFase - { - get - { - return ddlCodGruppo.Enabled; - } - set - { - ddlCodGruppo.Enabled = value; - } - } - /// - /// Gruppo selezionato - /// - public string CodGruppo - { - get - { - return ddlCodGruppo.SelectedValue; - } - set - { - ddlCodGruppo.SelectedValue = value; - } - } - - #region area da NON modificare - - #region area protected - - protected string _idxGridView; - - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - - /// - /// salvo comando - /// - /// - /// - protected void lbt_Command(object sender, CommandEventArgs e) - { - SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); - } - /// - /// gestione cambio selezione valore - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in session il valore selezionato... - memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); - bool doClone = false; - bool doEdit = false; - // gestione buttons richieste - string _comando = ""; - if (memLayer.ML.isInSessionObject("nextObjCommand")) - { - _comando = memLayer.ML.StringSessionObj("nextObjCommand"); - memLayer.ML.emptySessionVal("nextObjCommand"); - } - switch (_comando) - { - case "Clona": - doClone = true; - break; - case "Edit": - doEdit = true; - break; - default: - break; - } - if (doClone) - { - memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false); - showAddNewPODL(); - mod_newPromessaODL.doSelPODL(); - } - else if (doEdit) - { - memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false); - showAddNewPODL(); - mod_newPromessaODL.doSelPODL(); - } - else - { - // mostro edit quantità... - divEditQta.Visible = true; - lbtNewPODL.Visible = true; - mod_newPromessaODL.Visible = false; - var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0]; - numPz = riga.NumPezzi; - pzPallet = riga.PzPallet; - } - } - /// - /// 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) + /// + /// dimensione pagina + /// + public int pageSize { - 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 = ""; - } - } - /// - /// recupera i dati di un nuovo record contenuti nel footer di un gridView; - /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...) - /// - /// - /// - protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) - { - //recupero la riga footer... - DataColumnCollection colonne = colonneObj(); - string nomeCol; - string tipoColonna = ""; - foreach (DataColumn colonna in colonne) - { - nomeCol = colonna.ColumnName; - // cerco un textbox o quello che sia... - if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null) - { - tipoColonna = "textBox"; - } - else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null) - { - tipoColonna = "dropDownList"; - } - else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null) - { - tipoColonna = "checkBox"; - } - else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null) - { - tipoColonna = "selAjax"; - } - // in base al tipo salvo negli inputparameters dell'ODS - switch (tipoColonna) - { - case "textBox": - e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text; - break; - case "dropDownList": - e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue; - break; - case "checkBox": - e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked; - break; - //case "selAjax": - // e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore; - // break; - default: - break; - } - tipoColonna = ""; - } - } - /// - /// svuoto da cache post update - /// - /// - /// - protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) - { - // evento come nuovo... - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - - #endregion - - #region are public - - /// - /// effettua traduzione del lemma - /// - /// - /// - public string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } - /// - /// effettua traduzione in inglese del lemma - /// - /// - /// - public string traduciEn(string lemma) - { - return user_std.UtSn.TraduciEn(lemma); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); - grView.SelectedIndex = -1; - grView.DataBind(); - divEditQta.Visible = false; - mod_newPromessaODL.Visible = false; - lbtNewPODL.Visible = true; - lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } - - } - #endregion - - #endregion - - #region gestione eventi - - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; - - #endregion - - #region area da modificare - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - if (!Page.IsPostBack) - { - mod_newPromessaODL.Visible = false; - grView.PageSize = pageSize; - // se ho in sessione selezione la recupero... - if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase) - { - ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode"); - } - } - mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore); - } - - /// inizializzazione valori di default - ///
- /// - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - _idxGridView = "IdxODL"; - } - /// - /// nuovo valore creato... - /// - /// - /// - void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e) - { - // nascondo controllo e mostro button - mod_newPromessaODL.Visible = false; - lbtNewPODL.Visible = true; - // aggiorno! - resetSelezione(); - } - - /// - /// elenco colonne del datagrid - /// - /// - protected DataColumnCollection colonneObj() - { - DS_ProdTempi.ODLDataTable tabella = new DS_ProdTempi.ODLDataTable(); - DataColumnCollection colonne = tabella.Columns; - return colonne; - } - public bool delEnabled(object _idxOdl) - { - bool answ = false; - int idxOdl = 0; - // controllo non sia già stata iniziata la produzione sennò non posso cancellare... - try - { - idxOdl = Convert.ToInt32(_idxOdl); - answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0); - } - catch - { } - return answ; - } - /// - /// mostra creazione nuovo ODL - /// - /// - /// - protected void lbtNewPODL_Click(object sender, EventArgs e) - { - showAddNewPODL(); - } - - private void showAddNewPODL() - { - // mostro controllo creazione ODL - mod_newPromessaODL.Visible = true; - divEditQta.Visible = false; - lbtNewPODL.Visible = false; - grView.SelectedIndex = -1; - grView.DataBind(); - } - - /// - /// formatot url x stampa ODL - /// - /// - /// - public string formattaUrlOdl(object idx) - { - string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx); - return answ; - } - - /// - /// cambio dim pagina - /// - /// - /// - protected void txtPageSize_TextChanged(object sender, EventArgs e) - { - grView.PageSize = pageSize; - } - - - /// - /// elimina commento - /// - /// - /// - protected void lbtDel_Click(object sender, EventArgs e) - { - LinkButton imgBtn = (LinkButton)sender; - int IdxProm = 0; - int.TryParse(imgBtn.CommandArgument, out IdxProm); - DataLayerObj.taPODL.deleteQuery(IdxProm); - doUpdate(); - } - - private void doUpdate() - { - grView.DataBind(); - } - - #endregion - - protected void btnOk_Click(object sender, EventArgs e) - { - if (idxPOdlSel > 0) - { - DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel); - } - updateCtrl(); - } - - private void updateCtrl() - { - divEditQta.Visible = false; - grView.SelectedIndex = -1; - grView.DataBind(); - } - /// - /// idxOdl selezionato - /// - protected int idxPOdlSel - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(grView.SelectedValue); - } - catch - { } - return answ; - } - } - /// - /// Nuovo num pz - /// - protected int numPz - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtNewQta.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtNewQta.Text = value.ToString(); - } - } - /// - /// Nuovo num pz per pallet - /// - protected int pzPallet - { - get - { - int answ = 1; - try - { - answ = Convert.ToInt32(txtNewPzPallet.Text.Trim()); - } - catch - { } - // controllo sia > 0... - if (answ < 1) - { - answ = 1; + get + { + int answ = 10; + try + { + answ = Convert.ToInt32(txtPageSize.Text); + } + catch + { } + return answ; + } + set + { + txtPageSize.Text = value.ToString(); + } } - return answ; - } - set - { - txtNewPzPallet.Text = value.ToString(); - } - } - protected void btnCancel_Click(object sender, EventArgs e) - { - updateCtrl(); - } + /// + /// Abilitazione modifica selettore fase + /// + public bool enableSelFase + { + get + { + return ddlCodGruppo.Enabled; + } + set + { + ddlCodGruppo.Enabled = value; + } + } + /// + /// Gruppo selezionato + /// + public string CodGruppo + { + get + { + return ddlCodGruppo.SelectedValue; + } + set + { + ddlCodGruppo.SelectedValue = value; + } + } - protected void chkUnassigned_CheckedChanged(object sender, EventArgs e) - { - updateGrView(); - } - /// - /// Aggiorno Gridview - /// - private void updateGrView() - { - grView.DataBind(); - } + #region area da NON modificare - /// - /// IdxMacchina filtrata - /// - protected string idxMacc - { - get - { - return lblIdxMacc.Text; - } - set - { - lblIdxMacc.Text = value; - } - } - /// - /// Nome filtrata - /// - protected string NomeMacc - { - get - { - return lblNomeMacc.Text; - } - set - { - lblNomeMacc.Text = value; - } - } - /// - /// CodArt filtrato - /// - protected string CodArt - { - get - { - return lblCodArt.Text; - } - set - { - lblCodArt.Text = value; - } - } - /// - /// CodArt filtrato - /// - protected string DescArt - { - get - { - return lblDescArt.Text; - } - set - { - lblDescArt.Text = value; - } - } + #region area protected - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelArt_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] artData = lb.CommandArgument.Split('|'); - CodArt = artData[0]; - DescArt = artData[1]; - updateGrView(); - } - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelMacc_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] maccData = lb.CommandArgument.Split('|'); - idxMacc = maccData[0]; - NomeMacc = maccData[1]; - updateGrView(); - } + protected string _idxGridView; - protected void lbtResArt_Click(object sender, EventArgs e) - { - CodArt = ""; - DescArt = ""; - updateGrView(); - } + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } - protected void lbtResMacc_Click(object sender, EventArgs e) - { - idxMacc = ""; - NomeMacc = ""; - updateGrView(); - } + /// + /// salvo comando + /// + /// + /// + protected void lbt_Command(object sender, CommandEventArgs e) + { + memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); + } + /// + /// gestione cambio selezione valore + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session il valore selezionato... + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); + bool doClone = false; + bool doEdit = false; + // gestione buttons richieste + string _comando = ""; + if (memLayer.ML.isInSessionObject("nextObjCommand")) + { + _comando = memLayer.ML.StringSessionObj("nextObjCommand"); + memLayer.ML.emptySessionVal("nextObjCommand"); + } + switch (_comando) + { + case "Clona": + doClone = true; + break; + case "Edit": + doEdit = true; + break; + default: + break; + } + if (doClone) + { + memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false); + showAddNewPODL(); + mod_newPromessaODL.doSelPODL(); + } + else if (doEdit) + { + memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false); + showAddNewPODL(); + mod_newPromessaODL.doSelPODL(); + } + else + { + // mostro edit quantità... + divEditQta.Visible = true; + lbtNewPODL.Visible = true; + mod_newPromessaODL.Visible = false; + var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0]; + numPz = riga.NumPezzi; + pzPallet = riga.PzPallet; + } + } + /// + /// 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 = ""; + } + } + /// + /// recupera i dati di un nuovo record contenuti nel footer di un gridView; + /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...) + /// + /// + /// + protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) + { + //recupero la riga footer... + DataColumnCollection colonne = colonneObj(); + string nomeCol; + string tipoColonna = ""; + foreach (DataColumn colonna in colonne) + { + nomeCol = colonna.ColumnName; + // cerco un textbox o quello che sia... + if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null) + { + tipoColonna = "textBox"; + } + else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null) + { + tipoColonna = "dropDownList"; + } + else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null) + { + tipoColonna = "checkBox"; + } + else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null) + { + tipoColonna = "selAjax"; + } + // in base al tipo salvo negli inputparameters dell'ODS + switch (tipoColonna) + { + case "textBox": + e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text; + break; + case "dropDownList": + e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue; + break; + case "checkBox": + e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked; + break; + //case "selAjax": + // e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore; + // break; + default: + break; + } + tipoColonna = ""; + } + } + /// + /// svuoto da cache post update + /// + /// + /// + protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + raiseNewVal(); + } - protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in sessione selezione... - memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue); + #endregion + + #region are public + + + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + grView.SelectedIndex = -1; + grView.DataBind(); + divEditQta.Visible = false; + mod_newPromessaODL.Visible = false; + lbtNewPODL.Visible = true; + lblWarning.Visible = false; + raiseReset(); + } + #endregion + + #endregion + + #region area da modificare + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + if (!Page.IsPostBack) + { + mod_newPromessaODL.Visible = false; + grView.PageSize = pageSize; + // se ho in sessione selezione la recupero... + if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase) + { + ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode"); + } + } + mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore); + } + + /// inizializzazione valori di default + /// + /// + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + _idxGridView = "IdxODL"; + } + /// + /// nuovo valore creato... + /// + /// + /// + void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e) + { + // nascondo controllo e mostro button + mod_newPromessaODL.Visible = false; + lbtNewPODL.Visible = true; + // aggiorno! + resetSelezione(); + } + + /// + /// elenco colonne del datagrid + /// + /// + protected DataColumnCollection colonneObj() + { + DS_ProdTempi.ODLDataTable tabella = new DS_ProdTempi.ODLDataTable(); + DataColumnCollection colonne = tabella.Columns; + return colonne; + } + public bool delEnabled(object _idxOdl) + { + bool answ = false; + int idxOdl = 0; + // controllo non sia già stata iniziata la produzione sennò non posso cancellare... + try + { + idxOdl = Convert.ToInt32(_idxOdl); + answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0); + } + catch + { } + return answ; + } + /// + /// mostra creazione nuovo ODL + /// + /// + /// + protected void lbtNewPODL_Click(object sender, EventArgs e) + { + showAddNewPODL(); + } + + private void showAddNewPODL() + { + // mostro controllo creazione ODL + mod_newPromessaODL.Visible = true; + divEditQta.Visible = false; + lbtNewPODL.Visible = false; + grView.SelectedIndex = -1; + grView.DataBind(); + } + + /// + /// formatot url x stampa ODL + /// + /// + /// + public string formattaUrlOdl(object idx) + { + string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx); + return answ; + } + + /// + /// cambio dim pagina + /// + /// + /// + protected void txtPageSize_TextChanged(object sender, EventArgs e) + { + grView.PageSize = pageSize; + } + + + /// + /// elimina commento + /// + /// + /// + protected void lbtDel_Click(object sender, EventArgs e) + { + LinkButton imgBtn = (LinkButton)sender; + int IdxProm = 0; + int.TryParse(imgBtn.CommandArgument, out IdxProm); + DataLayerObj.taPODL.deleteQuery(IdxProm); + doUpdate(); + } + + private void doUpdate() + { + grView.DataBind(); + } + + #endregion + + protected void btnOk_Click(object sender, EventArgs e) + { + if (idxPOdlSel > 0) + { + DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel); + } + updateCtrl(); + } + + private void updateCtrl() + { + divEditQta.Visible = false; + grView.SelectedIndex = -1; + grView.DataBind(); + } + /// + /// idxOdl selezionato + /// + protected int idxPOdlSel + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(grView.SelectedValue); + } + catch + { } + return answ; + } + } + /// + /// Nuovo num pz + /// + protected int numPz + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtNewQta.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtNewQta.Text = value.ToString(); + } + } + /// + /// Nuovo num pz per pallet + /// + protected int pzPallet + { + get + { + int answ = 1; + try + { + answ = Convert.ToInt32(txtNewPzPallet.Text.Trim()); + } + catch + { } + // controllo sia > 0... + if (answ < 1) + { + answ = 1; + } + + return answ; + } + set + { + txtNewPzPallet.Text = value.ToString(); + } + } + protected void btnCancel_Click(object sender, EventArgs e) + { + updateCtrl(); + } + + protected void chkUnassigned_CheckedChanged(object sender, EventArgs e) + { + updateGrView(); + } + /// + /// Aggiorno Gridview + /// + private void updateGrView() + { + grView.DataBind(); + } + + /// + /// IdxMacchina filtrata + /// + protected string idxMacc + { + get + { + return lblIdxMacc.Text; + } + set + { + lblIdxMacc.Text = value; + } + } + /// + /// Nome filtrata + /// + protected string NomeMacc + { + get + { + return lblNomeMacc.Text; + } + set + { + lblNomeMacc.Text = value; + } + } + /// + /// CodArt filtrato + /// + protected string CodArt + { + get + { + return lblCodArt.Text; + } + set + { + lblCodArt.Text = value; + } + } + /// + /// CodArt filtrato + /// + protected string DescArt + { + get + { + return lblDescArt.Text; + } + set + { + lblDescArt.Text = value; + } + } + + /// + /// Selezionato un condominio --> riporto selezione + /// + /// + /// + protected void lbtSelArt_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + string[] artData = lb.CommandArgument.Split('|'); + CodArt = artData[0]; + DescArt = artData[1]; + updateGrView(); + } + /// + /// Selezionato un condominio --> riporto selezione + /// + /// + /// + protected void lbtSelMacc_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + string[] maccData = lb.CommandArgument.Split('|'); + idxMacc = maccData[0]; + NomeMacc = maccData[1]; + updateGrView(); + } + + protected void lbtResArt_Click(object sender, EventArgs e) + { + CodArt = ""; + DescArt = ""; + updateGrView(); + } + + protected void lbtResMacc_Click(object sender, EventArgs e) + { + idxMacc = ""; + NomeMacc = ""; + updateGrView(); + } + + protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in sessione selezione... + memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue); + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestPromODL_OUT.ascx.cs b/MP-ADM/WebUserControls/mod_gestPromODL_OUT.ascx.cs index 84b6e48a..7a9ada12 100644 --- a/MP-ADM/WebUserControls/mod_gestPromODL_OUT.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestPromODL_OUT.ascx.cs @@ -7,691 +7,656 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_gestPromODL_OUT : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - /// - /// Determina se sia solo readonly il controllo... - /// - public bool readOnly; - /// - /// Chiave PRE selezione tipo richiesta ordine - /// - public string codOrdPre + public partial class mod_gestPromODL_OUT : BaseUserControl { - get - { - return hfCodPre.Value.Trim(); - } - set - { - hfCodPre.Value = value; - } - } - /// - /// dimensione pagina - /// - public int pageSize - { - get - { - int answ = 10; - try + /// + /// Determina se sia solo readonly il controllo... + /// + public bool readOnly; + /// + /// Chiave PRE selezione tipo richiesta ordine + /// + public string codOrdPre { - answ = Convert.ToInt32(txtPageSize.Text); + get + { + return hfCodPre.Value.Trim(); + } + set + { + hfCodPre.Value = value; + } } - catch - { } - return answ; - } - set - { - txtPageSize.Text = value.ToString(); - } - } - - /// - /// Abilitazione modifica selettore fase - /// - public bool enableSelFase - { - get - { - return ddlCodGruppo.Enabled; - } - set - { - ddlCodGruppo.Enabled = value; - } - } - /// - /// Gruppo selezionato - /// - public string CodGruppo - { - get - { - return ddlCodGruppo.SelectedValue; - } - set - { - ddlCodGruppo.SelectedValue = value; - } - } - - #region area da NON modificare - - #region area protected - - protected string _idxGridView; - - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); - } - - /// - /// salvo comando - /// - /// - /// - protected void lbt_Command(object sender, CommandEventArgs e) - { - SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); - } - /// - /// gestione cambio selezione valore - /// - /// - /// - protected void grView_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in session il valore selezionato... - memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); - bool doClone = false; - bool doEdit = false; - // gestione buttons richieste - string _comando = ""; - if (memLayer.ML.isInSessionObject("nextObjCommand")) - { - _comando = memLayer.ML.StringSessionObj("nextObjCommand"); - memLayer.ML.emptySessionVal("nextObjCommand"); - } - switch (_comando) - { - case "Clona": - doClone = true; - break; - case "Edit": - doEdit = true; - break; - default: - break; - } - if (doClone) - { - memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false); - showAddNewPODL(); - mod_newPromessaODL.doSelPODL(); - } - else if (doEdit) - { - memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false); - showAddNewPODL(); - mod_newPromessaODL.doSelPODL(); - } - else - { - // mostro edit quantità... - divEditQta.Visible = true; - lbtNewPODL.Visible = true; - mod_newPromessaODL.Visible = false; - var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0]; - numPz = riga.NumPezzi; - pzPallet = riga.PzPallet; - } - } - /// - /// 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) + /// + /// dimensione pagina + /// + public int pageSize { - 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 = ""; - } - } - /// - /// recupera i dati di un nuovo record contenuti nel footer di un gridView; - /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...) - /// - /// - /// - protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) - { - //recupero la riga footer... - DataColumnCollection colonne = colonneObj(); - string nomeCol; - string tipoColonna = ""; - foreach (DataColumn colonna in colonne) - { - nomeCol = colonna.ColumnName; - // cerco un textbox o quello che sia... - if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null) - { - tipoColonna = "textBox"; - } - else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null) - { - tipoColonna = "dropDownList"; - } - else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null) - { - tipoColonna = "checkBox"; - } - else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null) - { - tipoColonna = "selAjax"; - } - // in base al tipo salvo negli inputparameters dell'ODS - switch (tipoColonna) - { - case "textBox": - e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text; - break; - case "dropDownList": - e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue; - break; - case "checkBox": - e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked; - break; - //case "selAjax": - // e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore; - // break; - default: - break; - } - tipoColonna = ""; - } - } - /// - /// svuoto da cache post update - /// - /// - /// - protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) - { - // evento come nuovo... - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - - #endregion - - #region are public - - /// - /// effettua traduzione del lemma - /// - /// - /// - public string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } - /// - /// effettua traduzione in inglese del lemma - /// - /// - /// - public string traduciEn(string lemma) - { - return user_std.UtSn.TraduciEn(lemma); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); - grView.SelectedIndex = -1; - grView.DataBind(); - divEditQta.Visible = false; - mod_newPromessaODL.Visible = false; - lbtNewPODL.Visible = true; - lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } - - } - #endregion - - #endregion - - #region gestione eventi - - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; - - #endregion - - #region area da modificare - - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - if (!Page.IsPostBack) - { - mod_newPromessaODL.Visible = false; - grView.PageSize = pageSize; - // se ho in sessione selezione la recupero... - if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase) - { - ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode"); - } - } - mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore); - } - - /// inizializzazione valori di default - /// - /// - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - _idxGridView = "IdxODL"; - } - /// - /// nuovo valore creato... - /// - /// - /// - void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e) - { - // nascondo controllo e mostro button - mod_newPromessaODL.Visible = false; - lbtNewPODL.Visible = true; - // aggiorno! - resetSelezione(); - } - - /// - /// elenco colonne del datagrid - /// - /// - protected DataColumnCollection colonneObj() - { - MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable(); - DataColumnCollection colonne = tabella.Columns; - return colonne; - } - public bool delEnabled(object _idxOdl) - { - bool answ = false; - int idxOdl = 0; - // controllo non sia già stata iniziata la produzione sennò non posso cancellare... - try - { - idxOdl = Convert.ToInt32(_idxOdl); - answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0); - } - catch - { } - return answ; - } - /// - /// mostra creazione nuovo ODL - /// - /// - /// - protected void lbtNewPODL_Click(object sender, EventArgs e) - { - showAddNewPODL(); - } - - private void showAddNewPODL() - { - // mostro controllo creazione ODL - mod_newPromessaODL.Visible = true; - divEditQta.Visible = false; - lbtNewPODL.Visible = false; - grView.SelectedIndex = -1; - grView.DataBind(); - } - - /// - /// formatot url x stampa ODL - /// - /// - /// - public string formattaUrlOdl(object idx) - { - string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx); - return answ; - } - - /// - /// cambio dim pagina - /// - /// - /// - protected void txtPageSize_TextChanged(object sender, EventArgs e) - { - grView.PageSize = pageSize; - } - - - /// - /// elimina commento - /// - /// - /// - protected void lbtDel_Click(object sender, EventArgs e) - { - LinkButton imgBtn = (LinkButton)sender; - int IdxProm = 0; - int.TryParse(imgBtn.CommandArgument, out IdxProm); - DataLayerObj.taPODL.deleteQuery(IdxProm); - doUpdate(); - } - - protected void doUpdate() - { - updateGrView(); - } - - #endregion - - protected void btnOk_Click(object sender, EventArgs e) - { - if (idxPOdlSel > 0) - { - DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel); - } - updateCtrl(); - } - - private void updateCtrl() - { - divEditQta.Visible = false; - grView.SelectedIndex = -1; - grView.DataBind(); - } - /// - /// idxOdl selezionato - /// - protected int idxPOdlSel - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(grView.SelectedValue); - } - catch - { } - return answ; - } - } - /// - /// Nuovo num pz - /// - protected int numPz - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtNewQta.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtNewQta.Text = value.ToString(); - } - } - /// - /// Nuovo num pz per pallet - /// - protected int pzPallet - { - get - { - int answ = 1; - try - { - answ = Convert.ToInt32(txtNewPzPallet.Text.Trim()); - } - catch - { } - // controllo sia > 0... - if (answ < 1) - { - answ = 1; + get + { + int answ = 10; + try + { + answ = Convert.ToInt32(txtPageSize.Text); + } + catch + { } + return answ; + } + set + { + txtPageSize.Text = value.ToString(); + } } - return answ; - } - set - { - txtNewPzPallet.Text = value.ToString(); - } - } - protected void btnCancel_Click(object sender, EventArgs e) - { - updateCtrl(); - } + /// + /// Abilitazione modifica selettore fase + /// + public bool enableSelFase + { + get + { + return ddlCodGruppo.Enabled; + } + set + { + ddlCodGruppo.Enabled = value; + } + } + /// + /// Gruppo selezionato + /// + public string CodGruppo + { + get + { + return ddlCodGruppo.SelectedValue; + } + set + { + ddlCodGruppo.SelectedValue = value; + } + } - protected void chkUnassigned_CheckedChanged(object sender, EventArgs e) - { - updateGrView(); - } - /// - /// Aggiorno Gridview - /// - private void updateGrView() - { - grView.DataBind(); - } - /// - /// IdxMacchina filtrata - /// - protected string idxMacc - { - get - { - return lblIdxMacc.Text; - } - set - { - lblIdxMacc.Text = value; - } - } - /// - /// Nome filtrata - /// - protected string NomeMacc - { - get - { - return lblNomeMacc.Text; - } - set - { - lblNomeMacc.Text = value; - } - } - /// - /// CodArt filtrato - /// - protected string CodArt - { - get - { - return lblCodArt.Text; - } - set - { - lblCodArt.Text = value; - } - } - /// - /// CodArt filtrato - /// - protected string DescArt - { - get - { - return lblDescArt.Text; - } - set - { - lblDescArt.Text = value; - } - } + #region area da NON modificare - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelArt_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] artData = lb.CommandArgument.Split('|'); - CodArt = artData[0]; - DescArt = artData[1]; - updateGrView(); - } - /// - /// Selezionato un condominio --> riporto selezione - /// - /// - /// - protected void lbtSelMacc_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - string[] maccData = lb.CommandArgument.Split('|'); - idxMacc = maccData[0]; - NomeMacc = maccData[1]; - updateGrView(); - } + #region area protected - /// - /// Richiesto abbassamento priorità = ANTICIPA - /// - /// - /// - protected void lnkMoveDown_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - int IdxPromessa = 0; - int.TryParse(lb.CommandArgument, out IdxPromessa); - // chiamo stored - DataLayerObj.taPromOut.movePrio(IdxPromessa, -1); - //update! - updateGrView(); - } - /// - /// Richiesto aumento priorità = RITARDA - /// - /// - /// - protected void lnkMoveUp_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - // imposto articolo, splittando - int IdxPromessa = 0; - int.TryParse(lb.CommandArgument, out IdxPromessa); - // chiamo stored - DataLayerObj.taPromOut.movePrio(IdxPromessa, 1); - //update! - updateGrView(); - } + protected string _idxGridView; + + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + + /// + /// salvo comando + /// + /// + /// + protected void lbt_Command(object sender, CommandEventArgs e) + { + memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument); + } + /// + /// gestione cambio selezione valore + /// + /// + /// + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in session il valore selezionato... + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); + bool doClone = false; + bool doEdit = false; + // gestione buttons richieste + string _comando = ""; + if (memLayer.ML.isInSessionObject("nextObjCommand")) + { + _comando = memLayer.ML.StringSessionObj("nextObjCommand"); + memLayer.ML.emptySessionVal("nextObjCommand"); + } + switch (_comando) + { + case "Clona": + doClone = true; + break; + case "Edit": + doEdit = true; + break; + default: + break; + } + if (doClone) + { + memLayer.ML.setSessionVal("idxProm2Clone", grView.SelectedValue, false); + showAddNewPODL(); + mod_newPromessaODL.doSelPODL(); + } + else if (doEdit) + { + memLayer.ML.setSessionVal("idxProm2Edit", grView.SelectedValue, false); + showAddNewPODL(); + mod_newPromessaODL.doSelPODL(); + } + else + { + // mostro edit quantità... + divEditQta.Visible = true; + lbtNewPODL.Visible = true; + mod_newPromessaODL.Visible = false; + var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0]; + numPz = riga.NumPezzi; + pzPallet = riga.PzPallet; + } + } + /// + /// 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 = ""; + } + } + /// + /// recupera i dati di un nuovo record contenuti nel footer di un gridView; + /// questi devono esses opportunamente nominati (es: txt{0}, dl{0}, ...) + /// + /// + /// + protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e) + { + //recupero la riga footer... + DataColumnCollection colonne = colonneObj(); + string nomeCol; + string tipoColonna = ""; + foreach (DataColumn colonna in colonne) + { + nomeCol = colonna.ColumnName; + // cerco un textbox o quello che sia... + if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null) + { + tipoColonna = "textBox"; + } + else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null) + { + tipoColonna = "dropDownList"; + } + else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null) + { + tipoColonna = "checkBox"; + } + else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null) + { + tipoColonna = "selAjax"; + } + // in base al tipo salvo negli inputparameters dell'ODS + switch (tipoColonna) + { + case "textBox": + e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text; + break; + case "dropDownList": + e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue; + break; + case "checkBox": + e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked; + break; + //case "selAjax": + // e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore; + // break; + default: + break; + } + tipoColonna = ""; + } + } + /// + /// svuoto da cache post update + /// + /// + /// + protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) + { + raiseNewVal(); + } + + #endregion + + #region are public + + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + grView.SelectedIndex = -1; + grView.DataBind(); + divEditQta.Visible = false; + mod_newPromessaODL.Visible = false; + lbtNewPODL.Visible = true; + lblWarning.Visible = false; + raiseReset(); + } + #endregion + + #endregion - protected void lbtResArt_Click(object sender, EventArgs e) - { - CodArt = ""; - DescArt = ""; - updateGrView(); - } - protected void lbtResMacc_Click(object sender, EventArgs e) - { - idxMacc = ""; - NomeMacc = ""; - updateGrView(); - } + #region area da modificare - protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e) - { - // salvo in sessione selezione... - memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue); + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + if (!Page.IsPostBack) + { + mod_newPromessaODL.Visible = false; + grView.PageSize = pageSize; + // se ho in sessione selezione la recupero... + if (memLayer.ML.isInSessionObject("selFaseBCode") && enableSelFase) + { + ddlCodGruppo.SelectedValue = memLayer.ML.StringSessionObj("selFaseBCode"); + } + } + mod_newPromessaODL.eh_nuovoValore += new EventHandler(mod_newOdl1_eh_nuovoValore); + } + + /// inizializzazione valori di default + /// + /// + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + _idxGridView = "IdxODL"; + } + /// + /// nuovo valore creato... + /// + /// + /// + void mod_newOdl1_eh_nuovoValore(object sender, EventArgs e) + { + // nascondo controllo e mostro button + mod_newPromessaODL.Visible = false; + lbtNewPODL.Visible = true; + // aggiorno! + resetSelezione(); + } + + /// + /// elenco colonne del datagrid + /// + /// + protected DataColumnCollection colonneObj() + { + MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable(); + DataColumnCollection colonne = tabella.Columns; + return colonne; + } + public bool delEnabled(object _idxOdl) + { + bool answ = false; + int idxOdl = 0; + // controllo non sia già stata iniziata la produzione sennò non posso cancellare... + try + { + idxOdl = Convert.ToInt32(_idxOdl); + answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0); + } + catch + { } + return answ; + } + /// + /// mostra creazione nuovo ODL + /// + /// + /// + protected void lbtNewPODL_Click(object sender, EventArgs e) + { + showAddNewPODL(); + } + + private void showAddNewPODL() + { + // mostro controllo creazione ODL + mod_newPromessaODL.Visible = true; + divEditQta.Visible = false; + lbtNewPODL.Visible = false; + grView.SelectedIndex = -1; + grView.DataBind(); + } + + /// + /// formatot url x stampa ODL + /// + /// + /// + public string formattaUrlOdl(object idx) + { + string answ = String.Format(memLayer.ML.CRS("exportFormat1"), Convert.ToInt32(reportRichiesto.SchedaODL), idx); + return answ; + } + + /// + /// cambio dim pagina + /// + /// + /// + protected void txtPageSize_TextChanged(object sender, EventArgs e) + { + grView.PageSize = pageSize; + } + + + /// + /// elimina commento + /// + /// + /// + protected void lbtDel_Click(object sender, EventArgs e) + { + LinkButton imgBtn = (LinkButton)sender; + int IdxProm = 0; + int.TryParse(imgBtn.CommandArgument, out IdxProm); + DataLayerObj.taPODL.deleteQuery(IdxProm); + doUpdate(); + } + + protected void doUpdate() + { + updateGrView(); + } + + #endregion + + protected void btnOk_Click(object sender, EventArgs e) + { + if (idxPOdlSel > 0) + { + DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel); + } + updateCtrl(); + } + + private void updateCtrl() + { + divEditQta.Visible = false; + grView.SelectedIndex = -1; + grView.DataBind(); + } + /// + /// idxOdl selezionato + /// + protected int idxPOdlSel + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(grView.SelectedValue); + } + catch + { } + return answ; + } + } + /// + /// Nuovo num pz + /// + protected int numPz + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtNewQta.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtNewQta.Text = value.ToString(); + } + } + /// + /// Nuovo num pz per pallet + /// + protected int pzPallet + { + get + { + int answ = 1; + try + { + answ = Convert.ToInt32(txtNewPzPallet.Text.Trim()); + } + catch + { } + // controllo sia > 0... + if (answ < 1) + { + answ = 1; + } + + return answ; + } + set + { + txtNewPzPallet.Text = value.ToString(); + } + } + protected void btnCancel_Click(object sender, EventArgs e) + { + updateCtrl(); + } + + protected void chkUnassigned_CheckedChanged(object sender, EventArgs e) + { + updateGrView(); + } + /// + /// Aggiorno Gridview + /// + private void updateGrView() + { + grView.DataBind(); + } + /// + /// IdxMacchina filtrata + /// + protected string idxMacc + { + get + { + return lblIdxMacc.Text; + } + set + { + lblIdxMacc.Text = value; + } + } + /// + /// Nome filtrata + /// + protected string NomeMacc + { + get + { + return lblNomeMacc.Text; + } + set + { + lblNomeMacc.Text = value; + } + } + /// + /// CodArt filtrato + /// + protected string CodArt + { + get + { + return lblCodArt.Text; + } + set + { + lblCodArt.Text = value; + } + } + /// + /// CodArt filtrato + /// + protected string DescArt + { + get + { + return lblDescArt.Text; + } + set + { + lblDescArt.Text = value; + } + } + + /// + /// Selezionato un condominio --> riporto selezione + /// + /// + /// + protected void lbtSelArt_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + string[] artData = lb.CommandArgument.Split('|'); + CodArt = artData[0]; + DescArt = artData[1]; + updateGrView(); + } + /// + /// Selezionato un condominio --> riporto selezione + /// + /// + /// + protected void lbtSelMacc_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + string[] maccData = lb.CommandArgument.Split('|'); + idxMacc = maccData[0]; + NomeMacc = maccData[1]; + updateGrView(); + } + + /// + /// Richiesto abbassamento priorità = ANTICIPA + /// + /// + /// + protected void lnkMoveDown_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + int IdxPromessa = 0; + int.TryParse(lb.CommandArgument, out IdxPromessa); + // chiamo stored + DataLayerObj.taPromOut.movePrio(IdxPromessa, -1); + //update! + updateGrView(); + } + /// + /// Richiesto aumento priorità = RITARDA + /// + /// + /// + protected void lnkMoveUp_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + // imposto articolo, splittando + int IdxPromessa = 0; + int.TryParse(lb.CommandArgument, out IdxPromessa); + // chiamo stored + DataLayerObj.taPromOut.movePrio(IdxPromessa, 1); + //update! + updateGrView(); + } + + + protected void lbtResArt_Click(object sender, EventArgs e) + { + CodArt = ""; + DescArt = ""; + updateGrView(); + } + + protected void lbtResMacc_Click(object sender, EventArgs e) + { + idxMacc = ""; + NomeMacc = ""; + updateGrView(); + } + + protected void ddlCodGruppo_SelectedIndexChanged(object sender, EventArgs e) + { + // salvo in sessione selezione... + memLayer.ML.setSessionVal("selFaseBCode", ddlCodGruppo.SelectedValue); + } + /// + /// Verifica se sia permesso cambio priorità (NON può andare a 0 ne oltre il max x macchina) + /// + /// + /// + /// + /// + public bool checkChgPrio(string IdxMacchina, string priorStr, int delta) + { + bool answ = false; + int priorita = 0; + int.TryParse(priorStr, out priorita); + // calcolo i limiti priorità x macchina (0 --> max x macchina)... LPI/LPS liminte priorità inferiore / superiore + int LPI = 1; + int LPS = 1; + var tabella = DataLayerObj.taPromOut.getMaxPrioByMacc(IdxMacchina, true); + if (tabella.Rows.Count > 0) + { + LPS = tabella[0].Priorita; + } + // è ok SE sono ENTRO i 2 limiti + answ = ((priorita + delta) >= LPI && (priorita + delta) <= LPS); + //return + return answ; + } } - /// - /// Verifica se sia permesso cambio priorità (NON può andare a 0 ne oltre il max x macchina) - /// - /// - /// - /// - /// - public bool checkChgPrio(string IdxMacchina, string priorStr, int delta) - { - bool answ = false; - int priorita = 0; - int.TryParse(priorStr, out priorita); - // calcolo i limiti priorità x macchina (0 --> max x macchina)... LPI/LPS liminte priorità inferiore / superiore - int LPI = 1; - int LPS = 1; - var tabella = DataLayerObj.taPromOut.getMaxPrioByMacc(IdxMacchina, true); - if (tabella.Rows.Count > 0) - { - LPS = tabella[0].Priorita; - } - // è ok SE sono ENTRO i 2 limiti - answ = ((priorita + delta) >= LPI && (priorita + delta) <= LPS); - //return - return answ; - } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx.cs b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx.cs index 7e40fd57..0c0e7da8 100644 --- a/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestioneDatiMacchine.ascx.cs @@ -5,7 +5,7 @@ using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls { - public partial class mod_gestioneDatiMacchine : System.Web.UI.UserControl + public partial class mod_gestioneDatiMacchine : BaseUserControl { #region area da NON modificare @@ -31,12 +31,8 @@ namespace MP_ADM.WebUserControls protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // salvo in session il valore selezionato... - SteamWare.memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); - // sollevo evento nuovo valore... - if (eh_selValore != null) - { - eh_selValore(this, new EventArgs()); - } + memLayer.ML.setSessionVal(string.Format("{0}_sel", _idxGridView), grView.SelectedValue, false); + raiseSelNew(); } /// /// traduce gli header delle colonne @@ -127,61 +123,29 @@ namespace MP_ADM.WebUserControls /// protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) { - // evento come nuovo... - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } + raiseNewVal(); } #endregion #region are public - /// - /// effettua traduzione del lemma - /// - /// - /// - public string traduci(string lemma) - { - return user_std.UtSn.Traduci(lemma); - } - /// - /// effettua traduzione in inglese del lemma - /// - /// - /// - public string traduciEn(string lemma) - { - return user_std.UtSn.TraduciEn(lemma); - } /// /// resetta la selezione dei valori in caso di modifiche su altri controlli /// public void resetSelezione() { - SteamWare.memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); + memLayer.ML.emptySessionVal(string.Format("{0}_sel", _idxGridView)); grView.SelectedIndex = -1; grView.DataBind(); lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } + raiseReset(); } #endregion #endregion - #region gestione eventi - - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; - public event EventHandler eh_selValore; - - #endregion #region area da modificare diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs index b849dfd2..ebdcc1d7 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.designer.cs @@ -84,7 +84,7 @@ namespace MP_ADM.WebUserControls /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::MoonPro_site.WebUserControls.mod_newOdl mod_newOdl1; + protected global::MP_ADM.WebUserControls.mod_newOdl mod_newOdl1; /// /// Controllo divEditQta. diff --git a/MP-ADM/WebUserControls/mod_login.ascx.cs b/MP-ADM/WebUserControls/mod_login.ascx.cs index 15a60cca..7f021b71 100644 --- a/MP-ADM/WebUserControls/mod_login.ascx.cs +++ b/MP-ADM/WebUserControls/mod_login.ascx.cs @@ -120,7 +120,7 @@ namespace MP_ADM.WebUserControls bool _allowForceUser = false; try { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + _allowForceUser = memLayer.ML.CRB("_allowForceUser"); } catch { @@ -146,7 +146,7 @@ namespace MP_ADM.WebUserControls else { lblMessage.Text = String.Format("{0}
key not allowed for operation!! operation logged!!", user_std.UtSn.Traduci("AccessFail")); - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la sua key autorizzativa e' sbagliata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp")))); string _rigaLog = String.Format("User {0}\t tried to force user - wrong password - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); if (Login_Error != null) @@ -157,7 +157,7 @@ namespace MP_ADM.WebUserControls } else { - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp")))); string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}\\{2}", Page.User.Identity.Name, dominio.Text, user.Text); SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); if (Login_Error != null) @@ -187,7 +187,7 @@ namespace MP_ADM.WebUserControls bool _allowForceUser = false; try { - _allowForceUser = SteamWare.memLayer.ML.CRB("_allowForceUser"); + _allowForceUser = memLayer.ML.CRB("_allowForceUser"); } catch { @@ -216,7 +216,7 @@ namespace MP_ADM.WebUserControls } else { - mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("defaultApp")))); + mandaEmail(_fromEmail, _adminEmail, "Attenzione: tentativo di accesso non autorizzato!", String.Format("Tentativo di forcing user non autorizzato!
L'utente {0} ha tentato di accedere a {1} forzando l'utente ma la funzione e' disabilitata...", Page.User.Identity.Name, user_std.UtSn.Traduci(memLayer.ML.CRS("defaultApp")))); string _rigaLog = String.Format("User {0}\t tried to force user - access disabled - he tried to log as \t {1}", Page.User.Identity.Name, ddlStdUser.SelectedValue); SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.WARNING); if (Login_Error != null) diff --git a/MP-ADM/WebUserControls/mod_main_help.ascx b/MP-ADM/WebUserControls/mod_main_help.ascx index 9bf29586..2b7b86ec 100644 --- a/MP-ADM/WebUserControls/mod_main_help.ascx +++ b/MP-ADM/WebUserControls/mod_main_help.ascx @@ -1,91 +1,91 @@ <%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_main_help" CodeBehind="mod_main_help.ascx.cs" %>
-
- +
+
<%: traduci("btnAnagArticoli") %>
-
-
-
- + +
+
+
<%: traduci("btnGestPromesseOdl") %>
-
-
-
- + +
+
+
<%: traduci("btnGestOdl") %>
-
-
-
- + +
+
+
<%: traduci("btnGestDatiMacchina") %>
-
-
-
-
+
+
+
+
<%: traduci("btnApprovaTC") %>
-
-
-
- + +
+
+
<%: traduci("btnApprovaProd") %>
-
-
-
- + +
+
+
<%: traduci("btnBCode") %>
-
-
-
- + +
+
+
<%: traduci("btnGestKIT") %>
-
-
-
- + +
+
+
<%: traduci("btnPlanner") %>
-
-
-
- + +
+
+
<%: traduci("btnDataImport") %>
-
-
-
- + +
+
+
<%: traduci("btnBCodeCTrack") %>
-
-
+
+
diff --git a/MP-ADM/WebUserControls/mod_menuBottom.ascx.cs b/MP-ADM/WebUserControls/mod_menuBottom.ascx.cs index ce6f9f0b..c7648a10 100644 --- a/MP-ADM/WebUserControls/mod_menuBottom.ascx.cs +++ b/MP-ADM/WebUserControls/mod_menuBottom.ascx.cs @@ -3,19 +3,22 @@ using System.Configuration; using System.Diagnostics; using System.Web.UI; -public partial class mod_menuBottom : System.Web.UI.UserControl + +namespace MP_ADM.WebUserControls { - protected void Page_Load(object sender, EventArgs e) + public partial class mod_menuBottom : BaseUserControl { - if (!Page.IsPostBack) + protected void Page_Load(object sender, EventArgs e) { - // sistemo le stringhe... - //lblApp.Text = string.Format("{0} v.{1}.{2}", ConfigurationManager.AppSettings.Get("appName"), ConfigurationManager.AppSettings.Get("mainRev"), ConfigurationManager.AppSettings.Get("minRev")); - var versionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); - lblCopyRight.Text = string.Format("{0}", versionInfo.LegalCopyright); - lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); + if (!Page.IsPostBack) + { + // sistemo le stringhe... + var versionInfo = FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); + lblCopyRight.Text = string.Format("{0}", versionInfo.LegalCopyright); + lblApp.Text = string.Format("{0} v.{1}", ConfigurationManager.AppSettings.Get("appName"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version); + } } } } diff --git a/MP-ADM/WebUserControls/mod_menuBottom.ascx.designer.cs b/MP-ADM/WebUserControls/mod_menuBottom.ascx.designer.cs index d3b8a8b0..e50f0b9b 100644 --- a/MP-ADM/WebUserControls/mod_menuBottom.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_menuBottom.ascx.designer.cs @@ -9,41 +9,45 @@ -public partial class mod_menuBottom { - - /// - /// Controllo lblrev. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.Label lblrev; - - /// - /// Controllo lblApp. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.Label lblApp; - - /// - /// Controllo lblCopyRight. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.WebControls.Label lblCopyRight; - - /// - /// Controllo updtRicerca. - /// - /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. - /// - protected global::System.Web.UI.UpdateProgress updtRicerca; +namespace MP_ADM.WebUserControls +{ + public partial class mod_menuBottom + { + + /// + /// Controllo lblrev. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblrev; + + /// + /// Controllo lblApp. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblApp; + + /// + /// Controllo lblCopyRight. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblCopyRight; + + /// + /// Controllo updtRicerca. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.UpdateProgress updtRicerca; + } } diff --git a/MP-ADM/WebUserControls/mod_menuTop.ascx b/MP-ADM/WebUserControls/mod_menuTop.ascx index 165b6c21..4bc67a28 100644 --- a/MP-ADM/WebUserControls/mod_menuTop.ascx +++ b/MP-ADM/WebUserControls/mod_menuTop.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_menuTop" +<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_menuTop" CodeBehind="mod_menuTop.ascx.cs" %> <%-- Gestione resize --%> @@ -19,7 +19,7 @@ <%: DateTime.Now.ToString("HH.mm.ss") %> - +
diff --git a/MP-ADM/WebUserControls/mod_menuTop.ascx.cs b/MP-ADM/WebUserControls/mod_menuTop.ascx.cs index b83f8773..8bd770ff 100644 --- a/MP-ADM/WebUserControls/mod_menuTop.ascx.cs +++ b/MP-ADM/WebUserControls/mod_menuTop.ascx.cs @@ -3,179 +3,168 @@ using System; using System.Collections.Generic; using System.Web.UI; -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_menuTop : System.Web.UI.UserControl - { - private string _titleString; - - #region gestione eventi - - public event EventHandler eh_toggleMenuSx; - public event EventHandler eh_reqUpdateMenu; - - #endregion - - protected void Page_Load(object sender, EventArgs e) + public partial class mod_menuTop : BaseUserControl { - btnLogOut.Visible = user_std.UtSn.isForcedUser; - if (memLayer.ML.isInSessionObject("doUpdateNow")) - { - doFullDataUpdate(); - memLayer.ML.emptySessionVal("doUpdateNow"); - } - } - protected void btnLogOut_Click(object sender, EventArgs e) - { - Session.Abandon(); - Response.Redirect("forceUser.aspx"); - } - protected void btnUpdate_Click(object sender, EventArgs e) - { - doFullDataUpdate(); - updateWindowSize(); - } + private string _titleString; - private void doFullDataUpdate() - { - // salvo i dati attuali... - string cod_cdc = SteamWare.memLayer.ML.StringSessionObj("valRicercaCdC"); - string lingua = user_std.UtSn.lingua; - string USER_NAME = SteamWare.memLayer.ML.StringSessionObj("USER_NAME"); - string DOMINIO = SteamWare.memLayer.ML.StringSessionObj("DOMINIO"); - bool isForceUser = user_std.UtSn.isForcedUser; - // salvo i valori delle tab in session... - Dictionary sessionParam = SteamWare.memLayer.ML.valSess2SurvUpd; + #region gestione eventi - // svuoto session e cache per rileggere i dati da Db - Session.RemoveAll(); + public event EventHandler eh_toggleMenuSx; + public event EventHandler eh_reqUpdateMenu; - SteamWare.memLayer.ML.flushRegisteredCache(); + #endregion - // rimemorizzo - SteamWare.memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc); - user_std.UtSn.startUpUtente(DOMINIO, USER_NAME); - user_std.UtSn.lingua = lingua; - user_std.UtSn.isForcedUser = isForceUser; - DataWrap.DW.resetVocabolario(); - - // risalvo in session i valori... - foreach (KeyValuePair kvp in sessionParam) - { - SteamWare.memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true); - } - - // cambio visibilità del menù laterale... - if (eh_reqUpdateMenu != null) - { - eh_reqUpdateMenu(this, new EventArgs()); - } - - Response.Redirect(Page.Request.Url.ToString()); - } - - protected void bindControlli() - { - if (!Page.IsPostBack) - { - //lnkHelp.ToolTip = traduci("ApriManualeHelp"); - // solo se user è auth... - if (user_std.UtSn.isAuth) + protected void Page_Load(object sender, EventArgs e) { - //lnkShowHide.Text = user_std.UtSn.Traduci("lnkShowHide"); - //lblTitle.Text = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("titleApp")); - if (_titleString != "") - { - //// traduzione di tutti i termini - //lblMessUtente.Text = user_std.UtSn.Traduci(_titleString); - ////doppio in english! - //lblMessUtenteEn.Text = "(" + user_std.UtSn.TraduciEn(_titleString) + ")"; - _titleString = ""; - Session["_titleString"] = _titleString; - Session["SessionUpdateMenu"] = true; - } - else - { - //string titolo = user_std.UtSn.Traduci(SteamWare.memLayer.ML.CRS("welcomeApp")); - //lblMessUtente.Text = string.Format("{0} - {1}", titolo, memLayer.ML.CRS("SiteName")); - //lblMessUtenteEn.Text = ""; - Session["SessionUpdateMenu"] = false; - } - btnLogOut.Text = user_std.UtSn.Traduci("LogOut"); - btnUpdate.Text = user_std.UtSn.Traduci("Update"); - //lblUser.Text = String.Format("{0}: {1}", user_std.UtSn.Traduci("User"), user_std.UtSn.CognomeNome); - setTimer(); - setClock(); + btnLogOut.Visible = user_std.UtSn.isForcedUser; + if (memLayer.ML.isInSessionObject("doUpdateNow")) + { + doFullDataUpdate(); + memLayer.ML.emptySessionVal("doUpdateNow"); + } + } + protected void btnLogOut_Click(object sender, EventArgs e) + { + Session.Abandon(); + Response.Redirect("forceUser.aspx"); + } + protected void btnUpdate_Click(object sender, EventArgs e) + { + doFullDataUpdate(); + updateWindowSize(); } - } - } - /// - /// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada - /// - private void setTimer() - { - } - protected void lnkShowHide_Click(object sender, EventArgs e) - { - // cambio visibilità del menù laterale... - if (eh_toggleMenuSx != null) - { - eh_toggleMenuSx(this, new EventArgs()); - } - } - protected void Timer1_Tick(object sender, EventArgs e) - { - setClock(); - } + private void doFullDataUpdate() + { + // salvo i dati attuali... + string cod_cdc = memLayer.ML.StringSessionObj("valRicercaCdC"); + string lingua = user_std.UtSn.lingua; + string USER_NAME = memLayer.ML.StringSessionObj("USER_NAME"); + string DOMINIO = memLayer.ML.StringSessionObj("DOMINIO"); + bool isForceUser = user_std.UtSn.isForcedUser; + // salvo i valori delle tab in session... + Dictionary sessionParam = memLayer.ML.valSess2SurvUpd; - private void setClock() - { - //lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss"); - } - protected void lblUser_Click(object sender, EventArgs e) - { - Response.Redirect("./chLang.aspx"); - } + // svuoto session e cache per rileggere i dati da Db + Session.RemoveAll(); + + memLayer.ML.flushRegisteredCache(); + + // rimemorizzo + memLayer.ML.setSessionVal("valRicercaCdC", cod_cdc); + user_std.UtSn.startUpUtente(DOMINIO, USER_NAME); + user_std.UtSn.lingua = lingua; + user_std.UtSn.isForcedUser = isForceUser; + DataWrap.DW.resetVocabolario(); + + // risalvo in session i valori... + foreach (KeyValuePair kvp in sessionParam) + { + memLayer.ML.setSessionVal(kvp.Key, kvp.Value, true); + } + + // cambio visibilità del menù laterale... + if (eh_reqUpdateMenu != null) + { + eh_reqUpdateMenu(this, new EventArgs()); + } + + Response.Redirect(Page.Request.Url.ToString()); + } + + protected void bindControlli() + { + if (!Page.IsPostBack) + { + // solo se user è auth... + if (user_std.UtSn.isAuth) + { + if (_titleString != "") + { + _titleString = ""; + Session["_titleString"] = _titleString; + Session["SessionUpdateMenu"] = true; + } + else + { + Session["SessionUpdateMenu"] = false; + } + btnLogOut.Text = user_std.UtSn.Traduci("LogOut"); + btnUpdate.Text = user_std.UtSn.Traduci("Update"); + setTimer(); + setClock(); + } + } + } + /// + /// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada + /// + private void setTimer() + { + } + protected void lnkShowHide_Click(object sender, EventArgs e) + { + // cambio visibilità del menù laterale... + if (eh_toggleMenuSx != null) + { + eh_toggleMenuSx(this, new EventArgs()); + } + + } + protected void Timer1_Tick(object sender, EventArgs e) + { + setClock(); + } + + private void setClock() + { + //lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss"); + } + protected void lblUser_Click(object sender, EventArgs e) + { + Response.Redirect("./chLang.aspx"); + } - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - btnUpdate.Text = "Update"; - updateWindowSize(); - } + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + btnUpdate.Text = "Update"; + updateWindowSize(); + } - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - } + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + } + protected override void OnPreRender(EventArgs e) + { + base.OnPreRender(e); + } - private void updateWindowSize() - { - if (HiddenHeight.Value != "") - { - memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true); - } - if (HiddenWidth.Value != "") - { - memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value); - } - } + private void updateWindowSize() + { + if (HiddenHeight.Value != "") + { + memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true); + } + if (HiddenWidth.Value != "") + { + memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value); + } + } - protected void HiddenHeight_ValueChanged(object sender, EventArgs e) - { - updateWindowSize(); - } + protected void HiddenHeight_ValueChanged(object sender, EventArgs e) + { + updateWindowSize(); + } - protected void HiddenWidth_ValueChanged(object sender, EventArgs e) - { - updateWindowSize(); - } + protected void HiddenWidth_ValueChanged(object sender, EventArgs e) + { + updateWindowSize(); + } - } + } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs b/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs index 80c6de3b..1246b8d7 100644 --- a/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_menuTop.ascx.designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { diff --git a/MP-ADM/WebUserControls/mod_menuTopCompact.ascx.cs b/MP-ADM/WebUserControls/mod_menuTopCompact.ascx.cs index a3a1cb9a..a2fb440f 100644 --- a/MP-ADM/WebUserControls/mod_menuTopCompact.ascx.cs +++ b/MP-ADM/WebUserControls/mod_menuTopCompact.ascx.cs @@ -5,93 +5,93 @@ using System.Web.UI; namespace MP_ADM.WebUserControls { - public partial class mod_menuTopCompact : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) + public partial class mod_menuTopCompact : BaseUserControl { - string lastPage = Request.Url.LocalPath.Split('/').Last(); - if (!Page.IsPostBack) - { - // fix visibilità TASK - hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart"); - // se l'utente NON c'è torno a login... - if (!devicesAuthProxy.stObj.isAuth) + protected void Page_Load(object sender, EventArgs e) { - if (lastPage != "" && lastPage != "login") - { - Session["nextPage"] = lastPage; - } - // SE non sono in "safe page" - if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0) - { - Response.Redirect("login"); - } + string lastPage = Request.Url.LocalPath.Split('/').Last(); + if (!Page.IsPostBack) + { + // fix visibilità TASK + hlTask.Visible = devicesAuthProxy.stObj.userHasRight("CT_userStart"); + // se l'utente NON c'è torno a login... + if (!devicesAuthProxy.stObj.isAuth) + { + if (lastPage != "" && lastPage != "login") + { + Session["nextPage"] = lastPage; + } + // SE non sono in "safe page" + if (memLayer.ML.CRS("_loginPages").IndexOf(lastPage) < 0) + { + Response.Redirect("login"); + } + } + else + { + PagCorrente(); + } + } + // controllo pagina... + bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage); + // controllo pag auth... + if (!pageAuth) + { + Response.Redirect("~/login"); + } + lblTitolo.Text = memLayer.ML.CRS("appName"); } - else + /// + /// salva in variabile pagina il nome della pagina corrente + /// + protected void PagCorrente() { - PagCorrente(); + string[] uri = Request.Url.LocalPath.Split('/'); + // salvo pagina corrente + devicesAuthProxy.pagCorrente = uri.Last(); + if (devicesAuthProxy.pagPrecedente == "") + { + devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente; + } } - } - // controllo pagina... - bool pageAuth = devicesAuthProxy.stObj.isPageEnabled(lastPage); - // controllo pag auth... - if (!pageAuth) - { - Response.Redirect("~/login"); - } - lblTitolo.Text = memLayer.ML.CRS("appName"); - } - /// - /// salva in variabile pagina il nome della pagina corrente - /// - protected void PagCorrente() - { - string[] uri = Request.Url.LocalPath.Split('/'); - // salvo pagina corrente - devicesAuthProxy.pagCorrente = uri.Last(); - if (devicesAuthProxy.pagPrecedente == "") - { - devicesAuthProxy.pagPrecedente = devicesAuthProxy.pagCorrente; - } - } - /// - /// Codice postazione di lavoro - /// - public string CodPost - { - get - { - return memLayer.ML.StringSessionObj("CodPost"); - } - } - /// - /// Codice Operatore - /// - public string CodOpr - { - get - { - return memLayer.ML.StringSessionObj("CodOpr"); - } - } - /// - /// Codice TASK corrente - /// - public string CurrNumTask - { - get - { - return memLayer.ML.StringSessionObj("CurrNumTask"); - } - } - /// - /// Codice postazione di lavoro - /// - public string DescPost - { - get - { - string answ = ""; + /// + /// Codice postazione di lavoro + /// + public string CodPost + { + get + { + return memLayer.ML.StringSessionObj("CodPost"); + } + } + /// + /// Codice Operatore + /// + public string CodOpr + { + get + { + return memLayer.ML.StringSessionObj("CodOpr"); + } + } + /// + /// Codice TASK corrente + /// + public string CurrNumTask + { + get + { + return memLayer.ML.StringSessionObj("CurrNumTask"); + } + } + /// + /// Codice postazione di lavoro + /// + public string DescPost + { + get + { + string answ = ""; #if false if (memLayer.ML.isInSessionObject("DescPost")) { @@ -107,17 +107,17 @@ namespace MP_ADM.WebUserControls memLayer.ML.setSessionVal("DescPost", answ); } #endif - return answ; - } - } - /// - /// Codice Operatore - /// - public string NomeOpr - { - get - { - string answ = ""; + return answ; + } + } + /// + /// Codice Operatore + /// + public string NomeOpr + { + get + { + string answ = ""; #if false if (memLayer.ML.isInSessionObject("NomeOpr")) { @@ -133,8 +133,8 @@ namespace MP_ADM.WebUserControls memLayer.ML.setSessionVal("NomeOpr", answ); } #endif - return answ; - } + return answ; + } + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_newOdl.ascx b/MP-ADM/WebUserControls/mod_newOdl.ascx index bbb21287..346d8985 100644 --- a/MP-ADM/WebUserControls/mod_newOdl.ascx +++ b/MP-ADM/WebUserControls/mod_newOdl.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_newOdl.ascx.cs" - Inherits="MoonPro_site.WebUserControls.mod_newOdl" %> + Inherits="MP_ADM.WebUserControls.mod_newOdl" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
diff --git a/MP-ADM/WebUserControls/mod_newOdl.ascx.cs b/MP-ADM/WebUserControls/mod_newOdl.ascx.cs index f800f327..3245d2b9 100644 --- a/MP-ADM/WebUserControls/mod_newOdl.ascx.cs +++ b/MP-ADM/WebUserControls/mod_newOdl.ascx.cs @@ -2,162 +2,158 @@ using SteamWare; using System; -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_newOdl : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class mod_newOdl : BaseUserControl { - - } - - #region gestione eventi - - public event EventHandler eh_nuovoValore; - - #endregion - - /// - /// conferma inserimento TC - /// - /// - /// - protected void btnOk_Click(object sender, EventArgs e) - { - // controllo se ho tutti i valori ok... - string CodArticolo = ""; - string IdxMacchina = ""; - int numPezzi = 0; - int pzPallet = 1; - decimal TCiclo = 0; - - try - { - CodArticolo = ddlArticolo.SelectedValue; - IdxMacchina = ddlMacchine.SelectedValue; - //IdxMacchina = txtMacchina.Text.Trim(); - // se IdxMacchina è vuoto metto null... - if (IdxMacchina == "") + protected void Page_Load(object sender, EventArgs e) { - IdxMacchina = "0"; - } - numPezzi = Convert.ToInt32(txtPezzi.Text.Trim()); - TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ",")); - pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim()); - DataLayerObj.taODL.InsertQuery(CodArticolo, DataLayerObj.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim()); - } - catch - { - logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire l'ODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4}", CodArticolo, IdxMacchina, numPezzi, TCiclo, pzPallet), tipoLog.ERROR); - } - // segnalo update - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - /// - /// annullamento inserimento - /// - /// - /// - protected void btnCancel_Click(object sender, EventArgs e) - { - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - /// - /// aggiorno label min e centesimi - /// - /// - /// - protected void txtTempoCiclo_TextChanged(object sender, EventArgs e) - { - string text = ""; - string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ","); - int min = 0; - int sec = 0; - try - { - // cerco di convertire in min/sec - min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent))); - sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60); - text = string.Format("{0}:{1:00}", min, sec); - } - catch - { } - lblMinSec.Text = text; - } - /// - /// selezione articolo - /// - /// - /// - protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e) - { - showLastTimeAndNote(); - } - /// - /// mostro elenco ultimi 5 tempi e note... - /// - private void showLastTimeAndNote() - { - // update tempi ciclo! - grViewTempi.DataBind(); - } - /// - /// selezione impianto - /// - /// - /// - protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e) - { - showLastTimeAndNote(); - } - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); + } + + #region gestione eventi + + public event EventHandler eh_nuovoValore; + + #endregion + + /// + /// conferma inserimento TC + /// + /// + /// + protected void btnOk_Click(object sender, EventArgs e) + { + // controllo se ho tutti i valori ok... + string CodArticolo = ""; + string IdxMacchina = ""; + int numPezzi = 0; + int pzPallet = 1; + decimal TCiclo = 0; + + try + { + CodArticolo = ddlArticolo.SelectedValue; + IdxMacchina = ddlMacchine.SelectedValue; + //IdxMacchina = txtMacchina.Text.Trim(); + // se IdxMacchina è vuoto metto null... + if (IdxMacchina == "") + { + IdxMacchina = "0"; + } + numPezzi = Convert.ToInt32(txtPezzi.Text.Trim()); + TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ",")); + pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim()); + DataLayerObj.taODL.InsertQuery(CodArticolo, DataLayerObj.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim()); + } + catch + { + logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire l'ODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4}", CodArticolo, IdxMacchina, numPezzi, TCiclo, pzPallet), tipoLog.ERROR); + } + // segnalo update + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } + } + /// + /// annullamento inserimento + /// + /// + /// + protected void btnCancel_Click(object sender, EventArgs e) + { + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } + } + /// + /// aggiorno label min e centesimi + /// + /// + /// + protected void txtTempoCiclo_TextChanged(object sender, EventArgs e) + { + string text = ""; + string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ","); + int min = 0; + int sec = 0; + try + { + // cerco di convertire in min/sec + min = Convert.ToInt32(Math.Floor(Convert.ToDouble(txtMinCent))); + sec = Convert.ToInt32((Convert.ToDouble(txtMinCent) - min) * 60); + text = string.Format("{0}:{1:00}", min, sec); + } + catch + { } + lblMinSec.Text = text; + } + /// + /// selezione articolo + /// + /// + /// + protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e) + { + showLastTimeAndNote(); + } + /// + /// mostro elenco ultimi 5 tempi e note... + /// + private void showLastTimeAndNote() + { + // update tempi ciclo! + grViewTempi.DataBind(); + } + /// + /// selezione impianto + /// + /// + /// + protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e) + { + showLastTimeAndNote(); + } + + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grViewTempi.SelectedIndex = -1; + grViewTempi.DataBind(); + } + /// + /// evento selezione riga: salvo tempo e qta nei campi input... + /// + /// + /// + protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e) + { + // ricavo i dati selezionati + int idxOdl = 0; + try + { + idxOdl = Convert.ToInt32(grViewTempi.SelectedValue); + } + catch + { } + MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; + // precompilo dati pezzi/tempi + txtPezzi.Text = rigaOdl.NumPezzi.ToString(); + txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00"); + txtPzPallet.Text = rigaOdl.PzPallet.ToString(); + } } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - grViewTempi.SelectedIndex = -1; - grViewTempi.DataBind(); - } - /// - /// evento selezione riga: salvo tempo e qta nei campi input... - /// - /// - /// - protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e) - { - // ricavo i dati selezionati - int idxOdl = 0; - try - { - idxOdl = Convert.ToInt32(grViewTempi.SelectedValue); - } - catch - { } - MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; - // precompilo dati pezzi/tempi - txtPezzi.Text = rigaOdl.NumPezzi.ToString(); - txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00"); - txtPzPallet.Text = rigaOdl.PzPallet.ToString(); - } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_newOdl.ascx.designer.cs b/MP-ADM/WebUserControls/mod_newOdl.ascx.designer.cs index 4481a233..efa228e9 100644 --- a/MP-ADM/WebUserControls/mod_newOdl.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_newOdl.ascx.designer.cs @@ -1,177 +1,178 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_newOdl { - + public partial class mod_newOdl + { + /// - /// ddlArticolo control. + /// Controllo ddlArticolo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.DropDownList ddlArticolo; - + /// - /// odsArticoli control. + /// Controllo odsArticoli. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource odsArticoli; - + /// - /// ddlMacchine control. + /// Controllo ddlMacchine. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.DropDownList ddlMacchine; - + /// - /// odsMacchine control. + /// Controllo odsMacchine. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource odsMacchine; - + /// - /// txtPezzi control. + /// Controllo txtPezzi. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.TextBox txtPezzi; - + /// - /// rfvPezzi control. + /// Controllo rfvPezzi. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPezzi; - + /// - /// chkToAs400 control. + /// Controllo chkToAs400. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.CheckBox chkToAs400; - + /// - /// txtTempoCiclo control. + /// Controllo txtTempoCiclo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.TextBox txtTempoCiclo; - + /// - /// lblMinSec control. + /// Controllo lblMinSec. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblMinSec; - + /// - /// rfvTempoCiclo control. + /// Controllo rfvTempoCiclo. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvTempoCiclo; - + /// - /// txtPzPallet control. + /// Controllo txtPzPallet. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.TextBox txtPzPallet; - + /// - /// rfvPzPallet control. + /// Controllo rfvPzPallet. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.RequiredFieldValidator rfvPzPallet; - + /// - /// txtCommessa control. + /// Controllo txtCommessa. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.TextBox txtCommessa; - + /// - /// btnOk control. + /// Controllo btnOk. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Button btnOk; - + /// - /// btnCancel control. + /// Controllo btnCancel. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Button btnCancel; - + /// - /// divTempi control. + /// Controllo divTempi. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlGenericControl divTempi; - + /// - /// grViewTempi control. + /// Controllo grViewTempi. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.GridView grViewTempi; - + /// - /// odsTempi control. + /// Controllo odsTempi. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ObjectDataSource odsTempi; } diff --git a/MP-ADM/WebUserControls/mod_newPromessaODL.ascx.cs b/MP-ADM/WebUserControls/mod_newPromessaODL.ascx.cs index 7e8a7161..6675946d 100644 --- a/MP-ADM/WebUserControls/mod_newPromessaODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_newPromessaODL.ascx.cs @@ -5,211 +5,207 @@ using System.Web.UI; namespace MP_ADM.WebUserControls { - public partial class mod_newPromessaODL : System.Web.UI.UserControl - { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - protected void Page_Load(object sender, EventArgs e) + public partial class mod_newPromessaODL : BaseUserControl { - if (!Page.IsPostBack) - { - setDefaults(); - } - } - /// - /// Testo conferma salvataggio (create/Edit) - /// - public string testoConf - { - get - { - string answ = "Crea Promessa ODL"; - if (memLayer.ML.isInSessionObject("idxProm2Edit")) + protected void Page_Load(object sender, EventArgs e) { - answ = "Edit Promessa ODL"; + if (!Page.IsPostBack) + { + setDefaults(); + } } - return answ; - } - } - public void doSelPODL() - { - // se ho una promessa da clonare copio dati da quella... - int idxProm = 0; - try - { - if (memLayer.ML.isInSessionObject("idxProm2Clone")) + /// + /// Testo conferma salvataggio (create/Edit) + /// + public string testoConf { - idxProm = memLayer.ML.IntSessionObj("idxProm2Clone"); + get + { + string answ = "Crea Promessa ODL"; + if (memLayer.ML.isInSessionObject("idxProm2Edit")) + { + answ = "Edit Promessa ODL"; + } + return answ; + } } - else if (memLayer.ML.isInSessionObject("idxProm2Edit")) + public void doSelPODL() { - idxProm = memLayer.ML.IntSessionObj("idxProm2Edit"); + // se ho una promessa da clonare copio dati da quella... + int idxProm = 0; + try + { + if (memLayer.ML.isInSessionObject("idxProm2Clone")) + { + idxProm = memLayer.ML.IntSessionObj("idxProm2Clone"); + } + else if (memLayer.ML.isInSessionObject("idxProm2Edit")) + { + idxProm = memLayer.ML.IntSessionObj("idxProm2Edit"); + } + // provo a selezionare + var tPODL = DataLayerObj.taPODL.getByKey(idxProm); + if (tPODL.Rows.Count > 0) + { + var rPODL = tPODL[0]; + txtSearch.Text = rPODL.CodArticolo; + ddlArticolo.DataBind(); + ddlArticolo.SelectedValue = rPODL.CodArticolo; + ddlGruppi.DataBind(); + ddlGruppi.SelectedValue = rPODL.CodGruppo; + txtNumPz.Text = rPODL.NumPezzi.ToString(); + txtPzPallet.Text = rPODL.PzPallet.ToString(); + txtPrio.Text = rPODL.Priorita.ToString(); + if (memLayer.ML.cdvb("ADM_TC_MinSec")) + { + txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato); + } + else + { + txtTCmc.Text = rPODL.TCAssegnato.ToString("N3"); + } + ddlMacchine.SelectedValue = rPODL.IdxMacchina; + txtKeyExt.Text = rPODL.KeyRichiesta; + // svuoto se ci fosse cloning...... + memLayer.ML.emptySessionVal("idxProm2Clone"); + } + } + catch + { } } - // provo a selezionare - var tPODL = DataLayerObj.taPODL.getByKey(idxProm); - if (tPODL.Rows.Count > 0) - { - var rPODL = tPODL[0]; - txtSearch.Text = rPODL.CodArticolo; - ddlArticolo.DataBind(); - ddlArticolo.SelectedValue = rPODL.CodArticolo; - ddlGruppi.DataBind(); - ddlGruppi.SelectedValue = rPODL.CodGruppo; - txtNumPz.Text = rPODL.NumPezzi.ToString(); - txtPzPallet.Text = rPODL.PzPallet.ToString(); - txtPrio.Text = rPODL.Priorita.ToString(); - if (memLayer.ML.cdvb("ADM_TC_MinSec")) - { - txtTCms.Text = TempiCiclo.minSec(rPODL.TCAssegnato); - } - else - { - txtTCmc.Text = rPODL.TCAssegnato.ToString("N3"); - } - ddlMacchine.SelectedValue = rPODL.IdxMacchina; - txtKeyExt.Text = rPODL.KeyRichiesta; - // svuoto se ci fosse cloning...... - memLayer.ML.emptySessionVal("idxProm2Clone"); - } - } - catch - { } - } - private void setDefaults() - { - // se abilitato in config inserisce i valori defaults x insert... - if (memLayer.ML.cdvb("resetDefaultPromessaOdl")) - { - txtNumPz.Text = "1"; - txtPzPallet.Text = "1"; - txtPrio.Text = "1"; - // in base ad impostazione mostro TC come min:sec o min.cent - divTCms.Visible = false; - divTCmc.Visible = false; - if (memLayer.ML.cdvb("ADM_TC_MinSec")) + private void setDefaults() { - divTCms.Visible = true; - txtTCms.Text = "1:00"; + // se abilitato in config inserisce i valori defaults x insert... + if (memLayer.ML.cdvb("resetDefaultPromessaOdl")) + { + txtNumPz.Text = "1"; + txtPzPallet.Text = "1"; + txtPrio.Text = "1"; + // in base ad impostazione mostro TC come min:sec o min.cent + divTCms.Visible = false; + divTCmc.Visible = false; + if (memLayer.ML.cdvb("ADM_TC_MinSec")) + { + divTCms.Visible = true; + txtTCms.Text = "1:00"; + } + else + { + divTCmc.Visible = true; + txtTCmc.Text = "1.00"; + } + memLayer.ML.emptySessionVal("idxProm2Clone"); + memLayer.ML.emptySessionVal("idxProm2Edit"); + } } - else + + protected void txtSearch_TextChanged(object sender, EventArgs e) { - divTCmc.Visible = true; - txtTCmc.Text = "1.00"; + ddlArticolo.DataBind(); } - memLayer.ML.emptySessionVal("idxProm2Clone"); - memLayer.ML.emptySessionVal("idxProm2Edit"); - } - } - protected void txtSearch_TextChanged(object sender, EventArgs e) - { - ddlArticolo.DataBind(); - } + #region gestione eventi - #region gestione eventi + public event EventHandler eh_nuovoValore; - public event EventHandler eh_nuovoValore; + #endregion - #endregion - - /// - /// conferma inserimento TC - /// - /// - /// - protected void btnOk_Click(object sender, EventArgs e) - { - // controllo se ho tutti i valori ok... - string CodArticolo = ""; - string Gruppo = ""; - string IdxMacchina = ""; - string KeyReq = ""; - int numPezzi = 0; - int pzPallet = 1; - decimal TCiclo = 0; - bool attiv = false; - int prio = 0; - - try - { - CodArticolo = ddlArticolo.SelectedValue; - Gruppo = ddlGruppi.SelectedValue; - IdxMacchina = ddlMacchine.SelectedValue; - KeyReq = txtKeyExt.Text.Trim(); - //IdxMacchina = txtMacchina.Text.Trim(); - // se IdxMacchina è vuoto metto null... - if (IdxMacchina == "") + /// + /// conferma inserimento TC + /// + /// + /// + protected void btnOk_Click(object sender, EventArgs e) { - IdxMacchina = "0"; - } - numPezzi = Convert.ToInt32(txtNumPz.Text.Trim()); + // controllo se ho tutti i valori ok... + string CodArticolo = ""; + string Gruppo = ""; + string IdxMacchina = ""; + string KeyReq = ""; + int numPezzi = 0; + int pzPallet = 1; + decimal TCiclo = 0; + bool attiv = false; + int prio = 0; - if (memLayer.ML.cdvb("ADM_TC_MinSec")) - { - string[] sTC = txtTCms.Text.Trim().Split(':'); - int numMin = 0; - int numSec = 0; - int.TryParse(sTC[0], out numMin); - int.TryParse(sTC[1], out numSec); - TCiclo = numMin + ((decimal)numSec) / 60; - } - else - { - decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo); - } - pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim()); - attiv = chkAttiv.Checked; - int.TryParse(txtPrio.Text, out prio); + try + { + CodArticolo = ddlArticolo.SelectedValue; + Gruppo = ddlGruppi.SelectedValue; + IdxMacchina = ddlMacchine.SelectedValue; + KeyReq = txtKeyExt.Text.Trim(); + //IdxMacchina = txtMacchina.Text.Trim(); + // se IdxMacchina è vuoto metto null... + if (IdxMacchina == "") + { + IdxMacchina = "0"; + } + numPezzi = Convert.ToInt32(txtNumPz.Text.Trim()); - // controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT... - if (memLayer.ML.isInSessionObject("idxProm2Edit")) - { - int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit"); - DataLayerObj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm); - memLayer.ML.emptySessionVal("idxProm2Edit"); + if (memLayer.ML.cdvb("ADM_TC_MinSec")) + { + string[] sTC = txtTCms.Text.Trim().Split(':'); + int numMin = 0; + int numSec = 0; + int.TryParse(sTC[0], out numMin); + int.TryParse(sTC[1], out numSec); + TCiclo = numMin + ((decimal)numSec) / 60; + } + else + { + decimal.TryParse(txtTCmc.Text.Replace(".", ","), out TCiclo); + } + pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim()); + attiv = chkAttiv.Checked; + int.TryParse(txtPrio.Text, out prio); + + // controllo se sono in modalità EDIT faccio un update, altrimenti faccio un INSERT... + if (memLayer.ML.isInSessionObject("idxProm2Edit")) + { + int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit"); + DataLayerObj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm); + memLayer.ML.emptySessionVal("idxProm2Edit"); + } + else + { + // 2018.09.25 --> inserisco PROMESSA ODL + //MapoDb.DataLayerObj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim()); + DataLayerObj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, ""); + } + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION); + memLayer.ML.emptySessionVal("idxProm2Edit"); + } + // segnalo update + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } } - else + /// + /// annullamento inserimento + /// + /// + /// + protected void btnCancel_Click(object sender, EventArgs e) { - // 2018.09.25 --> inserisco PROMESSA ODL - //MapoDb.DataLayerObj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim()); - DataLayerObj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, ""); + memLayer.ML.emptySessionVal("idxProm2Clone"); + memLayer.ML.emptySessionVal("idxProm2Edit"); + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } } - } - catch (Exception exc) - { - logger.lg.scriviLog(string.Format("Non sono riuscito ad inserire la PromessaODL con i seguenti parametri: {0} | {1} | {2} | {3} | {4} | {5} | {6} | {7} | {8}{9}{10}", KeyReq, attiv, CodArticolo, IdxMacchina, numPezzi, TCiclo, prio, pzPallet, memLayer.ML.IntSessionObj("idxProm2Edit"), Environment.NewLine, exc), tipoLog.EXCEPTION); - memLayer.ML.emptySessionVal("idxProm2Edit"); - } - // segnalo update - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - /// - /// annullamento inserimento - /// - /// - /// - protected void btnCancel_Click(object sender, EventArgs e) - { - memLayer.ML.emptySessionVal("idxProm2Clone"); - memLayer.ML.emptySessionVal("idxProm2Edit"); - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } - } - /// - /// aggiorno label min e centesimi - /// - /// - /// - protected void txtTempoCiclo_TextChanged(object sender, EventArgs e) - { + /// + /// aggiorno label min e centesimi + /// + /// + /// + protected void txtTempoCiclo_TextChanged(object sender, EventArgs e) + { #if false string text = ""; string txtMinCent = txtTempoCiclo.Text.Trim().Replace(".", ","); @@ -226,87 +222,87 @@ namespace MP_ADM.WebUserControls { } lblMinSec.Text = text; #endif - } - /// - /// selezione articolo - /// - /// - /// - protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e) - { - showLastTimeAndNote(); - } - /// - /// mostro elenco ultimi 5 tempi e note... - /// - private void showLastTimeAndNote() - { - // update tempi ciclo! - grViewTempi.DataBind(); - } - /// - /// selezione impianto - /// - /// - /// - protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e) - { - showLastTimeAndNote(); - } - /// - /// selezione impianto - /// - /// - /// - protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e) - { - ddlMacchine.DataBind(); - } + } + /// + /// selezione articolo + /// + /// + /// + protected void ddlArticolo_SelectedIndexChanged(object sender, EventArgs e) + { + showLastTimeAndNote(); + } + /// + /// mostro elenco ultimi 5 tempi e note... + /// + private void showLastTimeAndNote() + { + // update tempi ciclo! + grViewTempi.DataBind(); + } + /// + /// selezione impianto + /// + /// + /// + protected void ddlMacchine_SelectedIndexChanged(object sender, EventArgs e) + { + showLastTimeAndNote(); + } + /// + /// selezione impianto + /// + /// + /// + protected void ddlGruppi_SelectedIndexChanged(object sender, EventArgs e) + { + ddlMacchine.DataBind(); + } - /// - /// reset della selezione - /// - /// - /// - protected void btnReset_Click(object sender, EventArgs e) - { - resetSelezione(); + /// + /// reset della selezione + /// + /// + /// + protected void btnReset_Click(object sender, EventArgs e) + { + resetSelezione(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grViewTempi.SelectedIndex = -1; + grViewTempi.DataBind(); + } + /// + /// evento selezione riga: salvo tempo e qta nei campi input... + /// + /// + /// + protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e) + { + // ricavo i dati selezionati + int idxOdl = 0; + try + { + idxOdl = Convert.ToInt32(grViewTempi.SelectedValue); + } + catch + { } + DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; + // precompilo dati pezzi/tempi + txtNumPz.Text = rigaOdl.NumPezzi.ToString(); + if (memLayer.ML.cdvb("ADM_TC_MinSec")) + { + txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato); + } + else + { + txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3"); + } + txtPzPallet.Text = rigaOdl.PzPallet.ToString(); + } } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - grViewTempi.SelectedIndex = -1; - grViewTempi.DataBind(); - } - /// - /// evento selezione riga: salvo tempo e qta nei campi input... - /// - /// - /// - protected void grViewTempi_SelectedIndexChanged(object sender, EventArgs e) - { - // ricavo i dati selezionati - int idxOdl = 0; - try - { - idxOdl = Convert.ToInt32(grViewTempi.SelectedValue); - } - catch - { } - DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0]; - // precompilo dati pezzi/tempi - txtNumPz.Text = rigaOdl.NumPezzi.ToString(); - if (memLayer.ML.cdvb("ADM_TC_MinSec")) - { - txtTCms.Text = TempiCiclo.minSec(rigaOdl.TCAssegnato); - } - else - { - txtTCmc.Text = rigaOdl.TCAssegnato.ToString("N3"); - } - txtPzPallet.Text = rigaOdl.PzPallet.ToString(); - } - } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_ricercaGenerica.ascx.cs b/MP-ADM/WebUserControls/mod_ricercaGenerica.ascx.cs index c1e2a038..b3fea8d2 100644 --- a/MP-ADM/WebUserControls/mod_ricercaGenerica.ascx.cs +++ b/MP-ADM/WebUserControls/mod_ricercaGenerica.ascx.cs @@ -67,12 +67,12 @@ public partial class mod_ricercaGenerica : ApplicationUserControl { if (testoRicerca == "") { - SteamWare.memLayer.ML.emptySessionVal("valoreCercato"); - SteamWare.memLayer.ML.emptySessionVal("listaMatricoleSearch"); + memLayer.ML.emptySessionVal("valoreCercato"); + memLayer.ML.emptySessionVal("listaMatricoleSearch"); } else { - SteamWare.memLayer.ML.setSessionVal("valoreCercato", testoRicerca); + memLayer.ML.setSessionVal("valoreCercato", testoRicerca); // verifico ricerche accessorie if (_cercaMatricole) { @@ -105,7 +105,7 @@ public partial class mod_ricercaGenerica : ApplicationUserControl { listaMatricoleSearch = listaMatricoleSearch.Remove(listaMatricoleSearch.Length - 2); } - SteamWare.memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch); + memLayer.ML.setSessionVal("listaMatricoleSearch", listaMatricoleSearch); } /// /// ricerca utenti e salva lista username x SQL IN @@ -123,7 +123,7 @@ public partial class mod_ricercaGenerica : ApplicationUserControl { listaUsernameSearch = listaUsernameSearch.Remove(listaUsernameSearch.Length - 2); } - SteamWare.memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch); + memLayer.ML.setSessionVal("listaUsernameSearch", listaUsernameSearch); } #endregion @@ -135,9 +135,9 @@ public partial class mod_ricercaGenerica : ApplicationUserControl /// public void updateText() { - if (SteamWare.memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack) + if (memLayer.ML.StringSessionObj("valoreCercato") != "" && !Page.IsPostBack) { - testoRicerca = SteamWare.memLayer.ML.StringSessionObj("valoreCercato"); + testoRicerca = memLayer.ML.StringSessionObj("valoreCercato"); } } diff --git a/MP-ADM/WebUserControls/mod_storicoTC.ascx.cs b/MP-ADM/WebUserControls/mod_storicoTC.ascx.cs index 9ee9c919..2e383fe2 100644 --- a/MP-ADM/WebUserControls/mod_storicoTC.ascx.cs +++ b/MP-ADM/WebUserControls/mod_storicoTC.ascx.cs @@ -3,7 +3,7 @@ using System.Web.UI; namespace MP_ADM.WebUserControls { - public partial class mod_storicoTC : System.Web.UI.UserControl + public partial class mod_storicoTC : BaseUserControl { protected void Page_Load(object sender, EventArgs e) { diff --git a/MP-ADM/WebUserControls/mod_unauthorized.ascx b/MP-ADM/WebUserControls/mod_unauthorized.ascx index a28b35cd..c02f3fda 100644 --- a/MP-ADM/WebUserControls/mod_unauthorized.ascx +++ b/MP-ADM/WebUserControls/mod_unauthorized.ascx @@ -1,16 +1,13 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="MoonPro_site.WebUserControls.mod_unauthorized" Codebehind="mod_unauthorized.ascx.cs" %> -
- - - - - - - - - -
- -
-
-
+<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_unauthorized" CodeBehind="mod_unauthorized.ascx.cs" %> + +
+
+ +
+
+ +
+
+ +
+
diff --git a/MP-ADM/WebUserControls/mod_unauthorized.ascx.cs b/MP-ADM/WebUserControls/mod_unauthorized.ascx.cs index 511b8989..edbcf7d8 100644 --- a/MP-ADM/WebUserControls/mod_unauthorized.ascx.cs +++ b/MP-ADM/WebUserControls/mod_unauthorized.ascx.cs @@ -1,14 +1,15 @@ +using MP_ADM; using SteamWare; using System; -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_unauthorized : System.Web.UI.UserControl + public partial class mod_unauthorized : BaseUserControl { protected void Page_Load(object sender, EventArgs e) { - lblTitle.Text = user_std.UtSn.Traduci("NonDisponibile"); - lblMess.Text = user_std.UtSn.Traduci("NonAuth"); + lblTitle.Text = traduci("NonDisponibile"); + lblMess.Text = traduci("NonAuth"); } } } \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_unauthorized.ascx.designer.cs b/MP-ADM/WebUserControls/mod_unauthorized.ascx.designer.cs index 91966c1b..fac1f4a3 100644 --- a/MP-ADM/WebUserControls/mod_unauthorized.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_unauthorized.ascx.designer.cs @@ -1,43 +1,43 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -namespace MoonPro_site.WebUserControls +namespace MP_ADM.WebUserControls { - public partial class mod_unauthorized { - + public partial class mod_unauthorized + { + /// - /// lblTitleMain control. + /// Controllo lblTitleMain. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblTitleMain; - + /// - /// lblTitle control. + /// Controllo lblTitle. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblTitle; - + /// - /// lblMess control. + /// Controllo lblMess. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.Label lblMess; } diff --git a/MP-ADM/approvazioneODL.aspx.cs b/MP-ADM/approvazioneODL.aspx.cs index 7f861c96..74a36356 100644 --- a/MP-ADM/approvazioneODL.aspx.cs +++ b/MP-ADM/approvazioneODL.aspx.cs @@ -3,22 +3,22 @@ using System; namespace MP_ADM { - public partial class approvazioneODL : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) + public partial class approvazioneODL : BasePage { - checkEnabled(); + protected void Page_Load(object sender, EventArgs e) + { + checkEnabled(); + } + private void checkEnabled() + { + bool optPar = memLayer.ML.CRB("OptAdmApprTempiEnabled"); + divContent.Visible = optPar; + string messaggio = ""; + if (!optPar) + { + messaggio = "Attenzione: gestione approvazione cambio TC disabilitata"; + } + lblDataImportOut.Text = messaggio; + } } - private void checkEnabled() - { - bool optPar = memLayer.ML.CRB("OptAdmApprTempiEnabled"); - divContent.Visible = optPar; - string messaggio = ""; - if (!optPar) - { - messaggio = "Attenzione: gestione approvazione cambio TC disabilitata"; - } - lblDataImportOut.Text = messaggio; - } - } } \ No newline at end of file diff --git a/MP-ADM/approvazioneODL.aspx.designer.cs b/MP-ADM/approvazioneODL.aspx.designer.cs index eae322aa..f43c2f8f 100644 --- a/MP-ADM/approvazioneODL.aspx.designer.cs +++ b/MP-ADM/approvazioneODL.aspx.designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ // // Codice generato da uno strumento. // diff --git a/MP-ADM/calendChiusura.aspx b/MP-ADM/calendChiusura.aspx index 309672d2..c0a77063 100644 --- a/MP-ADM/calendChiusura.aspx +++ b/MP-ADM/calendChiusura.aspx @@ -5,7 +5,7 @@ <%@ Register Src="~/WebUserControls/mod_fixCal.ascx" tagname="mod_fixCal" tagprefix="uc2" %> - + diff --git a/MP-ADM/calendChiusura.aspx.designer.cs b/MP-ADM/calendChiusura.aspx.designer.cs index 9bed917b..33605727 100644 --- a/MP-ADM/calendChiusura.aspx.designer.cs +++ b/MP-ADM/calendChiusura.aspx.designer.cs @@ -9,17 +9,18 @@ -public partial class calendChiusura { - +public partial class calendChiusura +{ + /// - /// Controllo mod_fixCal1. + /// Controllo mod_fixCal. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::mod_fixCal mod_fixCal1; - + protected global::mod_fixCal mod_fixCal; + /// /// Controllo mod_calChiusura1. /// From 24e78dd99a11b08392fcee151e3ccaf63fafa5c6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 10 Sep 2020 19:20:12 +0200 Subject: [PATCH 8/9] Ancora fix namespaces vari --- MP-ADM/WebMasterPages/AjaxSimple.master | 5 +- MP-ADM/WebMasterPages/AjaxSimple.master.cs | 11 +- .../AjaxSimple.master.designer.cs | 47 ++-- MP-ADM/WebMasterPages/Bootstrap.Master.cs | 8 +- MP-ADM/WebMasterPages/MoonPro.master | 132 +++++----- MP-ADM/WebMasterPages/MoonPro.master.cs | 54 ++-- .../WebMasterPages/MoonPro.master.designer.cs | 29 +-- MP-ADM/WebUserControls/mod_calChiusura.ascx | 2 +- .../WebUserControls/mod_calChiusura.ascx.cs | 215 ++++++++-------- .../mod_calChiusura.ascx.designer.cs | 232 +++++++++--------- MP-ADM/WebUserControls/mod_fixCal.ascx | 2 +- .../mod_fixCal.ascx.designer.cs | 27 +- .../WebUserControls/mod_gestioneODL.ascx.cs | 19 +- MP-ADM/WebUserControls/mod_menuBottom.ascx | 2 +- MP-ADM/calendChiusura.aspx | 12 +- MP-ADM/calendChiusura.aspx.designer.cs | 41 ++-- 16 files changed, 418 insertions(+), 420 deletions(-) diff --git a/MP-ADM/WebMasterPages/AjaxSimple.master b/MP-ADM/WebMasterPages/AjaxSimple.master index f82afa17..6edbcedc 100644 --- a/MP-ADM/WebMasterPages/AjaxSimple.master +++ b/MP-ADM/WebMasterPages/AjaxSimple.master @@ -1,7 +1,8 @@ <%@ Master Language="C#" AutoEventWireup="True" Inherits="AjaxSimple" CodeBehind="AjaxSimple.master.cs" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> -<%@ Register Src="~/WebUserControls/mod_menuBottom.ascx" TagName="mod_menuBottom" TagPrefix="uc1" %> +<%@ Register Src="~/WebUserControls/mod_menuBottom.ascx" TagPrefix="uc1" TagName="mod_menuBottom" %> + @@ -28,7 +29,7 @@ - + diff --git a/MP-ADM/WebMasterPages/AjaxSimple.master.cs b/MP-ADM/WebMasterPages/AjaxSimple.master.cs index bc961687..eb2d6baf 100644 --- a/MP-ADM/WebMasterPages/AjaxSimple.master.cs +++ b/MP-ADM/WebMasterPages/AjaxSimple.master.cs @@ -1,11 +1,12 @@ +using SteamWare; using System; using System.Web.UI; public partial class AjaxSimple : System.Web.UI.MasterPage { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - Page.Title = memLayer.ML.CRS("_titoloPagina"); - } + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + Page.Title = memLayer.ML.CRS("_titoloPagina"); + } } diff --git a/MP-ADM/WebMasterPages/AjaxSimple.master.designer.cs b/MP-ADM/WebMasterPages/AjaxSimple.master.designer.cs index 263fe0fc..2688230b 100644 --- a/MP-ADM/WebMasterPages/AjaxSimple.master.designer.cs +++ b/MP-ADM/WebMasterPages/AjaxSimple.master.designer.cs @@ -1,49 +1,50 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ -public partial class AjaxSimple { - +public partial class AjaxSimple +{ + /// - /// form1 control. + /// Controllo form1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// - /// sm control. + /// Controllo sm. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.ScriptManager sm; - + /// - /// ContentPlaceHolder1 control. + /// Controllo ContentPlaceHolder1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1; - + /// - /// Mod_menuBottom1 control. + /// Controllo mod_menuBottom. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::mod_menuBottom Mod_menuBottom1; + protected global::MP_ADM.WebUserControls.mod_menuBottom mod_menuBottom; } diff --git a/MP-ADM/WebMasterPages/Bootstrap.Master.cs b/MP-ADM/WebMasterPages/Bootstrap.Master.cs index 6cc7a31a..1c1b2820 100644 --- a/MP-ADM/WebMasterPages/Bootstrap.Master.cs +++ b/MP-ADM/WebMasterPages/Bootstrap.Master.cs @@ -2,11 +2,11 @@ namespace MP_ADM.WebMasterPages { - public partial class Bootstrap : System.Web.UI.MasterPage - { - protected void Page_Load(object sender, EventArgs e) + public partial class Bootstrap : System.Web.UI.MasterPage { + protected void Page_Load(object sender, EventArgs e) + { + } } - } } \ No newline at end of file diff --git a/MP-ADM/WebMasterPages/MoonPro.master b/MP-ADM/WebMasterPages/MoonPro.master index 15b8d8fc..ad8ff638 100644 --- a/MP-ADM/WebMasterPages/MoonPro.master +++ b/MP-ADM/WebMasterPages/MoonPro.master @@ -3,82 +3,82 @@ <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%@ Register Src="~/WebUserControls/mod_menuTop.ascx" TagName="mod_menuTop" TagPrefix="uc1" %> <%@ Register Src="~/WebUserControls/mod_pageTitleAndSearch.ascx" TagName="mod_pageTitleAndSearch" - TagPrefix="uc3" %> + TagPrefix="uc3" %> <%@ Register Src="~/WebUserControls/mod_ricercaGenerica.ascx" TagName="mod_ricercaGenerica" - TagPrefix="uc4" %> + TagPrefix="uc4" %> <%@ Register Src="~/WebUserControls/mod_menuBottom.ascx" TagName="mod_menuBottom" - TagPrefix="uc5" %> + TagPrefix="uc5" %> - MP-ADM: <%: SteamWare.devicesAuthProxy.getPage(Request.Url) %> - - - - - - - - - + MP-ADM: <%: SteamWare.devicesAuthProxy.getPage(Request.Url) %> + + + + + + + + + - <%-- - --%> - - <%: Scripts.Render("~/bundles/jquery") %> - <%: Scripts.Render("~/bundles/jqueryui") %> - - - + <%-- + --%> + + <%: Scripts.Render("~/bundles/jquery") %> + <%: Scripts.Render("~/bundles/jqueryui") %> + + + -
- - - <%--Framework Scripts--%> - - - - - - - - - - - <%--Site Scripts--%> - - - <%-- + + + + <%--Framework Scripts--%> + + + + + + + + + + + <%--Site Scripts--%> + + + <%-- --%> - -
-
-
- - -
-
-
-
- -
-
- -
-
+ +
+
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+ + +
+
+
+
-
- - -
-
- - +
-
-
- - + + diff --git a/MP-ADM/WebMasterPages/MoonPro.master.cs b/MP-ADM/WebMasterPages/MoonPro.master.cs index b45e1963..9fadd0a2 100644 --- a/MP-ADM/WebMasterPages/MoonPro.master.cs +++ b/MP-ADM/WebMasterPages/MoonPro.master.cs @@ -3,37 +3,37 @@ using System; public partial class MoonPro : System.Web.UI.MasterPage { - protected void Page_Load(object sender, EventArgs e) - { - } - protected string _mainCssClass; - /// - /// classe css area BODY - /// - public string mainCssClass - { - get + protected void Page_Load(object sender, EventArgs e) { - return _mainCssClass; } - set + protected string _mainCssClass; + /// + /// classe css area BODY + /// + public string mainCssClass { - _mainCssClass = value; + get + { + return _mainCssClass; + } + set + { + _mainCssClass = value; + } } - } - protected string _headCssClass; - /// - /// classe css area HEADER - /// - public string headCssClass - { - get + protected string _headCssClass; + /// + /// classe css area HEADER + /// + public string headCssClass { - return _headCssClass; + get + { + return _headCssClass; + } + set + { + _headCssClass = value; + } } - set - { - _headCssClass = value; - } - } } diff --git a/MP-ADM/WebMasterPages/MoonPro.master.designer.cs b/MP-ADM/WebMasterPages/MoonPro.master.designer.cs index e9d3c276..cc9cc78c 100644 --- a/MP-ADM/WebMasterPages/MoonPro.master.designer.cs +++ b/MP-ADM/WebMasterPages/MoonPro.master.designer.cs @@ -9,8 +9,9 @@ -public partial class MoonPro { - +public partial class MoonPro +{ + /// /// Controllo PlaceHolder1. /// @@ -19,7 +20,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.PlaceHolder PlaceHolder1; - + /// /// Controllo BundleReference2. /// @@ -28,7 +29,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2; - + /// /// Controllo BundleReference1. /// @@ -37,7 +38,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; - + /// /// Controllo form1. /// @@ -46,7 +47,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// Controllo ScriptManager1. /// @@ -55,7 +56,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.ScriptManager ScriptManager1; - + /// /// Controllo Mod_menuTop1. /// @@ -64,7 +65,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::MP_ADM.WebUserControls.mod_menuTop Mod_menuTop1; - + /// /// Controllo UpdatePanel1. /// @@ -73,7 +74,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.UpdatePanel UpdatePanel1; - + /// /// Controllo Mod_pageTitleAndSearch1. /// @@ -82,7 +83,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::mod_pageTitleAndSearch Mod_pageTitleAndSearch1; - + /// /// Controllo Mod_ricercaGenerica1. /// @@ -91,7 +92,7 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::mod_ricercaGenerica Mod_ricercaGenerica1; - + /// /// Controllo ContentPlaceHolder1. /// @@ -100,13 +101,13 @@ public partial class MoonPro { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1; - + /// - /// Controllo Mod_menuBottom1. + /// Controllo mod_menuBottom. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::mod_menuBottom Mod_menuBottom1; + protected global::MP_ADM.WebUserControls.mod_menuBottom mod_menuBottom; } diff --git a/MP-ADM/WebUserControls/mod_calChiusura.ascx b/MP-ADM/WebUserControls/mod_calChiusura.ascx index 2a1b4b4a..67b8b668 100644 --- a/MP-ADM/WebUserControls/mod_calChiusura.ascx +++ b/MP-ADM/WebUserControls/mod_calChiusura.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" - Inherits="mod_calChiusura" CodeBehind="mod_calChiusura.ascx.cs" %> + Inherits="MP_ADM.WebUserControls.mod_calChiusura" CodeBehind="mod_calChiusura.ascx.cs" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> diff --git a/MP-ADM/WebUserControls/mod_calChiusura.ascx.cs b/MP-ADM/WebUserControls/mod_calChiusura.ascx.cs index 67025092..f479c29c 100644 --- a/MP-ADM/WebUserControls/mod_calChiusura.ascx.cs +++ b/MP-ADM/WebUserControls/mod_calChiusura.ascx.cs @@ -4,114 +4,117 @@ using System; using System.Web.UI; using System.Web.UI.WebControls; -public partial class mod_calChiusura : ApplicationUserControl +namespace MP_ADM.WebUserControls { - /// - /// Oggetto datalayer specifico - /// - DataLayer DataLayerObj = new DataLayer(); - public event EventHandler eh_resetSelezione; + public partial class mod_calChiusura : ApplicationUserControl + { + /// + /// Oggetto datalayer specifico + /// + DataLayer DataLayerObj = new DataLayer(); + public event EventHandler eh_resetSelezione; - protected override void Page_Load(object sender, EventArgs e) - { - base.Page_Load(sender, e); - if (!Page.IsPostBack) - { - grView.PageSize = _righeDataGridMed; - btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); - btnInsPeriodo.Text = traduci("btnInsPeriodo"); - } - } - - /// - /// gestione evento inserimento nuovo record standard (se ZERO presenti) - /// - /// - /// - protected void btnNewFromEmpty_Click(object sender, EventArgs e) - { - // reset selezione... - resetSelezione(); - // i primi valori ("0") di default sono "ND"... li inserisco come standard... - DataLayerObj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --"); - grView.DataBind(); - } - /// - /// resetta la selezione dei valori in caso di modifiche su altri controlli - /// - public void resetSelezione() - { - grView.SelectedIndex = -1; - grView.DataBind(); - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } - } - /// - /// evento dati associati a controllo - /// - /// - /// - 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 + protected override void Page_Load(object sender, EventArgs e) { - lb = (LinkButton)cella.Controls[0]; - lb.Text = traduci(lb.Text); + base.Page_Load(sender, e); + if (!Page.IsPostBack) + { + grView.PageSize = _righeDataGridMed; + btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); + btnInsPeriodo.Text = traduci("btnInsPeriodo"); + } + } + + /// + /// gestione evento inserimento nuovo record standard (se ZERO presenti) + /// + /// + /// + protected void btnNewFromEmpty_Click(object sender, EventArgs e) + { + // reset selezione... + resetSelezione(); + // i primi valori ("0") di default sono "ND"... li inserisco come standard... + DataLayerObj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --"); + grView.DataBind(); + } + /// + /// resetta la selezione dei valori in caso di modifiche su altri controlli + /// + public void resetSelezione() + { + grView.SelectedIndex = -1; + grView.DataBind(); + if (eh_resetSelezione != null) + { + eh_resetSelezione(this, new EventArgs()); + } + } + /// + /// evento dati associati a controllo + /// + /// + /// + protected void grView_DataBound(object sender, EventArgs e) + { + if (grView.Rows.Count > 0) + { + LinkButton lb; + // aggiorno gli headers + foreach (TableCell cella in grView.HeaderRow.Cells) + { + try + { + lb = (LinkButton)cella.Controls[0]; + lb.Text = traduci(lb.Text); + } + catch + { } + } + int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); + lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); + } + else + { + lblNumRec.Text = ""; + } + } + protected void btnShowInsPeriodo_Click(object sender, EventArgs e) + { + pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible; + if (pnlInsPeriodo.Visible) + { + btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo"); + } + else + { + btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); + } + } + protected void btnInsPeriodo_Click(object sender, EventArgs e) + { + // verifico date congrue... + DateTime inizio = Convert.ToDateTime(txtDataFrom.Text); + DateTime fine = Convert.ToDateTime(txtDataTo.Text); + if (fine.CompareTo(inizio) >= 0) + { + // inserisco le voci x tutte le date nell'intervallo... + while (fine.CompareTo(inizio) >= 0) + { + DataLayerObj.taCalFF.Insert(inizio, txtDescrizione.Text); + inizio = inizio.AddDays(1); + } + // update e nascondo pannello + grView.DataBind(); + pnlInsPeriodo.Visible = false; + btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); + lblWarning.Visible = false; + } + else + { + lblWarning.Visible = true; + lblWarning.Text = traduci("OrdineDateErrato"); + } } - catch - { } - } - int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1); - lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord); } - else - { - lblNumRec.Text = ""; - } - } - protected void btnShowInsPeriodo_Click(object sender, EventArgs e) - { - pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible; - if (pnlInsPeriodo.Visible) - { - btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo"); - } - else - { - btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); - } - } - protected void btnInsPeriodo_Click(object sender, EventArgs e) - { - // verifico date congrue... - DateTime inizio = Convert.ToDateTime(txtDataFrom.Text); - DateTime fine = Convert.ToDateTime(txtDataTo.Text); - if (fine.CompareTo(inizio) >= 0) - { - // inserisco le voci x tutte le date nell'intervallo... - while (fine.CompareTo(inizio) >= 0) - { - DataLayerObj.taCalFF.Insert(inizio, txtDescrizione.Text); - inizio = inizio.AddDays(1); - } - // update e nascondo pannello - grView.DataBind(); - pnlInsPeriodo.Visible = false; - btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo"); - lblWarning.Visible = false; - } - else - { - lblWarning.Visible = true; - lblWarning.Text = traduci("OrdineDateErrato"); - } - } -} +} \ No newline at end of file diff --git a/MP-ADM/WebUserControls/mod_calChiusura.ascx.designer.cs b/MP-ADM/WebUserControls/mod_calChiusura.ascx.designer.cs index 8c115f5d..f3c9b5e5 100644 --- a/MP-ADM/WebUserControls/mod_calChiusura.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_calChiusura.ascx.designer.cs @@ -1,121 +1,125 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ +namespace MP_ADM.WebUserControls +{ -public partial class mod_calChiusura { - - /// - /// 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; - - /// - /// 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; - - /// - /// 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; - - /// - /// btnShowInsPeriodo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnShowInsPeriodo; - - /// - /// pnlInsPeriodo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pnlInsPeriodo; - - /// - /// txtDataFrom control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtDataFrom; - - /// - /// CalendarExtender2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::AjaxControlToolkit.CalendarExtender CalendarExtender2; - - /// - /// txtDataTo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtDataTo; - - /// - /// CalendarExtender3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::AjaxControlToolkit.CalendarExtender CalendarExtender3; - - /// - /// txtDescrizione control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtDescrizione; - - /// - /// btnInsPeriodo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnInsPeriodo; - - /// - /// 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; + public partial class mod_calChiusura + { + + /// + /// Controllo grView. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// Controllo lblNumRec. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblNumRec; + + /// + /// Controllo ods. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + + /// + /// Controllo btnShowInsPeriodo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnShowInsPeriodo; + + /// + /// Controllo pnlInsPeriodo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Panel pnlInsPeriodo; + + /// + /// Controllo txtDataFrom. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox txtDataFrom; + + /// + /// Controllo CalendarExtender2. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::AjaxControlToolkit.CalendarExtender CalendarExtender2; + + /// + /// Controllo txtDataTo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox txtDataTo; + + /// + /// Controllo CalendarExtender3. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::AjaxControlToolkit.CalendarExtender CalendarExtender3; + + /// + /// Controllo txtDescrizione. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox txtDescrizione; + + /// + /// Controllo btnInsPeriodo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Button btnInsPeriodo; + + /// + /// Controllo lblWarning. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.Label lblWarning; + } } diff --git a/MP-ADM/WebUserControls/mod_fixCal.ascx b/MP-ADM/WebUserControls/mod_fixCal.ascx index b7d3dd46..3d3a02b7 100644 --- a/MP-ADM/WebUserControls/mod_fixCal.ascx +++ b/MP-ADM/WebUserControls/mod_fixCal.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="mod_fixCal" Codebehind="mod_fixCal.ascx.cs" %> +<%@ Control Language="C#" AutoEventWireup="true" Inherits="MP_ADM.WebUserControls.mod_fixCal" Codebehind="mod_fixCal.ascx.cs" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> diff --git a/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs b/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs index 2f963c8c..24a45d8d 100644 --- a/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_fixCal.ascx.designer.cs @@ -1,36 +1,33 @@ //------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4927 +// +// Codice generato da uno strumento. // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// //------------------------------------------------------------------------------ - - namespace MP_ADM.WebUserControls { public partial class mod_fixCal { /// - /// TextBox1 control. + /// Controllo TextBox1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.TextBox TextBox1; /// - /// CalendarExtender1 control. + /// Controllo CalendarExtender1. /// /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1; } -} \ No newline at end of file +} diff --git a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs index 67710722..60ef516e 100644 --- a/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs +++ b/MP-ADM/WebUserControls/mod_gestioneODL.ascx.cs @@ -154,11 +154,7 @@ namespace MP_ADM.WebUserControls /// protected void ods_Updated(object sender, ObjectDataSourceStatusEventArgs e) { - // evento come nuovo... - if (eh_nuovoValore != null) - { - eh_nuovoValore(this, new EventArgs()); - } + raiseNewVal(); } #endregion @@ -178,24 +174,13 @@ namespace MP_ADM.WebUserControls mod_newOdl1.Visible = false; lbtNewODL.Visible = enableCreateNew; lblWarning.Visible = false; - if (eh_resetSelezione != null) - { - eh_resetSelezione(this, new EventArgs()); - } - + raiseReset(); } #endregion #endregion - #region gestione eventi - - public event EventHandler eh_resetSelezione; - public event EventHandler eh_nuovoValore; - - #endregion - #region area da modificare protected override void OnLoad(EventArgs e) diff --git a/MP-ADM/WebUserControls/mod_menuBottom.ascx b/MP-ADM/WebUserControls/mod_menuBottom.ascx index 5a5d0c25..0d65a478 100644 --- a/MP-ADM/WebUserControls/mod_menuBottom.ascx +++ b/MP-ADM/WebUserControls/mod_menuBottom.ascx @@ -1,5 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" - Inherits="mod_menuBottom" CodeBehind="mod_menuBottom.ascx.cs" %> + Inherits="MP_ADM.WebUserControls.mod_menuBottom" CodeBehind="mod_menuBottom.ascx.cs" %>