diff --git a/GMW/GMW/WebUserControls/mod_viewOdette.ascx b/GMW/GMW/WebUserControls/mod_viewOdette.ascx index bcaadbca..d190a61b 100644 --- a/GMW/GMW/WebUserControls/mod_viewOdette.ascx +++ b/GMW/GMW/WebUserControls/mod_viewOdette.ascx @@ -39,9 +39,12 @@ - + - + + - - + --%> diff --git a/GMW/GMW/WebUserControls/mod_viewOdette.ascx.cs b/GMW/GMW/WebUserControls/mod_viewOdette.ascx.cs index a05be06a..1bbef2c7 100644 --- a/GMW/GMW/WebUserControls/mod_viewOdette.ascx.cs +++ b/GMW/GMW/WebUserControls/mod_viewOdette.ascx.cs @@ -310,7 +310,7 @@ namespace GMW.WebUserControls { get { - return Odette.mgr.listaHasOdette(memLayer.ML.StringSessionObj("CodListaOd_sel")); + return Odette.mgr.listaHasOdette(CodListaOdetteCurr); } } /// @@ -338,17 +338,33 @@ namespace GMW.WebUserControls /// protected void btnRistampaOdette_Click(object sender, EventArgs e) { - Odette.mgr.stampaOdettePackingList(memLayer.ML.StringSessionObj("CodListaOd_sel")); + Odette.mgr.stampaOdettePackingList(CodListaOdetteCurr); } /// - /// elimina tutte le etichette odette create... + /// elimina tutte le odette /// /// /// - protected void btnEliminaTutte_Click(object sender, EventArgs e) + protected void btnEmptyOdette_Click(object sender, EventArgs e) { - + Odette.mgr.taOdette.deleteByLDP(CodListaOdetteCurr); + // sollevo evento nuovo valore... + if (eh_nuovoValore != null) + { + eh_nuovoValore(this, new EventArgs()); + } } + /// + /// lista odette correntemente selezionata + /// + public string CodListaOdetteCurr + { + get + { + return memLayer.ML.StringSessionObj("CodListaOd_sel"); + } + } + #endregion diff --git a/GMW/GMW/bin/GMW.dll b/GMW/GMW/bin/GMW.dll index 23e728e1..6478b259 100644 Binary files a/GMW/GMW/bin/GMW.dll and b/GMW/GMW/bin/GMW.dll differ diff --git a/GMW/GMW/bin/GMW_data.dll b/GMW/GMW/bin/GMW_data.dll index eed944b7..a3836206 100644 Binary files a/GMW/GMW/bin/GMW_data.dll and b/GMW/GMW/bin/GMW_data.dll differ diff --git a/GMW/GMW/mazzAppSettingsSP.config b/GMW/GMW/mazzAppSettingsSP.config index 37f9d9db..414d78f6 100644 --- a/GMW/GMW/mazzAppSettingsSP.config +++ b/GMW/GMW/mazzAppSettingsSP.config @@ -37,7 +37,7 @@ - + diff --git a/GMW/GMW/obj/Release/GMW.dll b/GMW/GMW/obj/Release/GMW.dll index 23e728e1..6478b259 100644 Binary files a/GMW/GMW/obj/Release/GMW.dll and b/GMW/GMW/obj/Release/GMW.dll differ diff --git a/GMW/GMW/obj/Release/ResolveAssemblyReference.cache b/GMW/GMW/obj/Release/ResolveAssemblyReference.cache index c0a350e3..5e69a756 100644 Binary files a/GMW/GMW/obj/Release/ResolveAssemblyReference.cache and b/GMW/GMW/obj/Release/ResolveAssemblyReference.cache differ diff --git a/GMW/GMW_data/DS_Odette.Designer.cs b/GMW/GMW_data/DS_Odette.Designer.cs index 0dac693f..5cc2a2eb 100644 --- a/GMW/GMW_data/DS_Odette.Designer.cs +++ b/GMW/GMW_data/DS_Odette.Designer.cs @@ -6556,91 +6556,101 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[8]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[9]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM dbo.Odette"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "dbo.stp_ODETTE_delete"; + this._commandCollection[1].CommandText = "dbo.stp_ODETTE_deleteByLDP"; 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_CampoUDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_ODETTE_getByListaPrelievo"; + this._commandCollection[2].CommandText = "dbo.stp_ODETTE_delete"; this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CampoUDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_ODETTE_getByUDC"; + this._commandCollection[3].CommandText = "dbo.stp_ODETTE_getByListaPrelievo"; 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("@UDC", global::System.Data.SqlDbType.NVarChar, 10, 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("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; - this._commandCollection[4].CommandText = "dbo.stp_ODETTE_setStato"; + this._commandCollection[4].CommandText = "dbo.stp_ODETTE_getByUDC"; this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@StatoOk", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; - this._commandCollection[5].CommandText = "dbo.stp_ODETTE_updateLingua"; + this._commandCollection[5].CommandText = "dbo.stp_ODETTE_setStato"; this._commandCollection[5].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[5].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[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo1_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo2_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo3_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo4_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo5_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo6_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo7_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo8_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo9_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo10_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo11_1_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo11_2_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo12_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo13_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo14_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo15_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo16_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@StatoOk", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[6].Connection = this.Connection; - this._commandCollection[6].CommandText = "dbo.stp_ODETTE_updateVal"; + this._commandCollection[6].CommandText = "dbo.stp_ODETTE_updateLingua"; this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[6].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[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ragSocCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@indirCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@capCittCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ragSocDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@indirDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@capCittDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pesoNetto", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pesoLordo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numColli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@disPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@descPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codImb", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codMaz", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codNael", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo1_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo2_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo3_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo4_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo5_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo6_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo7_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo8_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo9_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo10_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo11_1_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo11_2_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo12_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo13_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo14_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo15_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Campo16_1", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[7].Connection = this.Connection; - this._commandCollection[7].CommandText = "dbo.stp_ODETTE_upsertUdc"; + this._commandCollection[7].CommandText = "dbo.stp_ODETTE_updateVal"; this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCS", global::System.Data.SqlDbType.VarChar, 2, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numBolla", global::System.Data.SqlDbType.NVarChar, 6, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataBolla", global::System.Data.SqlDbType.NVarChar, 8, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IndStabFrom", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@qtaCont", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ragSocCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@indirCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@capCittCli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ragSocDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@indirDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@capCittDest", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pesoNetto", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@pesoLordo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numColli", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@disPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@descPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codPart", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codImb", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codMaz", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@codNael", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[8].Connection = this.Connection; + this._commandCollection[8].CommandText = "dbo.stp_ODETTE_upsertUdc"; + this._commandCollection[8].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[8].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[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCS", global::System.Data.SqlDbType.VarChar, 2, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@numBolla", global::System.Data.SqlDbType.NVarChar, 6, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dataBolla", global::System.Data.SqlDbType.NVarChar, 8, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodMag", global::System.Data.SqlDbType.NVarChar, 2, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@GrpBolla", global::System.Data.SqlDbType.NVarChar, 1, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Particolare", global::System.Data.SqlDbType.NVarChar, 15, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IndStabFrom", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@qtaCont", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -6669,7 +6679,7 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_Odette.OdetteDataTable getByCodLista(string CodLista) { - this.Adapter.SelectCommand = this.CommandCollection[2]; + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((CodLista == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -6685,7 +6695,7 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_Odette.OdetteDataTable getByUdc(string UDC) { - this.Adapter.SelectCommand = this.CommandCollection[3]; + this.Adapter.SelectCommand = this.CommandCollection[4]; if ((UDC == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -9410,8 +9420,35 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int deleteQuery(string Original_CampoUDC) { + public virtual int deleteByLDP(string CodLista) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((CodLista == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodLista)); + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int deleteQuery(string Original_CampoUDC) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; if ((Original_CampoUDC == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -9438,7 +9475,7 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int setStato(string UDC, global::System.Nullable StatoOk) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; if ((UDC == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -9489,7 +9526,7 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT string Campo14_1, string Campo15_1, string Campo16_1) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; if ((UDC == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -9634,7 +9671,7 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT string codImb, string codMaz, string codNael) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((UDC == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -9750,8 +9787,8 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int upsertUdc(string UDC, string CodCS, string numBolla, string dataBolla, string IndStabFrom, string qtaCont) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; + public virtual int upsertUdc(string UDC, string CodCS, string numBolla, string dataBolla, string CodMag, string GrpBolla, string Particolare, string CodLista, string IndStabFrom, string qtaCont) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[8]; if ((UDC == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -9776,17 +9813,41 @@ SELECT CDMFS, GRBOS, DTBOS, NRBOS, CDARS, NRRGS, CDINB, RA1ND, RA2ND, CAPND, CIT else { command.Parameters[4].Value = ((string)(dataBolla)); } - if ((IndStabFrom == null)) { + if ((CodMag == null)) { command.Parameters[5].Value = global::System.DBNull.Value; } else { - command.Parameters[5].Value = ((string)(IndStabFrom)); + command.Parameters[5].Value = ((string)(CodMag)); } - if ((qtaCont == null)) { + if ((GrpBolla == null)) { command.Parameters[6].Value = global::System.DBNull.Value; } else { - command.Parameters[6].Value = ((string)(qtaCont)); + command.Parameters[6].Value = ((string)(GrpBolla)); + } + if ((Particolare == null)) { + command.Parameters[7].Value = global::System.DBNull.Value; + } + else { + command.Parameters[7].Value = ((string)(Particolare)); + } + if ((CodLista == null)) { + command.Parameters[8].Value = global::System.DBNull.Value; + } + else { + command.Parameters[8].Value = ((string)(CodLista)); + } + if ((IndStabFrom == null)) { + command.Parameters[9].Value = global::System.DBNull.Value; + } + else { + command.Parameters[9].Value = ((string)(IndStabFrom)); + } + if ((qtaCont == null)) { + command.Parameters[10].Value = global::System.DBNull.Value; + } + else { + command.Parameters[10].Value = ((string)(qtaCont)); } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) diff --git a/GMW/GMW_data/DS_Odette.xsd b/GMW/GMW_data/DS_Odette.xsd index f77a5500..5be565b9 100644 --- a/GMW/GMW_data/DS_Odette.xsd +++ b/GMW/GMW_data/DS_Odette.xsd @@ -744,7 +744,18 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + + + + dbo.stp_ODETTE_deleteByLDP + + + + + + + + dbo.stp_ODETTE_delete @@ -777,7 +788,7 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + dbo.stp_ODETTE_setStato @@ -789,7 +800,7 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + dbo.stp_ODETTE_updateLingua @@ -817,7 +828,7 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + dbo.stp_ODETTE_updateVal @@ -843,7 +854,7 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + dbo.stp_ODETTE_upsertUdc @@ -853,6 +864,10 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam + + + + @@ -892,805 +907,805 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - + - + - - - + + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + @@ -1703,8 +1718,8 @@ SELECT CampoUDC, Campo1_1, Campo1_2, Campo1_3, Campo1_4, Campo1_5, Campo2_1, Cam - - + + diff --git a/GMW/GMW_data/GMW_data.csproj b/GMW/GMW_data/GMW_data.csproj index 248efeaf..67197144 100644 --- a/GMW/GMW_data/GMW_data.csproj +++ b/GMW/GMW_data/GMW_data.csproj @@ -195,6 +195,7 @@ SettingsSingleFileGenerator Settings.Designer.cs + diff --git a/GMW/GMW_data/Odette.cs b/GMW/GMW_data/Odette.cs index f8fe7ae4..939d7f3f 100644 --- a/GMW/GMW_data/Odette.cs +++ b/GMW/GMW_data/Odette.cs @@ -361,6 +361,7 @@ namespace GMW_data { bool answ = false; int righeBolla = 0; + // controllo che la bolla esista... try { // provo a caricarle con stored... @@ -371,6 +372,11 @@ namespace GMW_data } catch { } + // controllo che la bolla non sia già associata... + if (answ) + { + // controllo se trovo odette associate a tale bolla... + } return answ; } /// @@ -463,7 +469,7 @@ namespace GMW_data foreach (DS_magazzino.RigheListePrelievoRow rigaUdc in ElencoUdc) { // per ogni UDC creo una riga - taOdette.upsertUdc(rigaUdc.UDC, memLayer.ML.confReadString("CodCS"), numBolla.ToString(), dataBolla.ToString(), memLayer.ML.confReadString("indStabFrom"), rigaUdc.Qta.ToString()); + taOdette.upsertUdc(rigaUdc.UDC, memLayer.ML.confReadString("CodCS"), numBolla.ToString(), dataBolla.ToString(), RaggMag,GrpBolla,particolare,CodLista, memLayer.ML.confReadString("indStabFrom"), rigaUdc.Qta.ToString()); udcOk++; // per ogni riga inserisco traduzione nella lingua richiesta caricaEtichetteLinguaPerOdette(rigaUdc.UDC, lingua); diff --git a/GMW/GMW_data/SqlScripts/GMW_00391.sql b/GMW/GMW_data/SqlScripts/GMW_00391.sql new file mode 100644 index 00000000..8a113457 --- /dev/null +++ b/GMW/GMW_data/SqlScripts/GMW_00391.sql @@ -0,0 +1,232 @@ +set xact_abort on +go + +begin transaction +go + +set ANSI_NULLS on +go + +/***************************************** +* STORED stp_ODETTE_upsertUdc +* +* effettua upsert x l'UDC (ovver crea nuovo solo se non c'è...) +* +* Steamware, S.E.L. +* mod: 2011.04.28 +* +****************************************/ +alter PROCEDURE stp_ODETTE_upsertUdc +( + @UDC NVARCHAR(10), + @CodCS VARCHAR(2), + @numBolla NVARCHAR(6), + @dataBolla NVARCHAR(8), + @IndStabFrom NVARCHAR(50), + @qtaCont NVARCHAR(50) +) +AS + + +-- DECLARE iniziali x gestione contatori odette +DECLARE @Flusso AS VARCHAR(2) +DECLARE @Anno AS VARCHAR(2) +DECLARE @numOdette AS INT +DECLARE @nextOdette AS INT + +------------------------------------------------------------------------------------------------------ +-- Fix flusso ed anno x 'OD' e '00' (contatore non spezzato su anno... +------------------------------------------------------------------------------------------------------ +SET @Flusso = 'OD' +SET @Anno = '00' + +------------------------------------------------------------------------------------------------------ +-- Contatore Odette +------------------------------------------------------------------------------------------------------ +-- controllo se ci sia già un odette per company / flusso / anno +BEGIN TRAN + -- cerco nella tab contatori UDC l'ultimo valido + SET @numOdette = ( + SELECT count(*) + FROM Odette + WHERE CodCS = @CodCS + ) + -- controllo se record c'è... + IF(@numOdette > 0) + BEGIN + -- se c'è incremento di 1 in tab + UPDATE ContatoriUdc + SET LastIdx = LastIdx + 1 + WHERE CodCS = @CodCS + AND Flusso = @Flusso + AND Anno = @Anno + END + ELSE + BEGIN + -- lo creo! + INSERT INTO ContatoriUdc(CodCS, Flusso, Anno, LastIdx) + VALUES (@CodCS, @Flusso, @Anno, 1) + END + -- aggiorno numero UDC + SET @numOdette = ( + SELECT LastIdx + FROM ContatoriUdc + WHERE CodCS = @CodCS + AND Flusso = @Flusso + AND Anno = @Anno + ) +COMMIT TRAN + +-- cerco se ci sia già la riga Odette +DECLARE @udcTrovati AS INT +SET @udcTrovati = ( SELECT COUNT(*) FROM Odette WHERE CampoUDC = @UDC ) + +-- controllo se esista già... se non c'è creo +IF (@udcTrovati = 0) + BEGIN + INSERT INTO Odette(CampoUDC, StatoOk, CodCS) + VALUES(@UDC, 0, @CodCS) + END + +-- calcolo valori x update +DECLARE @DataB AS NVARCHAR(7) +SET @DataB = ( SELECT 'D'+ SUBSTRING(@dataBolla, 3, 6) ) +DECLARE @udcShort NVARCHAR(10) +--SET @udcShort = SUBSTRING(@UDC, 3, LEN(@UDC)-2) -- prendo da 3° carattere perché prima "U" e una lettera x tipo prodotto gitterbox + +-- update valori (sovrascrivo...) +UPDATE Odette +SET Campo3_2 = @numBolla, + Campo3_3 = @numBolla, + Campo4_2 = @IndStabFrom, + Campo9_2 = @qtaCont, + Campo9_3 = @qtaCont, + Campo13_2 = @DataB, + Campo15_2 = @numOdette, + Campo15_3 = @numOdette, + Campo16_2 = @UDC +WHERE CampoUDC = @UDC + +RETURN +go + +commit +go + + +set xact_abort on +go + +begin transaction +go + +alter table Odette add + CodMag nvarchar(2), + GrpBolla nvarchar(1), + DataBolla numeric(8,0), + NumBolla numeric(6,0), + Particolare nvarchar(15), + CodLista nvarchar(12) +go + + + +commit +go + +set xact_abort on +go + +begin transaction +go + +update Odette +set CodMag='SP', GrpBolla='0', NumBolla=cast(Campo3_2 as numeric(8,0)), Particolare=Campo11_1_2, DataBolla=0, CodLista='' +go + +update Odette +set CodLista = rlp.CodLista +from Odette inner join RigheListePrelievo rlp on rlp.UDC=Odette.CampoUDC +go + +update Odette +set DataBolla = b.DTBOS +from Odette inner join RawData.BORI202J b on b.NRBOS=Odette.NumBolla +go + +commit +go + +set xact_abort on +go + +begin transaction +go + +update Odette set CodMag = '' where CodMag is null +go + +alter table Odette alter column + CodMag nvarchar(2) not null +go + +update Odette set GrpBolla = '' where GrpBolla is null +go + +alter table Odette alter column + GrpBolla nvarchar(1) not null +go + +update Odette set DataBolla = 0 where DataBolla is null +go + +alter table Odette alter column + DataBolla numeric(8,0) not null +go + +update Odette set NumBolla = 0 where NumBolla is null +go + +alter table Odette alter column + NumBolla numeric(6,0) not null +go + +update Odette set Particolare = '' where Particolare is null +go + +alter table Odette alter column + Particolare nvarchar(15) not null +go + +update Odette set CodLista = '' where CodLista is null +go + +alter table Odette alter column + CodLista nvarchar(12) not null +go + +alter table Odette add + constraint DF_Odette_Particolare default ('') for Particolare, + constraint DF_Odette_CodLista default ('') for CodLista, + constraint DF_Odette_DataBolla default (0) for DataBolla, + constraint DF_Odette_NumBolla default (0) for NumBolla, + constraint DF_Odette_CodMag default ('') for CodMag, + constraint DF_Odette_GrpBolla default ('') for GrpBolla, + constraint DF_Odette_CodCS default ('') for CodCS +go + +set ANSI_NULLS on +go + + + +commit +go + + + + + +-- registro versione... +INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(391, GETDATE()) +GO diff --git a/GMW/GMW_data/bin/Release/GMW_data.dll b/GMW/GMW_data/bin/Release/GMW_data.dll index eed944b7..a3836206 100644 Binary files a/GMW/GMW_data/bin/Release/GMW_data.dll and b/GMW/GMW_data/bin/Release/GMW_data.dll differ diff --git a/GMW/GMW_data/obj/Release/GMW_data.dll b/GMW/GMW_data/obj/Release/GMW_data.dll index eed944b7..a3836206 100644 Binary files a/GMW/GMW_data/obj/Release/GMW_data.dll and b/GMW/GMW_data/obj/Release/GMW_data.dll differ diff --git a/GMW/GMW_data/obj/Release/TempPE/DS_Odette.Designer.cs.dll b/GMW/GMW_data/obj/Release/TempPE/DS_Odette.Designer.cs.dll index 32d459ad..8549db65 100644 Binary files a/GMW/GMW_data/obj/Release/TempPE/DS_Odette.Designer.cs.dll and b/GMW/GMW_data/obj/Release/TempPE/DS_Odette.Designer.cs.dll differ