diff --git a/GMW/GMW/Web.config b/GMW/GMW/Web.config index 409e8547..5254f1f8 100644 --- a/GMW/GMW/Web.config +++ b/GMW/GMW/Web.config @@ -156,6 +156,11 @@ + + + + + diff --git a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx index e745e4f3..960cbf5d 100644 --- a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx +++ b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx @@ -1,8 +1,9 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_spostaDataMatrix.ascx.cs" Inherits="GMW.WebUserControls.mod_spostaDataMatrix" %> - -

- Area colorata di base x indicare cosa faccia, in alto codice gitterbox attivato

+ +
+ +

diff --git a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.cs b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.cs index 03fae8e0..ad14cef7 100644 --- a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.cs +++ b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.cs @@ -5,14 +5,73 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using GMW_data; +using SteamWare; namespace GMW.WebUserControls { public partial class mod_spostaDataMatrix : System.Web.UI.UserControl { + /// + /// controlli al caricamento pagina + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { + // se primo caricamento resetto gitterbox...) + if (!Page.IsPostBack) + { + currGitterBox = ""; + } checkBarcode(); + if (currGitterBox != "") + { + lblGitterBoxAttivo.Text = string.Format("Gitterbox selezionato {0}", currGitterBox); + } + else + { + lblGitterBoxAttivo.Text = "..."; + } + } + /// + /// indica il gitterbox correntemente selezionato + /// + protected string currGitterBox + { + get + { + return memLayer.ML.StringSessionObj("currGitterBox"); + } + set + { + memLayer.ML.setSessionVal("currGitterBox", value); + } + } + /// + /// controllo booleano sul gitterbox se sia ok x caricamento altri pezzi (ovvero en contiene meno del max consentito + /// + protected bool gitterboxOk + { + get + { + bool answ = false; + int maxPezzi = memLayer.ML.confReadInt("qtaOdette"); + int numPezzi = maxPezzi; + try + { + numPezzi = (int)MagClass.magazzino.taElencoCartellini.getByUdc(currGitterBox)[0].Qta; + } + catch + { + logger.lg.scriviLog(string.Format("Non sono riuscito a torvare dati per il gitterbox {0}", currGitterBox), tipoLog.ERROR); + } + // controllo se il codice sia "Pieno", ovvero max pezzi + if (numPezzi < maxPezzi) + { + answ = true; + } + return answ; + } } /// /// controlla se ci sia un barcode @@ -25,15 +84,31 @@ namespace GMW.WebUserControls switch (tipoBCode) { case tipoCodiceBarcode.Gitterbox: - // imposto il gitterbox di destinazione al nuovo codice - - lblMessaggi.Text += " - impostato nuovo gitterbox di destinazione!"; + // imposto il gitterbox corrente + currGitterBox = barcodeIn; + if (gitterboxOk) + { + lblMessaggi.Text += " - impostato nuovo gitterbox di destinazione!"; + } + else + { + lblMessaggi.Text += " - gitterbox pieno!!! impostato, ma non si possono versare altri pezzi."; + } break; case tipoCodiceBarcode.DataMatrix: // se c'è un gitterbox attivo sposto il datamatrix - if (true) + if (currGitterBox != "") { - lblMessaggi.Text += " - spostato nel gitterbox attivo!"; + if (gitterboxOk) + { + // effettuo spostamento del datamatrix nel nuovo gitterbox + DataMatrix.mgr.taElencoDM.spostaInGitterbox(Convert.ToDecimal(barcodeIn), currGitterBox); + lblMessaggi.Text += " - spostato nel gitterbox attivo!"; + } + else + { + lblMessaggi.Text += " - il gitterbox è pieno!!!"; + } } else { @@ -41,6 +116,25 @@ namespace GMW.WebUserControls lblMessaggi.Text += " - errore, manca un gitterbox di destinazione!"; } break; + case tipoCodiceBarcode.Comando: + // controllo se è svuota gitterbox, nel caso lo svuoto + string cmdSvuotaGbox = memLayer.ML.confReadString("cmdSvuotaGitterBox"); + string cmdEsci = memLayer.ML.confReadString("cmdEsci"); + if (barcodeIn == cmdSvuotaGbox) + { + DataMatrix.mgr.taElencoDM.svuotaGitterbox(currGitterBox); + lblMessaggi.Text += " - Gitterbox svuotato!"; + } + else if (barcodeIn == cmdEsci) + { + currGitterBox = ""; + Response.Redirect("~/menu.aspx"); + } + else + { + lblMessaggi.Text += " - codice comando non riconosciuto!"; + } + break; default: lblMessaggi.Text += " - codice non riconosciuto!"; break; @@ -62,26 +156,36 @@ namespace GMW.WebUserControls { tipoCodiceBarcode answ = tipoCodiceBarcode.ND; int trovati = 0; - try + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.confReadString("prefComandi"); + if (barcodeIn.StartsWith(preCmd)) { - // cerco tra gitterbox (UDC)... - trovati = MagClass.magazzino.taElencoCartellini.getByUdc(barcodeIn).Rows.Count; - // cerco tra datamatrix - if (trovati> 0) + answ = tipoCodiceBarcode.Comando; + } + else + { + try { - answ = tipoCodiceBarcode.Gitterbox; - } - else - { - trovati = DataMatrix.mgr.taElencoDM.getByCode(Convert.ToDecimal(barcodeIn)).Rows.Count; + // cerco tra gitterbox (UDC)... + trovati = MagClass.magazzino.taElencoCartellini.getByUdc(barcodeIn).Rows.Count; + // cerco tra datamatrix if (trovati > 0) { - answ = tipoCodiceBarcode.DataMatrix; + answ = tipoCodiceBarcode.Gitterbox; } + else + { + trovati = DataMatrix.mgr.taElencoDM.getByCode(Convert.ToDecimal(barcodeIn)).Rows.Count; + if (trovati > 0) + { + answ = tipoCodiceBarcode.DataMatrix; + } + } + + } + catch + { } - } - catch - { } return answ; } @@ -100,5 +204,15 @@ namespace GMW.WebUserControls txtBarcode.Text = value; } } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppsercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } } } \ No newline at end of file diff --git a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.designer.cs b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.designer.cs index 8b862f35..33604023 100644 --- a/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.designer.cs +++ b/GMW/GMW/WebUserControls/mod_spostaDataMatrix.ascx.designer.cs @@ -22,6 +22,15 @@ namespace GMW.WebUserControls { /// protected global::System.Web.UI.WebControls.Panel pnlAll; + /// + /// lblGitterBoxAttivo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGitterBoxAttivo; + /// /// lblBarcode control. /// diff --git a/GMW/GMW/bin/GMW.dll b/GMW/GMW/bin/GMW.dll index cfe2e698..0ade077f 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 6d426cae..de62b0ab 100644 Binary files a/GMW/GMW/bin/GMW_data.dll and b/GMW/GMW/bin/GMW_data.dll differ diff --git a/GMW/GMW/mazzAppSettings.config b/GMW/GMW/mazzAppSettings.config index 8c86b2f2..91ea6087 100644 --- a/GMW/GMW/mazzAppSettings.config +++ b/GMW/GMW/mazzAppSettings.config @@ -101,6 +101,11 @@ + + + + + diff --git a/GMW/GMW/obj/Debug/GMW.dll b/GMW/GMW/obj/Debug/GMW.dll index cfe2e698..0ade077f 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 89c1ca6e..28a84cec 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_DataMatrix.Designer.cs b/GMW/GMW_data/DS_DataMatrix.Designer.cs index da9895d6..13b005e6 100644 --- a/GMW/GMW_data/DS_DataMatrix.Designer.cs +++ b/GMW/GMW_data/DS_DataMatrix.Designer.cs @@ -1880,7 +1880,7 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; + 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 CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, " + @@ -1895,11 +1895,24 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodDataMatrix", global::System.Data.SqlDbType.Decimal, 13, global::System.Data.ParameterDirection.Input, 23, 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_DtMtrx_import"; + this._commandCollection[2].CommandText = "dbo.stp_EDM_spostaDataMtx"; 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.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("@CodDataMatrix", global::System.Data.SqlDbType.Decimal, 13, global::System.Data.ParameterDirection.Input, 23, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodGitterbox", global::System.Data.SqlDbType.NVarChar, 10, 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_DtMtrx_import"; + 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("@CodCS", global::System.Data.SqlDbType.VarChar, 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("@IdxPosizione", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_EDM_svuotaGitterbox"; + 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("@CodGitterbox", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -1940,6 +1953,28 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, 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_DataMatrix.ElencoDataMatrixDataTable spostaInGitterbox(global::System.Nullable CodDataMatrix, string CodGitterbox) { + this.Adapter.SelectCommand = this.CommandCollection[2]; + if ((CodDataMatrix.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((decimal)(CodDataMatrix.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + if ((CodGitterbox == null)) { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = ((string)(CodGitterbox)); + } + DS_DataMatrix.ElencoDataMatrixDataTable dataTable = new DS_DataMatrix.ElencoDataMatrixDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int Update(DS_DataMatrix.ElencoDataMatrixDataTable dataTable) { @@ -2390,7 +2425,7 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int stp_DtMtrx_import(string CodCS, global::System.Nullable IdxPosizione) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((CodCS == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -2419,6 +2454,33 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, } return returnValue; } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int svuotaGitterbox(string CodGitterbox) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + if ((CodGitterbox == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodGitterbox)); + } + 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_DataMatrix.xsd b/GMW/GMW_data/DS_DataMatrix.xsd index bd0fa4d5..00ee99d0 100644 --- a/GMW/GMW_data/DS_DataMatrix.xsd +++ b/GMW/GMW_data/DS_DataMatrix.xsd @@ -189,6 +189,18 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, + + + + dbo.stp_EDM_spostaDataMtx + + + + + + + + @@ -201,6 +213,17 @@ SELECT CodDataMatrix, CodGitterbox, NumConchiglia, NumDisegno, EsponenteDisegno, + + + + dbo.stp_EDM_svuotaGitterbox + + + + + + + diff --git a/GMW/GMW_data/DS_DataMatrix.xss b/GMW/GMW_data/DS_DataMatrix.xss index 92a44d22..9ab2f385 100644 --- a/GMW/GMW_data/DS_DataMatrix.xss +++ b/GMW/GMW_data/DS_DataMatrix.xss @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/GMW/GMW_data/GMW_data.csproj b/GMW/GMW_data/GMW_data.csproj index 3dd1a326..db4c0413 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/SqlScripts/GMW_00370.sql b/GMW/GMW_data/SqlScripts/GMW_00370.sql new file mode 100644 index 00000000..87f35058 --- /dev/null +++ b/GMW/GMW_data/SqlScripts/GMW_00370.sql @@ -0,0 +1,10 @@ + + + + + + + +-- registro versione... +INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(365, GETDATE()) +GO diff --git a/GMW/GMW_data/TermClass.cs b/GMW/GMW_data/TermClass.cs index e0dae199..093c7fe4 100644 --- a/GMW/GMW_data/TermClass.cs +++ b/GMW/GMW_data/TermClass.cs @@ -285,7 +285,11 @@ public enum tipoCodiceBarcode /// /// Codice datamatrix /// - DataMatrix + DataMatrix, + /// + /// codice che indica un comando (prefisso da web.config) + /// + Comando } /// /// elenco degli esiti per una sessione di login da terminalino diff --git a/GMW/GMW_data/bin/Debug/GMW_data.dll b/GMW/GMW_data/bin/Debug/GMW_data.dll index 6d426cae..de62b0ab 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 6d426cae..de62b0ab 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_DataMatrix.Designer.cs.dll b/GMW/GMW_data/obj/Debug/TempPE/DS_DataMatrix.Designer.cs.dll index cd21954a..61175c42 100644 Binary files a/GMW/GMW_data/obj/Debug/TempPE/DS_DataMatrix.Designer.cs.dll and b/GMW/GMW_data/obj/Debug/TempPE/DS_DataMatrix.Designer.cs.dll differ