From e8aaa6d4e2e6b2bed40e641549c2b4cb83dc77e9 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 25 May 2017 12:35:36 +0200 Subject: [PATCH] inserita gestione limitazione qtaMax UDC da anagrafica (sia modifica, sia sparando datamatrix) --- GMW/WebUserControls/mod_PostFin_DT.ascx.cs | 127 ++++++++------------- GMW_data/DS_Applicazione.xsd | 41 ++++--- GMW_data/DS_Applicazione.xss | 50 ++++---- GMW_data/DS_Applicazione1.Designer.cs | 67 ++++++++--- 4 files changed, 152 insertions(+), 133 deletions(-) diff --git a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs index 7488a43d..7be29bf7 100644 --- a/GMW/WebUserControls/mod_PostFin_DT.ascx.cs +++ b/GMW/WebUserControls/mod_PostFin_DT.ascx.cs @@ -155,9 +155,6 @@ namespace GMW.WebUserControls { fixCssAL("success"); } - lbtPrendeCaricoAL.Visible = showBtn; - // X btn chiusura: solo chiudo SOLO se c'è AL in carico.. - lbtChiudiAL.Visible = (currAL != ""); // ora controllo btn quantità showBtn = false; if (grViewDest.SelectedIndex >= 0) @@ -537,7 +534,6 @@ namespace GMW.WebUserControls // crea UDC DEST... udcDest = checkCreaUDC(); } - procDtx(udcDest); checkUpdateTablet(udcDest); } @@ -548,68 +544,6 @@ namespace GMW.WebUserControls } } } - -#if false - // verifico DTX sia in quelli dell'AL sorgente - if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(sourceAL, barcodeIn).Rows.Count > 0) - { - // cerco se ci sia UDC di destinazione - DateTime adesso = DateTime.Now; - try - { - OldUDC = DataMatrix.mgr.taDtx2UDC.getByDtxAl(sourceAL, barcodeIn)[0].UDC; - IdxPosizione = MagClass.magazzino.taCartellini.getByUdc(OldUDC)[0].IdxPosizione; - currParticolare = MagClass.magazzino.taCartellini.getByUdc(OldUDC)[0].Particolare; - } - catch - { - currParticolare = ""; - } - if (currParticolare != "") - { - try - { - NewUDC = MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL)[0].UDC; - } - catch - { - NewUDC = ""; - } - if (NewUDC == "") - { - // CASO 01: DTX in AL sorgente, particolare OK, NON C'E' UDC dest - procDtx_Caso01(ref OldUDC, ref NewUDC, adesso); - } - else - { - // CASO 02: DTX in AL sorgente, particolare OK, C'E' UDC dest - OldUDC = procDtx_Caso02(OldUDC, NewUDC); - } - checkUpdateTablet(NewUDC); - } - else - { - Postazione.messaggiText = barcodeIn; - Postazione.warningText = traduci("UdcNonTrovato"); - Postazione.CssClass = cssErr; - } - } - // se non lo trovo in AL sorgente... - else - { - // faccio ulteriore verifica: se il datamatrix sia "libero" o già tra i "Missing In Action".. - if (DataMatrix.mgr.taDtxAvailFree.GetData(barcodeIn).Rows.Count > 0) - { - // CASO 03: DTX NON in sorgente ma libero/missing in action - NewUDC = procDtx_Caso03(NewUDC); - } - else - { - // CASO 04: DTX NON in sorgente e NON libero/missing in action - procDTX_Caso04(ref OldUDC, ref IdxPosizione, ref NewUDC); - } - } -#endif } break; default: @@ -625,6 +559,24 @@ namespace GMW.WebUserControls #region metodi processing DataMatrix letto da BarCode + /// + /// max quantità da anagrafica... + /// + public int maxQta + { + get + { + int answ = 0; + // calcola qtaMax da particoalre corrente... + try + { + answ = DataProxy.obj.taAnagPartImb.getByStatoParticolare(CodCs, statoUDC, currParticolare)[0].QtaStd; + } + catch + { } + return answ; + } + } /// /// processo DTX... /// @@ -636,7 +588,7 @@ namespace GMW.WebUserControls // verifico se sia modalità "rimozione" datamatrix x cui tolgo i datamatrix dall'UDC finale.. if (chkDtxMode.Checked) { - // verifico che sia nell'AL DEST x ptoer rimuovere... + // verifico che sia nell'AL DEST x poter rimuovere... if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count != 1) { Postazione.warningText = traduci("ERR-DTX-018"); @@ -654,21 +606,30 @@ namespace GMW.WebUserControls } else { - // verifico che sia nell'AL DEST x ptoer rimuovere... - if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1) + // verifico qtaMax NON sia superata... + if (MagClass.magazzino.taA2U2D.getByUDC(udcDest)[0].QtaDtx >= maxQta) { - Postazione.warningText = traduci("ERR-DTX-006"); - Postazione.CssClass = cssAtt; + Postazione.warningText = traduci("ERR-UDC-DTX-005"); + Postazione.CssClass = cssErr; } else { - // se lo trovo chiamo procedura di spostamento Dtx tra UDC sorgente --> dest (con eventuale creazione dest) - DataMatrix.mgr.taDtx2UDC.UpdateUDC(udcDest, barcodeIn, statoUDC, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, false, false); - // fix messaggi - Postazione.messaggiText += " " + traduci("ConfermatoDtx"); - Postazione.warningText = ""; - Postazione.CssClass = cssAtt; - fatto = true; + // verifico che NON sia nell'AL DEST x poter aggiungere... + if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1) + { + Postazione.warningText = traduci("ERR-DTX-006"); + Postazione.CssClass = cssAtt; + } + else + { + // se lo trovo chiamo procedura di spostamento Dtx tra UDC sorgente --> dest (con eventuale creazione dest) + DataMatrix.mgr.taDtx2UDC.UpdateUDC(udcDest, barcodeIn, statoUDC, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, false, false); + // fix messaggi + Postazione.messaggiText += " " + traduci("ConfermatoDtx"); + Postazione.warningText = ""; + Postazione.CssClass = cssAtt; + fatto = true; + } } } return fatto; @@ -883,6 +844,16 @@ namespace GMW.WebUserControls doUpdate(); } /// + /// Metodo aggiornamento qta + /// + public override void aggiornaQta() + { + // verifico NON sia superata la quantità MAX permessa... + qta = qta > maxQta ? maxQta : qta; + // eseguo metodo base! + base.aggiornaQta(); + } + /// /// verifica visibilità btn stampa UDC /// private void verificaBtnStampa() diff --git a/GMW_data/DS_Applicazione.xsd b/GMW_data/DS_Applicazione.xsd index 73971afc..ce66ff7d 100644 --- a/GMW_data/DS_Applicazione.xsd +++ b/GMW_data/DS_Applicazione.xsd @@ -2446,6 +2446,19 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba + + + + dbo.stp_API_getByStatoPart + + + + + + + + + @@ -3616,7 +3629,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3662,7 +3675,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3720,7 +3733,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3741,7 +3754,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3776,7 +3789,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3856,7 +3869,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -3924,7 +3937,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -4031,7 +4044,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - + @@ -4180,12 +4193,12 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba - - - - - - + + + + + + \ No newline at end of file diff --git a/GMW_data/DS_Applicazione.xss b/GMW_data/DS_Applicazione.xss index 0500c152..c7425f9e 100644 --- a/GMW_data/DS_Applicazione.xss +++ b/GMW_data/DS_Applicazione.xss @@ -4,22 +4,22 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - - + + @@ -33,34 +33,34 @@ - + - 1175 - 190 + 1173 + 227 - 1077 - 190 + 1060 + 227 + + + 1060 + 210 - 1216 - 327 - - - 1216 - 368 + 1173 + 288 824 - 368 + 288 @@ -80,15 +80,15 @@ - + - 1175 - 327 + 1173 + 381 1153 - 327 + 381 1153 @@ -103,16 +103,16 @@ - 1262 - 327 + 1260 + 412 - 1262 - 419 + 1260 + 420 1288 - 419 + 420 diff --git a/GMW_data/DS_Applicazione1.Designer.cs b/GMW_data/DS_Applicazione1.Designer.cs index 8c44e941..386f2323 100644 --- a/GMW_data/DS_Applicazione1.Designer.cs +++ b/GMW_data/DS_Applicazione1.Designer.cs @@ -10,10 +10,9 @@ #pragma warning disable 1591 -namespace GMW_data -{ - - +namespace GMW_data { + + /// ///Represents a strongly typed in-memory cache of data. /// @@ -20091,10 +20090,9 @@ namespace GMW_data } } } -namespace GMW_data.DS_ApplicazioneTableAdapters -{ - - +namespace GMW_data.DS_ApplicazioneTableAdapters { + + /// ///Represents the connection and commands used to retrieve and save data. /// @@ -32942,7 +32940,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM dbo.AnagParticolariI" + @@ -32958,16 +32956,24 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_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] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_API_UpdateQuery"; + this._commandCollection[2].CommandText = "dbo.stp_API_getByStatoPart"; 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("@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("@CodStato", global::System.Data.SqlDbType.NVarChar, 50, 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("@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("@QtaStd", global::System.Data.SqlDbType.Decimal, 9, global::System.Data.ParameterDirection.Input, 10, 2, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_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("@Original_CodStato", global::System.Data.SqlDbType.NVarChar, 50, 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_Particolare", global::System.Data.SqlDbType.NVarChar, 15, 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_API_UpdateQuery"; + 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("@CodStato", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Particolare", global::System.Data.SqlDbType.NVarChar, 15, 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("@CodImballo", global::System.Data.SqlDbType.NVarChar, 15, 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("@QtaStd", 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("@Original_CodCS", global::System.Data.SqlDbType.NChar, 2, 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("@Original_CodStato", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Particolare", global::System.Data.SqlDbType.NVarChar, 15, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -32994,6 +33000,35 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba return dataTable; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_Applicazione.AnagParticolariImballiDataTable getByStatoParticolare(string CodCS, string CodStato, string Particolare) { + this.Adapter.SelectCommand = this.CommandCollection[2]; + if ((CodCS == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodCS)); + } + if ((CodStato == null)) { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = ((string)(CodStato)); + } + if ((Particolare == null)) { + this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[3].Value = ((string)(Particolare)); + } + DS_Applicazione.AnagParticolariImballiDataTable dataTable = new DS_Applicazione.AnagParticolariImballiDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] @@ -33240,7 +33275,7 @@ SELECT CodCS, CodStato, Particolare, CodImballo, QtaStd FROM AnagParticolariImba [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, false)] public virtual int UpdateQuery(string CodStato, string Particolare, string CodImballo, global::System.Nullable QtaStd, string Original_CodCS, string Original_CodStato, string Original_Particolare) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((CodStato == null)) { command.Parameters[1].Value = global::System.DBNull.Value; }