diff --git a/GMW/GMW/GMW.csproj b/GMW/GMW/GMW.csproj index 0cde506b..4b15c247 100644 --- a/GMW/GMW/GMW.csproj +++ b/GMW/GMW/GMW.csproj @@ -141,13 +141,6 @@ StatoMag.aspx - - Test.aspx - ASPXCodeBehind - - - Test.aspx - unauthorized.aspx ASPXCodeBehind @@ -372,13 +365,6 @@ mod_filtro.ascx - - mod_funzioniVarieTest.ascx - ASPXCodeBehind - - - mod_funzioniVarieTest.ascx - mod_lemmiVocab.ascx ASPXCodeBehind @@ -749,7 +735,6 @@ - @@ -836,7 +821,6 @@ - diff --git a/GMW/GMW/WebUserControls/mod_elencoListePrelievo.ascx.cs b/GMW/GMW/WebUserControls/mod_elencoListePrelievo.ascx.cs index ebf9d8e9..5c164bd1 100644 --- a/GMW/GMW/WebUserControls/mod_elencoListePrelievo.ascx.cs +++ b/GMW/GMW/WebUserControls/mod_elencoListePrelievo.ascx.cs @@ -566,15 +566,13 @@ namespace GMW.WebUserControls parametroLista.PropertyName = "valore"; parametroLista.Name = "CodStato"; parametroLista.DefaultValue = "0"; - ods.FilterParameters.Add(parametroLista); + ods.FilterParameters.Add(parametroLista); } -#if false // chiamo procedura che aggiorna ods principale - ods.DataBind(); + grView.SelectedIndex = -1; updateOds(); // ridisegno controllo child! aggiornaElencoRighe(); -#endif } /// /// restituisce URL immagine del codice da mostrare diff --git a/GMW/GMW/WebUserControls/mod_viewRigheListaPrelievo.ascx.cs b/GMW/GMW/WebUserControls/mod_viewRigheListaPrelievo.ascx.cs index b719e671..691894b0 100644 --- a/GMW/GMW/WebUserControls/mod_viewRigheListaPrelievo.ascx.cs +++ b/GMW/GMW/WebUserControls/mod_viewRigheListaPrelievo.ascx.cs @@ -326,7 +326,7 @@ namespace GMW.WebUserControls // controllo SE sia ancora prelevabile questo UDC... if (!udcPrelevato(UDC)) { - GMW_data.MagClass.magazzino.confermaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC); + GMW_data.MagClass.magazzino.confermaUdcPrelevatoPerLista(codLista, UDC); } updateOdsDaFiltro(); grView.EditIndex = -1; @@ -340,7 +340,7 @@ namespace GMW.WebUserControls e.Cancel = true; break; case "annullaPrelievo": - GMW_data.MagClass.magazzino.annullaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC); + GMW_data.MagClass.magazzino.annullaUdcPrelevatoPerLista(codLista, UDC); updateOdsDaFiltro(); grView.EditIndex = -1; grView.DataBind(); @@ -353,7 +353,7 @@ namespace GMW.WebUserControls e.Cancel = true; break; case "scambiaFifo": - //GMW_data.MagClass.magazzino.annullaUdcPrelevatoPerLista(memLayer.ML.StringSessionObj("CodCS"), codLista, UDC); + GMW_data.MagClass.magazzino.scambiaUdcPerLista(codLista); updateOdsDaFiltro(); grView.EditIndex = -1; grView.DataBind(); diff --git a/GMW/GMW/bin/GMW.dll b/GMW/GMW/bin/GMW.dll index 7682988c..7dde6a79 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 175e30a5..45292822 100644 Binary files a/GMW/GMW/bin/GMW_data.dll and b/GMW/GMW/bin/GMW_data.dll differ diff --git a/GMW/GMW/obj/Debug/GMW.dll b/GMW/GMW/obj/Debug/GMW.dll index 7682988c..7dde6a79 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 1583f29c..a8649b27 100644 Binary files a/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache and b/GMW/GMW/obj/Debug/ResolveAssemblyReference.cache differ diff --git a/GMW/GMW_data/DS_magazzino.Designer.cs b/GMW/GMW_data/DS_magazzino.Designer.cs index 78848f4c..6705faca 100644 --- a/GMW/GMW_data/DS_magazzino.Designer.cs +++ b/GMW/GMW_data/DS_magazzino.Designer.cs @@ -10120,7 +10120,7 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5]; 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"; @@ -10141,14 +10141,20 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno 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[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; - this._commandCollection[3].CommandText = "dbo.stp_UDC_updateQty"; + this._commandCollection[3].CommandText = "dbo.stp_getUDC_UnusedOlder"; 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.VarChar, 20, 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("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 16, 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("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, 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("@CodEvento", global::System.Data.SqlDbType.VarChar, 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("@Qta", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodLista", global::System.Data.SqlDbType.VarChar, 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_UDC_updateQty"; + 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.VarChar, 20, 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("@CodSoggetto", global::System.Data.SqlDbType.VarChar, 16, 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("@CodTipoDichiaraz", global::System.Data.SqlDbType.Char, 1, 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("@CodEvento", global::System.Data.SqlDbType.VarChar, 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("@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()] @@ -10220,8 +10226,24 @@ 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 getUdcUnusedOlder(string CodLista) { this.Adapter.SelectCommand = this.CommandCollection[3]; + if ((CodLista == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodLista)); + } + 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[4]; if ((UDC == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -16835,7 +16857,7 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[6]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM dbo.RigheListePrelievo"; @@ -16861,11 +16883,17 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, 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_UDC_upsertPrelevato"; + this._commandCollection[4].CommandText = "dbo.stp_RigheListePrelievo_eliminaNonPrelevate"; 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("@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].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, 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("@CodLista", global::System.Data.SqlDbType.VarChar, 12, global::System.Data.ParameterDirection.Input, 0, 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_UDC_upsertPrelevato"; + 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("@CodLista", global::System.Data.SqlDbType.NVarChar, 12, 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("@UDC", 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()] @@ -16948,7 +16976,7 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_magazzino.RigheListePrelievoDataTable upsertPrelevato(string CodLista, string UDC) { - this.Adapter.SelectCommand = this.CommandCollection[4]; + this.Adapter.SelectCommand = this.CommandCollection[5]; if ((CodLista == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -17165,6 +17193,33 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co public virtual int Update(decimal Qta, global::System.Nullable Proposto, global::System.Nullable Prelevato, string Original_CodLista, string Original_UDC, decimal Original_Qta, global::System.Nullable Original_Proposto, global::System.Nullable Original_Prelevato) { return this.Update(Original_CodLista, Original_UDC, Qta, Proposto, Prelevato, Original_CodLista, Original_UDC, Original_Qta, Original_Proposto, Original_Prelevato); } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int stp_RigheListePrelievo_eliminaNonPrelevate(string CodLista) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + 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; + } } /// diff --git a/GMW/GMW_data/DS_magazzino.xsd b/GMW/GMW_data/DS_magazzino.xsd index 561820cc..feb2c463 100644 --- a/GMW/GMW_data/DS_magazzino.xsd +++ b/GMW/GMW_data/DS_magazzino.xsd @@ -241,6 +241,17 @@ SELECT UDC, CodCS, CodCliente, RagSociale, Particolare, DescParticolare, Disegno + + + + dbo.stp_getUDC_UnusedOlder + + + + + + + @@ -1532,6 +1543,17 @@ SELECT CodLista, UDC, Qta, Proposto, Prelevato FROM RigheListePrelievo WHERE (Co + + + + dbo.stp_RigheListePrelievo_eliminaNonPrelevate + + + + + + + diff --git a/GMW/GMW_data/DS_magazzino.xss b/GMW/GMW_data/DS_magazzino.xss index 49df5a38..84459db2 100644 --- a/GMW/GMW_data/DS_magazzino.xss +++ b/GMW/GMW_data/DS_magazzino.xss @@ -6,7 +6,7 @@ --> - + @@ -19,7 +19,7 @@ - + @@ -103,7 +103,7 @@ 133 - 659 + 714 133 @@ -118,7 +118,7 @@ 949 - 363 + 325 949 diff --git a/GMW/GMW_data/MagClass.cs b/GMW/GMW_data/MagClass.cs index 9b5bc066..5cd2eff8 100644 --- a/GMW/GMW_data/MagClass.cs +++ b/GMW/GMW_data/MagClass.cs @@ -94,6 +94,66 @@ namespace GMW_data #endregion + #region metodi protected + + /// + /// aggiunge le righe liste di prelievo necessarie a soddisfare la richiesta in logica FIFO dato un elenco di cartellini, la qta totale da allocare e la lista attuale + /// + /// + /// + /// + private void allocaRigheListaPrelievo(decimal QtaTot, string codListaAttuale, DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini) + { + //ricavo il valore UDC della riga del più vecchio + string udcAttuale; + bool qtaOk = false; + bool dataFinished = false; + int progrUdc = 0; + int numUdcDisponibili = tabellaElencoCartellini.Rows.Count; + // contiene la quantità della riga attuale + decimal qtaRiga; + // somma progressiva della qta allocata - calcolo da db! + decimal qtaAllocata = taElencoListePrelievo.getByCodLista(codListaAttuale)[0].Prelevato; + //ciclo WHILE per lo riempimento FIFO con UDC secondo richiesta a partire da elenco fornito + 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); + * + * */ + // ricavo la riga più vecchia + qtaRiga = tabellaElencoCartellini[progrUdc].Qta; + udcAttuale = tabellaElencoCartellini[progrUdc].UDC; + // eseguo query di insert + taRigheListePrelievo.Insert(codListaAttuale, udcAttuale, qtaRiga, true, false); + + //incremento qta allocata + qtaAllocata = (qtaAllocata + qtaRiga); + //incremento contatore + progrUdc++; + + // verifico le condizioni, false se non cambia nulla true se cambia e si esce dal while + qtaOk = (qtaAllocata >= QtaTot); + dataFinished = (progrUdc >= numUdcDisponibili); + } + } + + #endregion + #region Metodi esposti /// @@ -243,64 +303,13 @@ namespace GMW_data if (codListaAttuale != "") { answ = codListaAttuale; - // stored per ricavare il più vecchio in ordine ASC per Data Fusione - TABELLA DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini = taElencoCartellini.getOlderUDC(Esponente, Particolare, idxPosizione); - - //ricavo il valore UDC della riga del più vecchio - string udcAttuale; - bool qtaOk = false; - bool dataFinished = false; - int progrUdc = 0; - int numUdcDisponibili = tabellaElencoCartellini.Rows.Count; - // contiene la quantità della riga attuale - decimal qtaRiga; - // somma progressiva della 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); - * - * */ - // ricavo la riga più vecchia - qtaRiga = tabellaElencoCartellini[progrUdc].Qta; - udcAttuale = tabellaElencoCartellini[progrUdc].UDC; - // eseguo query di insert - taRigheListePrelievo.Insert(codListaAttuale, udcAttuale, qtaRiga, true, false); - - //incremento qta allocata - qtaAllocata = (qtaAllocata + qtaRiga); - //incremento contatore - progrUdc++; - - // verifico le condizioni, false se non cambia nulla true se cambia e si esce dal while - qtaOk = (qtaAllocata >= QtaTot); - dataFinished = (progrUdc >= numUdcDisponibili); - } + allocaRigheListaPrelievo(QtaTot, codListaAttuale, tabellaElencoCartellini); } - - return answ; } - - /// /// indica presa in carico di una lista di prelievo /// @@ -479,11 +488,10 @@ namespace GMW_data /// /// Verifica la corrispondenza dati tra RigheListePrelievo ed ElencoCartellini /// - /// /// /// /// - public bool verificaDatiUdc(string CodCS, string CodLista, string UDC) + public bool verificaDatiUdc(string CodLista, string UDC) { bool answ = false; @@ -521,20 +529,18 @@ namespace GMW_data return answ; } - /// /// Conferma che un dato UDC è stato prelevato per soddisfare la lista di prelievo ed aggiorna o aggiunge riga in RigheListePrelievo /// - /// Codice company/sito /// codice della lista di prelievo /// Codice UDC /// esito comando - public esitoOperazione confermaUdcPrelevatoPerLista(string CodCS, string CodLista, string UDC) + public esitoOperazione confermaUdcPrelevatoPerLista(string CodLista, string UDC) { esitoOperazione answ = esitoOperazione.errore; // verifico che i dati corrispondano con il metodo relativo (vedi sopra) - bool datiUdcOk = verificaDatiUdc(CodCS, CodLista, UDC); + bool datiUdcOk = verificaDatiUdc(CodLista, UDC); if (datiUdcOk) { @@ -554,11 +560,10 @@ namespace GMW_data /// /// annulla il prelievo di un UDC, aggiornando RigheListePrelievo (solo preventivato...) /// - /// Codice company/sito /// codice della lista di prelievo /// Codice UDC /// esito comando - public esitoOperazione annullaUdcPrelevatoPerLista(string CodCS, string CodLista, string UDC) + public esitoOperazione annullaUdcPrelevatoPerLista(string CodLista, string UDC) { esitoOperazione answ = esitoOperazione.errore; @@ -595,7 +600,32 @@ namespace GMW_data { } return answ; } + /// + /// Rigenera una Lista di prelievo togliendo gli UDC non ancora prelevati rimettendo in logica FIFO gli UDC "liberi" disponibili + /// + /// codice della lista di prelievo + /// esito comando + public esitoOperazione scambiaUdcPerLista(string CodLista) + { + esitoOperazione answ = esitoOperazione.errore; + /* + * Questa funzione va chiamata da web o da terminalino ogni volta che si fa una richiesta di cambio per un UDC già prelevato, ovvero un altro carrellista prelevato un UDC associato alla mia lista corrente - rigenera UDC da prelevare + * */ + try + { + // ricavo dati + DS_magazzino.ElencoListePrelievoRow riga = taElencoListePrelievo.getByCodLista(CodLista)[0]; + // svuoto PRIMA gli UDC non prelevati + taRigheListePrelievo.stp_RigheListePrelievo_eliminaNonPrelevate(CodLista); + // rigenero righe UDC da prelevare + DS_magazzino.ElencoCartelliniDataTable tabellaElencoCartellini = taElencoCartellini.getUdcUnusedOlder(CodLista); + allocaRigheListaPrelievo(riga.QtaTot, CodLista, tabellaElencoCartellini); + } + catch + { } + return answ; + } #endregion } diff --git a/GMW/GMW_data/bin/Debug/GMW_data.dll b/GMW/GMW_data/bin/Debug/GMW_data.dll index 175e30a5..45292822 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/obj/Debug/GMW_data.dll b/GMW/GMW_data/obj/Debug/GMW_data.dll index 175e30a5..45292822 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/TempPE/DS_magazzino.Designer.cs.dll b/GMW/GMW_data/obj/Debug/TempPE/DS_magazzino.Designer.cs.dll index 059ba2d7..c47f0143 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