diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs index d57586c..108856a 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs +++ b/Projects/WebGIM/GIM_data/DS_applicazione.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18033 +// Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -13588,9 +13588,10 @@ namespace GIM_data.DS_applicazioneTableAdapters { this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "DELETE FROM [dbo].[AnagMacchine] WHERE (([idxMacchina] = @Original_idxMacchina))"; - this._commandCollection[1].CommandType = global::System.Data.CommandType.Text; - this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxMacchina", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idxMacchina", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._commandCollection[1].CommandText = "dbo.spt_AD_delete"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxMacchina", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; this._commandCollection[2].CommandText = "SELECT idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricol" + @@ -13891,9 +13892,14 @@ namespace GIM_data.DS_applicazioneTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, false)] - public virtual int DeleteQuery(int Original_idxMacchina) { + public virtual int DeleteQuery(global::System.Nullable Original_idxMacchina) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; - command.Parameters[0].Value = ((int)(Original_idxMacchina)); + if ((Original_idxMacchina.HasValue == true)) { + command.Parameters[1].Value = ((int)(Original_idxMacchina.Value)); + } + else { + command.Parameters[1].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/Projects/WebGIM/GIM_data/DS_applicazione.xsd b/Projects/WebGIM/GIM_data/DS_applicazione.xsd index c697663..bf91254 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.xsd +++ b/Projects/WebGIM/GIM_data/DS_applicazione.xsd @@ -354,10 +354,11 @@ FROM v_macchine - - DELETE FROM [dbo].[AnagMacchine] WHERE (([idxMacchina] = @Original_idxMacchina)) + + dbo.spt_AD_delete - + + @@ -2046,7 +2047,7 @@ WHERE (idxCausale = @Original_idxCausale) - + @@ -2216,20 +2217,20 @@ WHERE (idxCausale = @Original_idxCausale) - - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Projects/WebGIM/GIM_data/DS_applicazione.xss b/Projects/WebGIM/GIM_data/DS_applicazione.xss index 4d6ed22..b54afe3 100644 --- a/Projects/WebGIM/GIM_data/DS_applicazione.xss +++ b/Projects/WebGIM/GIM_data/DS_applicazione.xss @@ -4,29 +4,29 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - - + + - + - - - - - - - - - + + + + + + + + + @@ -157,7 +157,7 @@ - + 1362 @@ -173,7 +173,7 @@ - + 922 @@ -185,7 +185,7 @@ - + 1328 @@ -197,7 +197,7 @@ - + 754 diff --git a/Projects/WebGIM/GIM_data/bin/GIM_data.dll b/Projects/WebGIM/GIM_data/bin/GIM_data.dll index fd7cce9..12d32f3 100644 Binary files a/Projects/WebGIM/GIM_data/bin/GIM_data.dll and b/Projects/WebGIM/GIM_data/bin/GIM_data.dll differ diff --git a/Projects/WebGIM/GIM_data/bin/SteamWare.dll b/Projects/WebGIM/GIM_data/bin/SteamWare.dll index 5c32d0d..0a7c045 100644 Binary files a/Projects/WebGIM/GIM_data/bin/SteamWare.dll and b/Projects/WebGIM/GIM_data/bin/SteamWare.dll differ diff --git a/Projects/WebGIM/GIM_site/GIM_site.csproj b/Projects/WebGIM/GIM_site/GIM_site.csproj index c958293..11825c6 100644 --- a/Projects/WebGIM/GIM_site/GIM_site.csproj +++ b/Projects/WebGIM/GIM_site/GIM_site.csproj @@ -556,6 +556,7 @@ + diff --git a/Projects/WebGIM/GIM_site/Web.config b/Projects/WebGIM/GIM_site/Web.config index 5cdd204..15ae0a5 100644 --- a/Projects/WebGIM/GIM_site/Web.config +++ b/Projects/WebGIM/GIM_site/Web.config @@ -104,7 +104,7 @@ - + diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx b/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx index da2961a..f06712f 100644 --- a/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx @@ -6,19 +6,15 @@ + - @@ -42,6 +38,5 @@
- - - + - - - +
- + SelectMethod="GetData" TypeName="GIM_data.DS_utilityTableAdapters.v_selImpiantiTableAdapter"> \ No newline at end of file diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx.cs b/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx.cs index 2773d9e..a372cc7 100644 --- a/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx.cs +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_assegnazioniMacchineImpianti.ascx.cs @@ -12,6 +12,18 @@ public partial class mod_assegnazioniMacchineImpianti :ApplicationUserControl base.Page_Load(sender, e); btnA2B.Enabled = isWritable(); btnB2A.Enabled = isWritable(); + mod_macchine1.eh_nuovoValore += mod_macchine1_eh_nuovoValore; + mod_macchine2.eh_nuovoValore += mod_macchine2_eh_nuovoValore; + } + + void mod_macchine2_eh_nuovoValore(object sender, EventArgs e) + { + mod_macchine2.doUpdate(); + } + + void mod_macchine1_eh_nuovoValore(object sender, EventArgs e) + { + mod_macchine1.doUpdate(); } /// /// click spostamento da A a B diff --git a/Projects/WebGIM/GIM_site/WebUserControls/mod_macchine.ascx.cs b/Projects/WebGIM/GIM_site/WebUserControls/mod_macchine.ascx.cs index a05d50f..8ab56cd 100644 --- a/Projects/WebGIM/GIM_site/WebUserControls/mod_macchine.ascx.cs +++ b/Projects/WebGIM/GIM_site/WebUserControls/mod_macchine.ascx.cs @@ -464,8 +464,13 @@ public partial class mod_macchine : ApplicationUserControl resetSelezione(); // i primi valori ("0") di default sono "ND"... li inserisco come standard... string codMacc = memLayer.ML.confReadString("defaultCodMacc"); - TA_app.obj.taMacchine.Insert(1, codMacc, memLayer.ML.confReadString("newMacchina"), memLayer.ML.confReadString("newModello"), "", DateTime.Now.Year, 0, 0, DateTime.Today, DateTime.Today.AddYears(10)); - grView.DataBind(); + TA_app.obj.taMacchine.Insert(idxImpiantoSel, codMacc, memLayer.ML.confReadString("newMacchina"), memLayer.ML.confReadString("newModello"), "", DateTime.Now.Year, 0, 0, DateTime.Today, DateTime.Today.AddYears(10)); + //doUpdate(); + // sollevo evento nuovo valore... + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } } /// /// salvo in session che il prox comando è clonare... @@ -534,7 +539,16 @@ public partial class mod_macchine : ApplicationUserControl { get { - return Convert.ToInt32(lblImpianto.Text); + int answ = 1; + try + { + answ = Convert.ToInt32(lblImpianto.Text); + } + catch + { + answ = 1; + } + return answ; } set { diff --git a/Projects/WebGIM/GIM_site/bin/GIM_data.dll b/Projects/WebGIM/GIM_site/bin/GIM_data.dll index fd7cce9..12d32f3 100644 Binary files a/Projects/WebGIM/GIM_site/bin/GIM_data.dll and b/Projects/WebGIM/GIM_site/bin/GIM_data.dll differ diff --git a/Projects/WebGIM/GIM_site/bin/GIM_site.dll b/Projects/WebGIM/GIM_site/bin/GIM_site.dll index 9d0afa3..42e8b89 100644 Binary files a/Projects/WebGIM/GIM_site/bin/GIM_site.dll and b/Projects/WebGIM/GIM_site/bin/GIM_site.dll differ diff --git a/Projects/WebGIM/GIM_site/bin/SteamWare.dll b/Projects/WebGIM/GIM_site/bin/SteamWare.dll index 5c32d0d..0a7c045 100644 Binary files a/Projects/WebGIM/GIM_site/bin/SteamWare.dll and b/Projects/WebGIM/GIM_site/bin/SteamWare.dll differ diff --git a/Projects/WebGIM/GIM_site/sql/Applicazione/V1.4 USA/GIM_0227.sql b/Projects/WebGIM/GIM_site/sql/Applicazione/V1.4 USA/GIM_0227.sql new file mode 100644 index 0000000..4d22327 --- /dev/null +++ b/Projects/WebGIM/GIM_site/sql/Applicazione/V1.4 USA/GIM_0227.sql @@ -0,0 +1,63 @@ +set xact_abort on; +go + +begin transaction; +go + +set ANSI_NULLS on; +go + +/************************************* +* STORED PROCEDURE spt_AD_delete +* elimina la macchina (da famiglia macchina e anagMacchina) SE non ah record associati +* +* modif.: S.E.L. - 2013.12.06 +**************************************/ +create PROCEDURE spt_AD_delete +( + @Original_idxMacchina int +) +AS + +BEGIN tran + + + DECLARE @trovati INT = 0 + -- controllo se ha eventi associati ... + SELECT @trovati = @trovati + ISNULL(COUNT(*),0) FROM InterventiMtz WHERE idxMacchina = @Original_idxMacchina + -- controllo se ha eventi schedulati ... + SELECT @trovati = @trovati + ISNULL(COUNT(*),0) FROM MtzProgPending WHERE idxMacchina = @Original_idxMacchina + + -- elimino solo se ZERO elementia ssociati.. + + IF (@trovati = 0) + BEGIN + + DELETE + FROM Macchine2FamMacchine + WHERE idxMacchina = @Original_idxMacchina + + DELETE + FROM AnagMacchine + WHERE idxMacchina = @Original_idxMacchina + + END + + +COMMIT tran + +RETURN +go + +commit; +go + + + + + +-- registro versione... +INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(227, GETDATE()) +GO +SELECT * FROM LogUpdateDb ORDER BY versione DESC +GO \ No newline at end of file