From 66b04080497da50c4a1ca149bcd382c41fe810ce Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 4 Jan 2023 14:36:17 +0100 Subject: [PATCH] Fix procedura duplicazione progetti --- .../mod_dettaglioProgetto.ascx | 40 +++++++++++++------ .../mod_dettaglioProgetto.ascx.cs | 15 +++++-- .../mod_dettaglioProgetto.ascx.designer.cs | 27 +++++++++++++ GPW_Data/DS_Applicazione.Designer.cs | 16 +++++++- GPW_Data/DS_Applicazione.xsd | 2 + GPW_Data/DS_Applicazione.xss | 38 +++++++++--------- 6 files changed, 102 insertions(+), 36 deletions(-) diff --git a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx index 0d64ce4..060d603 100644 --- a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx +++ b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx @@ -1,12 +1,12 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_dettaglioProgetto.ascx.cs" Inherits="GPW_Admin.WebUserControls.mod_dettaglioProgetto" %> - - -
-
-
Resoconto progetto
-
-
+
+
+
Resoconto progetto
+
+
+ +
@@ -91,16 +91,32 @@
+
+
+
+ - \ No newline at end of file + diff --git a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.cs b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.cs index 60d1bd9..f1824c8 100644 --- a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.cs +++ b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.cs @@ -25,7 +25,6 @@ namespace GPW_Admin.WebUserControls { get { - //memLayer.ML.IntSessionObj("idxProgetto_sel") int answ = 0; int.TryParse(hfIdxProgetto.Value, out answ); return answ; @@ -33,7 +32,15 @@ namespace GPW_Admin.WebUserControls set { hfIdxProgetto.Value = $"{value}"; - + // salvo nuovo nome progetto... + int answ = 0; + int.TryParse($"{value}", out answ); + var tabProj = DataProxy.DP.taAP.getByIdxPrj(answ); + if (tabProj != null && tabProj.Rows.Count > 0) + { + int anno = DateTime.Today.Year; + txtNewProjName.Text = tabProj[0].nomeProj.Replace($"{anno - 1}", $"{anno }"); + } } } @@ -48,8 +55,8 @@ namespace GPW_Admin.WebUserControls /// protected void btnDuplica_Click(object sender, EventArgs e) { - - DataProxy.DP.taAP.duplicateProj(IdxProgetto); + // chiamo duplicazione + DataProxy.DP.taAP.duplicateProj(IdxProgetto, txtNewProjName.Text, chkSostAnno.Checked); // rileggo... Response.Redirect("progetti"); } diff --git a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.designer.cs b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.designer.cs index 9b3612b..2d4c4ac 100644 --- a/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.designer.cs +++ b/GPW_Admin/WebUserControls/mod_dettaglioProgetto.ascx.designer.cs @@ -23,6 +23,33 @@ namespace GPW_Admin.WebUserControls /// protected global::System.Web.UI.WebControls.FormView fmView; + /// + /// txtNewProjName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNewProjName; + + /// + /// chkSostAnno control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSostAnno; + + /// + /// btnDuplica control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDuplica; + /// /// ods control. /// diff --git a/GPW_Data/DS_Applicazione.Designer.cs b/GPW_Data/DS_Applicazione.Designer.cs index b25dd13..503b6a3 100644 --- a/GPW_Data/DS_Applicazione.Designer.cs +++ b/GPW_Data/DS_Applicazione.Designer.cs @@ -27996,6 +27996,8 @@ SELECT idxCliente, RagSociale, indirizzo, CAP, citta, prov, tel, url, email, pIv this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxProgetto", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@nomeProj", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@sostAnnoFasi", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; this._commandCollection[4].CommandText = "dbo.stp_AP_getByIdxCli"; @@ -28526,7 +28528,7 @@ SELECT idxCliente, RagSociale, indirizzo, CAP, citta, prov, tel, url, email, pIv [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int duplicateProj(global::System.Nullable idxProgetto) { + public virtual int duplicateProj(global::System.Nullable idxProgetto, string nomeProj, global::System.Nullable sostAnnoFasi) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((idxProgetto.HasValue == true)) { command.Parameters[1].Value = ((int)(idxProgetto.Value)); @@ -28534,6 +28536,18 @@ SELECT idxCliente, RagSociale, indirizzo, CAP, citta, prov, tel, url, email, pIv else { command.Parameters[1].Value = global::System.DBNull.Value; } + if ((nomeProj == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(nomeProj)); + } + if ((sostAnnoFasi.HasValue == true)) { + command.Parameters[3].Value = ((bool)(sostAnnoFasi.Value)); + } + else { + command.Parameters[3].Value = global::System.DBNull.Value; + } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { diff --git a/GPW_Data/DS_Applicazione.xsd b/GPW_Data/DS_Applicazione.xsd index 3de6a4e..f2a521b 100644 --- a/GPW_Data/DS_Applicazione.xsd +++ b/GPW_Data/DS_Applicazione.xsd @@ -1435,6 +1435,8 @@ SELECT idxCliente, RagSociale, indirizzo, CAP, citta, prov, tel, url, email, pIv + + diff --git a/GPW_Data/DS_Applicazione.xss b/GPW_Data/DS_Applicazione.xss index 8235dae..813133e 100644 --- a/GPW_Data/DS_Applicazione.xss +++ b/GPW_Data/DS_Applicazione.xss @@ -8,32 +8,32 @@ - - + + - + - + - - + + - - - + + + - + - - - - - - - + + + + + + + @@ -112,7 +112,7 @@ - + 286 @@ -128,7 +128,7 @@ - + 428