diff --git a/GMW/GMW.suo b/GMW/GMW.suo index 4dedefbe..a90b5059 100644 Binary files a/GMW/GMW.suo and b/GMW/GMW.suo differ diff --git a/GMW/GMW/bin/GMW.dll b/GMW/GMW/bin/GMW.dll index 94ac35ff..d8f603d4 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 7c32d9be..92aaba7f 100644 Binary files a/GMW/GMW/bin/GMW_data.dll and b/GMW/GMW/bin/GMW_data.dll differ diff --git a/GMW/GMW/bin/SteamWare.dll b/GMW/GMW/bin/SteamWare.dll index 47592539..38db19f3 100644 Binary files a/GMW/GMW/bin/SteamWare.dll and b/GMW/GMW/bin/SteamWare.dll differ diff --git a/GMW/GMW/obj/Debug/GMW.dll b/GMW/GMW/obj/Debug/GMW.dll index 94ac35ff..d8f603d4 100644 Binary files a/GMW/GMW/obj/Debug/GMW.dll and b/GMW/GMW/obj/Debug/GMW.dll differ diff --git a/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache b/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache index cbc82818..00877204 100644 Binary files a/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache and b/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache differ diff --git a/GMW/GMW/testFunzioni.aspx b/GMW/GMW/testFunzioni.aspx index 6297d731..71ca2a2c 100644 --- a/GMW/GMW/testFunzioni.aspx +++ b/GMW/GMW/testFunzioni.aspx @@ -10,6 +10,8 @@
+ +
diff --git a/GMW/GMW/testFunzioni.aspx.cs b/GMW/GMW/testFunzioni.aspx.cs index 29594d38..79c73d0b 100644 --- a/GMW/GMW/testFunzioni.aspx.cs +++ b/GMW/GMW/testFunzioni.aspx.cs @@ -17,9 +17,8 @@ namespace GMW protected void Button1_Click(object sender, EventArgs e) { - // MagClass.magazzino.creaListaPrelievo("MA", "20", "Iveco", "20", "10", 1000, "20"); - MagClass.magazzino.creaListaPrelievo("MA", "20", "Iveco", "20", "10", 1500, "30"); - + MagClass.magazzino.creaListaPrelievo("MA", "20", "P00505005162", "NEUTRO", "10", 1500, "I0001"); + } } } diff --git a/GMW/GMW/testFunzioni.aspx.designer.cs b/GMW/GMW/testFunzioni.aspx.designer.cs index 4f33642f..5cd6d107 100644 --- a/GMW/GMW/testFunzioni.aspx.designer.cs +++ b/GMW/GMW/testFunzioni.aspx.designer.cs @@ -22,6 +22,15 @@ namespace GMW { /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// + /// lblTest control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTest; + /// /// Button1 control. /// diff --git a/GMW/GMW_data/DS_magazzino.Designer.cs b/GMW/GMW_data/DS_magazzino.Designer.cs index 6cb483cc..d210b877 100644 --- a/GMW/GMW_data/DS_magazzino.Designer.cs +++ b/GMW/GMW_data/DS_magazzino.Designer.cs @@ -10080,21 +10080,28 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = @"SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, DisegnoGrezzo, Esponente, CodImpianto, DescImpianto, CodStampo, Figura, DataFus, TurnoFus, CodImballo, CodSoggetto, NumCont, Tara, Qta, CodStato, IdxPosizione, PesoTot, PesoCad, CreateDate, ModDate FROM dbo.ElencoCartellini"; 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_UDC_updateQty"; + this._commandCollection[1].CommandText = "dbo.stp_getUDC_Older"; 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("@UDC", global::System.Data.SqlDbType.VarChar, 20, 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("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 16, 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("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, 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("@CodEvento", global::System.Data.SqlDbType.VarChar, 10, 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("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ESPONENTE", global::System.Data.SqlDbType.VarChar, 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("@PARTICOLARE", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[2].Connection = this.Connection; + this._commandCollection[2].CommandText = "dbo.stp_UDC_updateQty"; + this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.VarChar, 20, 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("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 16, 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("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, 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("@CodEvento", global::System.Data.SqlDbType.VarChar, 10, 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("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -10122,8 +10129,30 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_magazzino.ElencoCartelliniDataTable updateQty(string UDC, string CodSoggetto, string CodTipoDichiaraz, string CodEvento, global::System.Nullable Qta) { + public virtual DS_magazzino.ElencoCartelliniDataTable getOlderUDC(string ESPONENTE, string PARTICOLARE) { this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((ESPONENTE == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(ESPONENTE)); + } + if ((PARTICOLARE == null)) { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = ((string)(PARTICOLARE)); + } + DS_magazzino.ElencoCartelliniDataTable dataTable = new DS_magazzino.ElencoCartelliniDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_magazzino.ElencoCartelliniDataTable updateQty(string UDC, string CodSoggetto, string CodTipoDichiaraz, string CodEvento, global::System.Nullable Qta) { + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((UDC == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -16742,29 +16771,36 @@ SELECT CodLista, CodTipoLista, CodCS, DataCreaz, CodCliente, RagSociale, CodSogg [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM dbo.ElencoListePrelievo"; 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_creaListaPrelievo"; - 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("@Anno", global::System.Data.SqlDbType.VarChar, 2, 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("@Mese", global::System.Data.SqlDbType.VarChar, 2, 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("@IdxPosizione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCS", global::System.Data.SqlDbType.NChar, 2, 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("@CodCliente", global::System.Data.SqlDbType.NVarChar, 6, 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("@RagSociale", global::System.Data.SqlDbType.NVarChar, 35, 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("@CodSoggetto", global::System.Data.SqlDbType.NChar, 16, 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("@Particolare", global::System.Data.SqlDbType.NVarChar, 15, 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("@DescParticolare", global::System.Data.SqlDbType.NVarChar, 30, 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("@DisegnoGrezzo", global::System.Data.SqlDbType.NVarChar, 30, 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("@Esponente", global::System.Data.SqlDbType.NVarChar, 6, 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("@CodImballo", global::System.Data.SqlDbType.NVarChar, 15, 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("@QtaTot", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].CommandText = "SELECT CodCS, CodCliente, CodImballo, CodLista, CodSoggetto, CodTipoLista, Comple" + + "tata, DataCreaz, DescParticolare, DisegnoGrezzo, Esponente, Iniziata, Particolar" + + "e, QtaTot, RagSociale FROM ElencoListePrelievo WHERE (CodLista = @CodLista)"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.Text; + 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, "CodLista", 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_creaListaPrelievo"; + 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("@Anno", global::System.Data.SqlDbType.VarChar, 2, 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("@Mese", global::System.Data.SqlDbType.VarChar, 2, 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("@IdxPosizione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodCS", global::System.Data.SqlDbType.NChar, 2, 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("@CodCliente", global::System.Data.SqlDbType.NVarChar, 6, 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("@RagSociale", global::System.Data.SqlDbType.NVarChar, 35, 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("@CodSoggetto", global::System.Data.SqlDbType.NChar, 16, 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("@Particolare", global::System.Data.SqlDbType.NVarChar, 15, 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("@DescParticolare", global::System.Data.SqlDbType.NVarChar, 30, 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("@DisegnoGrezzo", global::System.Data.SqlDbType.NVarChar, 30, 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("@Esponente", global::System.Data.SqlDbType.NVarChar, 6, 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("@CodImballo", global::System.Data.SqlDbType.NVarChar, 15, 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("@QtaTot", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -16792,8 +16828,24 @@ SELECT CodLista, CodTipoLista, CodCS, DataCreaz, CodCliente, RagSociale, CodSogg [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_magazzino.ElencoListePrelievoDataTable InsertQuery(string Anno, string Mese, global::System.Nullable IdxPosizione, string CodCS, string CodCliente, string RagSociale, string CodSoggetto, string Particolare, string DescParticolare, string DisegnoGrezzo, string Esponente, string CodImballo, global::System.Nullable QtaTot) { + public virtual DS_magazzino.ElencoListePrelievoDataTable getByCodLista(string CodLista) { this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((CodLista == null)) { + throw new global::System.ArgumentNullException("CodLista"); + } + else { + this.Adapter.SelectCommand.Parameters[0].Value = ((string)(CodLista)); + } + DS_magazzino.ElencoListePrelievoDataTable dataTable = new DS_magazzino.ElencoListePrelievoDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_magazzino.ElencoListePrelievoDataTable InsertQuery(string Anno, string Mese, global::System.Nullable IdxPosizione, string CodCS, string CodCliente, string RagSociale, string CodSoggetto, string Particolare, string DescParticolare, string DisegnoGrezzo, string Esponente, string CodImballo, global::System.Nullable QtaTot) { + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((Anno == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/GMW/GMW_data/DS_magazzino.cs b/GMW/GMW_data/DS_magazzino.cs index cdf87ed9..a4a93fa7 100644 --- a/GMW/GMW_data/DS_magazzino.cs +++ b/GMW/GMW_data/DS_magazzino.cs @@ -4,3 +4,10 @@ public partial class DS_magazzino { } } + +namespace GMW_data.DS_magazzinoTableAdapters { + + + public partial class ElencoListePrelievoTableAdapter { + } +} diff --git a/GMW/GMW_data/DS_magazzino.xsd b/GMW/GMW_data/DS_magazzino.xsd index ce5028fb..fa7c2d69 100644 --- a/GMW/GMW_data/DS_magazzino.xsd +++ b/GMW/GMW_data/DS_magazzino.xsd @@ -217,6 +217,18 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno + + + + dbo.stp_getUDC_Older + + + + + + + + @@ -1504,6 +1516,16 @@ SELECT CodLista, CodTipoLista, CodCS, DataCreaz, CodCliente, RagSociale, CodSogg + + + + SELECT CodCS, CodCliente, CodImballo, CodLista, CodSoggetto, CodTipoLista, Completata, DataCreaz, DescParticolare, DisegnoGrezzo, Esponente, Iniziata, Particolare, QtaTot, RagSociale FROM ElencoListePrelievo WHERE (CodLista = @CodLista) + + + + + + diff --git a/GMW/GMW_data/DS_magazzino.xss b/GMW/GMW_data/DS_magazzino.xss index e7535237..c1327eea 100644 --- a/GMW/GMW_data/DS_magazzino.xss +++ b/GMW/GMW_data/DS_magazzino.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -19,7 +19,7 @@ - + diff --git a/GMW/GMW_data/MagClass.cs b/GMW/GMW_data/MagClass.cs index b1bf70e4..f8b4d5dc 100644 --- a/GMW/GMW_data/MagClass.cs +++ b/GMW/GMW_data/MagClass.cs @@ -26,6 +26,7 @@ namespace GMW_data public DS_magazzinoTableAdapters.V_DettMagPartTableAdapter taDettMagPart; public DS_magazzinoTableAdapters.v_UdcDetailTableAdapter taDettUDC; public DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter taElencoListePrelievo; + public DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter taElencoCartellini; /// @@ -46,6 +47,7 @@ namespace GMW_data taDettMagPart = new GMW_data.DS_magazzinoTableAdapters.V_DettMagPartTableAdapter(); taDettUDC = new GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter(); taElencoListePrelievo = new GMW_data.DS_magazzinoTableAdapters.ElencoListePrelievoTableAdapter(); + taElencoCartellini = new GMW_data.DS_magazzinoTableAdapters.ElencoCartelliniTableAdapter(); } /// /// effettua setup dei connection strings da web.config delal singola applicazione @@ -65,6 +67,7 @@ namespace GMW_data taDettMagPart.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); taDettUDC.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); taElencoListePrelievo.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); + taElencoCartellini.Connection.ConnectionString = memLayer.ML.confReadString("GMWConnectionString"); } @@ -155,77 +158,111 @@ namespace GMW_data int idxPosizione = 20; // !!! Verificare parametrico string codCliente = ""; string RagioneSociale = ""; - string codSoggetto = "A"; + string codSoggetto = "O000000000000068"; string disegnoGrezzo = ""; string descParticolare = ""; + // ricavo codCliente - try { - codCliente = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].CodCliente; + try + { + codCliente = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].CodCliente; } - catch {} + catch { } // ricavo disegnoGrezzo - try { - disegnoGrezzo = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].DisegnoGrezzo; + try + { + disegnoGrezzo = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].DisegnoGrezzo; } - catch {} + catch { } - try { - descParticolare = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].DescParticolare; + try + { + descParticolare = DataProxy.obj.taAnagParticolari.getByParticolare(Particolare)[0].DescParticolare; } - catch {} + catch { } + + // qui valorizzo subito riga //DS_magazzino.ElencoListePrelievoRow riga = taElencoListePrelievo.InsertQuery(string.Format("{0:yy}", adesso),string.Format("{0:MM}", adesso), idxPosizione, memLayer.ML.confReadString("CodCS"), codCliente, RagioneSociale, codSoggetto, Particolare, descParticolare, disegnoGrezzo, Esponente, CodImballo, QtaTot)[0]; - // !!! FINIRE per errore della stored senza @TEMP - DS_magazzino.ElencoListePrelievoDataTable tabella = taElencoListePrelievo.InsertQuery(string.Format("{0:yy}", adesso), string.Format("{0:MM}", adesso), idxPosizione, memLayer.ML.confReadString("CodCS"), codCliente, RagioneSociale, codSoggetto, Particolare, descParticolare, disegnoGrezzo, Esponente, CodImballo, QtaTot); + // qui valorizzo tabella + + //DS_magazzino.ElencoListePrelievoDataTable tabella = taElencoListePrelievo.InsertQuery(string.Format("{0:yy}", adesso), string.Format("{0:MM}", adesso), idxPosizione, memLayer.ML.confReadString("CodCS"), codCliente, RagioneSociale, codSoggetto, Particolare, descParticolare, disegnoGrezzo, Esponente, CodImballo, QtaTot); + + // eseguo soltanto la query + + DS_magazzino.ElencoListePrelievoDataTable tabellaElencoListe = taElencoListePrelievo.InsertQuery(string.Format("{0:yy}", adesso), string.Format("{0:MM}", adesso), idxPosizione, memLayer.ML.confReadString("CodCS"), codCliente, RagioneSociale, codSoggetto, Particolare, descParticolare, disegnoGrezzo, Esponente, CodImballo, QtaTot); + + // ricavo prima (e unica) riga dalla select + DS_magazzino.ElencoListePrelievoRow rigaElencoListe = tabellaElencoListe[0]; - + // stored per ricavare il più vecchio in ordine ASC per Data Fusione - SINGOLA RIGA + // DS_magazzino.ElencoCartelliniRow riga = taElencoCartellini.getOlderUDC(Esponente, Particolare)[0]; + //stored per ricavare il più vecchio in ordine ASC per Data Fusione - TABELLA + DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini = taElencoCartellini.getOlderUDC(Esponente, Particolare); - // prendi l'udc più vecchio ... tutti i cartellini in senso crescente rispetto alla data ... prima più vecchio e poi più nuovi ---- select * from elecocartellini where esponente e particolare sono quelli by qualcosa asc ... in stato aperto quindi posizione 20 + bool qtaOk = false; + bool dataFinished = false; + int contatore = 0; - // dsapplicazionelecnocartellini row + int numRighe = tabellaElencoCartellini.Rows.Count; + + // ricavo la quantità della riga attuale + decimal qtaRiga = tabellaElencoCartellini[contatore].Qta; + // lo uso come qta allocata + decimal qtaAllocata = 0; + + while (!qtaOk && !dataFinished) + { + /* + * crea una riga in righelistaprelievo passando come valori + * il codlista attuale ricavato da sopr + * l'UDC dal primo della tabella getOlderUDC + * + * + * recupero quantità dalla riga corrente; + * + * imposto proposto a 1; + * imposto prelevato 0; + * taRighelistePreliveo.Insert; + * + * qtaAllocata = qtaAllocata + Qta di questa riga (riuso il valore della colonna QTA + * tabella[contatore]; contatore++; + * qtaOk = (qtaAllocata >= qtaRichiesta) + * dataFinished = (contatore >= numRighe); + * + * */ + + // uso qtaRiga + } - // foreach row in elenco ottenuto /* - * E questo è un bel problema da sistemare: serve una bella stored che, dato un insieme di informazioni - * - * - vada a creare una nuova lista di prelievo, mettendo via il codice appena generato x la lista di prelievo (vedere come fa x creare nuovo UDC quando mette via scope identity o altro...) - * ellini - * - determini dal TipoListaPrelievo la posizione in cui cercare i cartellini e la cella di destinazione - * - * - ricerchi in ElencoCartellini gli q "papabili": nel where ci va - * - la loro posizione (IdxPosizione) appena ottenuta - * - il codice del particolare - * - esponente - * - figura - * - il fatto che NON devono fare parte di questa lista di prelievo (sennò aggiunto 20 volte lo stesso UDC...) - * - * - ordini gli UDC per data dal + vecchio (data fusione? direi di si!) - * - * - prenda 1 ad 1 gli UDC, e crei dall'UDC un record in RigheListePrelievo con - * - CodLista (dal record appena generato) - * - UDC (il + vecchio trovato) - * - QTA (dell'UDC) - * - Proposto = 1 (vero) - * - Prelevato = 0 (falso) - * - questo loop di prelievo va eseguito fino a quanto la somam delle qty sia maggiore o uguale alla qty richiesta, o fino a quando siano finiti gli UDC - * - * - potrebbe esser cambiato approccio e si potrebbe fare una query ceh seleziona i + vecchi UDC in numero corretto fin dall'inizio da includere facendo una cosa del tipo - * - calcolo media qty degli UDC papabili x le condizioni dette prima - * - dato il totale ottengo quanti UDC mi servono arrotondando x eccesso (se ho 200 richiesti, media 70, CEIL(200/70) = 3) - * - faccio un SELECT TOP n (qui 3) * FROM ElencoCartellini WHERE ... - * - e questa select la uso x farci un INSERT INTO in RigheListePrelievo - * - * - terminati questi step si aggiorna la lista di prelievo emttendo come qty quella data dalla somma degli UDC davvero proposti - * - * - la stored deve restituire il codice della lista di prelievo e passarla qui, che a sua volta passerà al chiamante il codice della lista - * */ + * - ordini gli UDC per data dal + vecchio (data fusione? direi di si!) + * + * - prenda 1 ad 1 gli UDC, e crei dall'UDC un record in RigheListePrelievo con + * - CodLista (dal record appena generato) + * - UDC (il + vecchio trovato) + * - QTA (dell'UDC) + * - Proposto = 1 (vero) + * - Prelevato = 0 (falso) + * - questo loop di prelievo va eseguito fino a quanto la somam delle qty sia maggiore o uguale alla qty richiesta, o fino a quando siano finiti gli UDC + * + * - potrebbe esser cambiato approccio e si potrebbe fare una query ceh seleziona i + vecchi UDC in numero corretto fin dall'inizio da includere facendo una cosa del tipo + * - calcolo media qty degli UDC papabili x le condizioni dette prima + * - dato il totale ottengo quanti UDC mi servono arrotondando x eccesso (se ho 200 richiesti, media 70, CEIL(200/70) = 3) + * - faccio un SELECT TOP n (qui 3) * FROM ElencoCartellini WHERE ... + * - e questa select la uso x farci un INSERT INTO in RigheListePrelievo + * + * - terminati questi step si aggiorna la lista di prelievo emttendo come qty quella data dalla somma degli UDC davvero proposti + * + * - la stored deve restituire il codice della lista di prelievo e passarla qui, che a sua volta passerà al chiamante il codice della lista + * */ return answ; } @@ -240,6 +277,21 @@ namespace GMW_data { esitoOperazione answ = esitoOperazione.errore; + // la query recupera la lista in base al CodLista o TAB o RIGA + + //DS_magazzino.ElencoListePrelievoDataTable tabella = taElencoListePrelievo.getByCodLista(CodLista); + //DS_magazzino.ElencoListePrelievoRow riga = taElencoListePrelievo.getByCodLista(CodLista)[0]; + + //if (tabella.Rows.Count > 0) + //{ + + //} + + + + + + /* * Questa funzione va chiamata quando inizio a gestire una lista di prelievo come operatore carrellista * diff --git a/GMW/GMW_data/bin/Debug/GMW_data.dll b/GMW/GMW_data/bin/Debug/GMW_data.dll index 7c32d9be..92aaba7f 100644 Binary files a/GMW/GMW_data/bin/Debug/GMW_data.dll and b/GMW/GMW_data/bin/Debug/GMW_data.dll differ diff --git a/GMW/GMW_data/bin/Debug/SteamWare.dll b/GMW/GMW_data/bin/Debug/SteamWare.dll index 47592539..38db19f3 100644 Binary files a/GMW/GMW_data/bin/Debug/SteamWare.dll and b/GMW/GMW_data/bin/Debug/SteamWare.dll differ diff --git a/GMW/GMW_data/obj/Debug/GMW_data.dll b/GMW/GMW_data/obj/Debug/GMW_data.dll index 7c32d9be..92aaba7f 100644 Binary files a/GMW/GMW_data/obj/Debug/GMW_data.dll and b/GMW/GMW_data/obj/Debug/GMW_data.dll differ diff --git a/GMW/GMW_data/obj/Debug/ResolveAssemblyReference.cache b/GMW/GMW_data/obj/Debug/ResolveAssemblyReference.cache index 5cafc931..55a0b168 100644 Binary files a/GMW/GMW_data/obj/Debug/ResolveAssemblyReference.cache and b/GMW/GMW_data/obj/Debug/ResolveAssemblyReference.cache differ diff --git a/GMW/GMW_data/obj/Debug/TempPE/DS_magazzino.Designer.cs.dll b/GMW/GMW_data/obj/Debug/TempPE/DS_magazzino.Designer.cs.dll index 344e35a6..a61f2229 100644 Binary files a/GMW/GMW_data/obj/Debug/TempPE/DS_magazzino.Designer.cs.dll and b/GMW/GMW_data/obj/Debug/TempPE/DS_magazzino.Designer.cs.dll differ