diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 941b620..edba11e 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -5492,7 +5492,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[7]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[8]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_TaskList"; @@ -5525,19 +5525,25 @@ namespace AppData.DS_AppTableAdapters { this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LastDD", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_TL_insertQuery"; + this._commandCollection[5].CommandText = "dbo.stp_TL_ImportNew"; 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("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaRic", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[6].Connection = this.Connection; - this._commandCollection[6].CommandText = "dbo.stp_TL_updateClose"; + this._commandCollection[6].CommandText = "dbo.stp_TL_insertQuery"; this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Concluso", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaRic", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[7].Connection = this.Connection; + this._commandCollection[7].CommandText = "dbo.stp_TL_updateClose"; + this._commandCollection[7].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTask", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Concluso", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -5658,7 +5664,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int insertQuery(string NumTask, string CodArt, global::System.Nullable QtaRic) { + public virtual int ImportNew(string NumTask) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; if ((NumTask == null)) { command.Parameters[1].Value = global::System.DBNull.Value; @@ -5666,6 +5672,34 @@ namespace AppData.DS_AppTableAdapters { else { command.Parameters[1].Value = ((string)(NumTask)); } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int insertQuery(string NumTask, string CodArt, global::System.Nullable QtaRic) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + if ((NumTask == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(NumTask)); + } if ((CodArt == null)) { command.Parameters[2].Value = global::System.DBNull.Value; } @@ -5699,7 +5733,7 @@ namespace AppData.DS_AppTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateClose(string NumTask, global::System.Nullable Concluso) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7]; if ((NumTask == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -8754,7 +8788,7 @@ SELECT CodEvento, CodTipoEvento, DescrEvento, Action FROM AnagEventi WHERE (CodE [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] 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 idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, CodG" + @@ -8763,11 +8797,17 @@ SELECT CodEvento, CodTipoEvento, DescrEvento, Action FROM AnagEventi WHERE (CodE 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_PODL_getFilt"; + this._commandCollection[1].CommandText = "dbo.stp_PODL_getByKey"; 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("@CodPost", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@OnlyOpen", 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("@IdxPromessa", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_PODL_getFilt"; + 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("@CodPost", 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("@OnlyOpen", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -8798,8 +8838,25 @@ SELECT CodEvento, CodTipoEvento, DescrEvento, Action FROM AnagEventi WHERE (CodE [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_App.PODLDataTable getFilt(string CodPost, global::System.Nullable OnlyOpen) { + public virtual DS_App.PODLDataTable getByKey(global::System.Nullable IdxPromessa) { this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((IdxPromessa.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((int)(IdxPromessa.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + DS_App.PODLDataTable dataTable = new DS_App.PODLDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_App.PODLDataTable getFilt(string CodPost, global::System.Nullable OnlyOpen) { + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((CodPost == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index 3ce1500..7c1f217 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -80,6 +80,17 @@ FROM v_TaskList + + + + dbo.stp_TL_ImportNew + + + + + + + @@ -723,6 +734,17 @@ SELECT CodEvento, CodTipoEvento, DescrEvento, Action FROM AnagEventi WHERE (CodE + + + + dbo.stp_PODL_getByKey + + + + + + + diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index 5b3f722..3a531f0 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -4,16 +4,16 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - + diff --git a/AppData/dataLayer.cs b/AppData/dataLayer.cs index 3968d7a..0b2e744 100644 --- a/AppData/dataLayer.cs +++ b/AppData/dataLayer.cs @@ -21,6 +21,7 @@ namespace AppData taAF = new DS_AppTableAdapters.AnagFasiTableAdapter(); taAO = new DS_AppTableAdapters.AnagOprTableAdapter(); taAP = new DS_AppTableAdapters.AnagPostTableAdapter(); + taPODL = new DS_AppTableAdapters.PODLTableAdapter(); taTL = new DS_AppTableAdapters.TaskListTableAdapter(); taTR = new DS_AppTableAdapters.TaskRecTableAdapter(); taTE2S = new DS_AppTableAdapters.TraEv2StatiTableAdapter(); @@ -35,6 +36,7 @@ namespace AppData taAF.Connection.ConnectionString = connString; taAO.Connection.ConnectionString = connString; taAP.Connection.ConnectionString = connString; + taPODL.Connection.ConnectionString = connString; taTL.Connection.ConnectionString = connString; taTR.Connection.ConnectionString = connString; taTE2S.Connection.ConnectionString = connString; @@ -53,6 +55,10 @@ namespace AppData /// public DS_AppTableAdapters.AnagPostTableAdapter taAP; /// + /// Elenco PROMESSE ODL + /// + public DS_AppTableAdapters.PODLTableAdapter taPODL; + /// /// Elenco TASK /// public DS_AppTableAdapters.TaskListTableAdapter taTL; diff --git a/C-TRACK/WebUserControls/mod_barcode.ascx.cs b/C-TRACK/WebUserControls/mod_barcode.ascx.cs index ee95b36..6b1ced0 100644 --- a/C-TRACK/WebUserControls/mod_barcode.ascx.cs +++ b/C-TRACK/WebUserControls/mod_barcode.ascx.cs @@ -161,12 +161,7 @@ namespace C_TRACK.WebUserControls comando.isValid = true; comando.valore = BCodeVal; _tabValori.TryGetValue(BCodeVal, out comando.valoreTrad); - } - // se NON trovato ma abilitato import da MAPO eventualmente verifico se ci sia anche li... - if (!comando.isValid && memLayer.ML.CRB("OptEnableMapoIn")) - { - // cerco in tab dei PODL, SE TROVO importo e ricarico _tabValori - } + } } /// /// verifica se il comando inserito sia valido diff --git a/C-TRACK/WebUserControls/mod_selTask.ascx b/C-TRACK/WebUserControls/mod_selTask.ascx index 8788f55..a03d90c 100644 --- a/C-TRACK/WebUserControls/mod_selTask.ascx +++ b/C-TRACK/WebUserControls/mod_selTask.ascx @@ -1,13 +1,16 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_selTask.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_selTask" %> - + + + Selezione + - + - +
@@ -27,9 +30,6 @@
- <%----%> - <%----%> - <%----%>
@@ -38,7 +38,6 @@ - <%----%> diff --git a/C-TRACK/WebUserControls/mod_selTask.ascx.cs b/C-TRACK/WebUserControls/mod_selTask.ascx.cs index 48147a4..fd5fee6 100644 --- a/C-TRACK/WebUserControls/mod_selTask.ascx.cs +++ b/C-TRACK/WebUserControls/mod_selTask.ascx.cs @@ -1,17 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; +using AppData; +using SteamWare; +using System; namespace C_TRACK.WebUserControls { public partial class mod_selTask : System.Web.UI.UserControl { + + /// + /// evento selezione dati + /// + public event EventHandler eh_dataSel; + protected void Page_Load(object sender, EventArgs e) { } + + protected void grView_SelectedIndexChanged(object sender, EventArgs e) + { + // selezionata una richiesta + int idxProm = 0; + int.TryParse(grView.SelectedValue.ToString(), out idxProm); + if (idxProm > 0) + { + // --> ho IdxPromessa --> recupero KeyRichiesta = CurrNumTask + var tab = dataLayer.man.taPODL.getByKey(idxProm); + string _numTask = ""; + if (tab.Rows.Count > 0) + { + // recupero NumTask + _numTask = tab[0].KeyRichiesta; + if (_numTask != "") + { + // verifica preliminare se vada creato Task... + checkTask(CurrNumTask); + // salvo commessa + CurrNumTask = _numTask; + // segnalo update + + if (eh_dataSel != null) + { + eh_dataSel(this, new EventArgs()); + } + } + } + } + } + /// + /// Verifica se il task vada importato + /// + /// + private void checkTask(string numTask) + { + dataLayer.man.taTL.ImportNew(numTask); + } + + /// + /// Codice TASK corrente + /// + public string CurrNumTask + { + get + { + return memLayer.ML.StringSessionObj("CurrNumTask"); + } + set + { + memLayer.ML.setSessionVal("CurrNumTask", value); + } + } } } \ No newline at end of file diff --git a/C-TRACK/barcode.aspx.cs b/C-TRACK/barcode.aspx.cs index 132fed4..eb86569 100644 --- a/C-TRACK/barcode.aspx.cs +++ b/C-TRACK/barcode.aspx.cs @@ -79,37 +79,28 @@ namespace C_TRACK checkRequisiti(); // effettuo load valori... setupComandiBarcode(); - checkImportData(); setupValoriBarcode(); // registro eventi mod_barcode1.eh_comandoRegistrato += new EventHandler(mod_barcode1_eh_comandoRegistrato); mod_btnComandi1.eh_clickComando += new EventHandler(mod_btnComandi1_eh_clickComando); + mod_selTask.eh_dataSel += Mod_selTask_eh_dataSel; } - /// - /// Verifica visibilità componenti bcode e selettore... - /// + + private void Mod_selTask_eh_dataSel(object sender, EventArgs e) + { + // selezione commessa.. + Response.Redirect("~/barcode"); + } + + /// + /// Verifica visibilità componenti bcode e selettore... + /// private void checkVisib() { mod_barcode1.Visible = memLayer.ML.CRB("OptUseBCode"); mod_selTask.Visible = memLayer.ML.CRB("OptUseSelTask"); } - - /// - /// Verifica se ci siano dati da importare come TaskList, nel caso importo ed invalida i valori ammessi - /// - private void checkImportData() - { - // verifico se sia abilitato import da MAPO in primis... - if (memLayer.ML.CRB("OptEnableMapoIn")) - { - // verifico SE ci siano NUOVI PODL da importare - - // se ci sono carico TaskList e li segno come importati - - // invalido cache valori... - } - } - + /// /// Verifica i requisiti (operatore e postazione) per operare ///