From ee390a3b5b49e7d65c95bf42700f48a247de230b Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 4 Sep 2018 15:22:24 +0200 Subject: [PATCH] PRIMA VERSIONE CON CHIUSURA FASI!!!! --- AppData/DS_App.Designer.cs | 54 +++++-- AppData/DS_App.xsd | 12 ++ AppData/DS_App.xss | 22 +-- C-TRACK/C-TRACK.csproj | 8 + C-TRACK/WebUserControls/mod_faseCurr.ascx | 17 ++ C-TRACK/WebUserControls/mod_faseCurr.ascx.cs | 149 ++++++++++++++++++ .../mod_faseCurr.ascx.designer.cs | 24 +++ C-TRACK/barcode.aspx | 3 + C-TRACK/barcode.aspx.cs | 41 ++++- C-TRACK/barcode.aspx.designer.cs | 9 ++ 10 files changed, 315 insertions(+), 24 deletions(-) create mode 100644 C-TRACK/WebUserControls/mod_faseCurr.ascx create mode 100644 C-TRACK/WebUserControls/mod_faseCurr.ascx.cs create mode 100644 C-TRACK/WebUserControls/mod_faseCurr.ascx.designer.cs diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 3fcf380..d52d431 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -6238,7 +6238,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [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[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 *\r\nFROM v_TaskRec"; @@ -6257,22 +6257,29 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodOpr", global::System.Data.SqlDbType.NVarChar, 50, 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_TR_insertQuery"; + this._commandCollection[3].CommandText = "dbo.stp_TR_GetByPost"; 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("@CodOpr", 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("@CodPost", 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("@NumTask", 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("@CodFase", 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("@DtStart", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showAll", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 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_TR_updateQuery"; + this._commandCollection[4].CommandText = "dbo.stp_TR_insertQuery"; 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("@IdxRec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtEnd", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaEv", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodOpr", 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("@CodPost", 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("@NumTask", 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("@CodFase", 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("@DtStart", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, 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_TR_updateQuery"; + 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("@IdxRec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtEnd", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@QtaEv", 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()] @@ -6333,11 +6340,34 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; 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.TaskRecDataTable getByPost(string CodPost, global::System.Nullable showAll) { + this.Adapter.SelectCommand = this.CommandCollection[3]; + if ((CodPost == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodPost)); + } + if ((showAll.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[2].Value = ((bool)(showAll.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + DS_App.TaskRecDataTable dataTable = new DS_App.TaskRecDataTable(); + 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")] public virtual int insertQuery(string CodOpr, string CodPost, string NumTask, string CodFase, global::System.Nullable DtStart) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((CodOpr == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -6389,7 +6419,7 @@ SELECT CodOpr, Cognome, Nome FROM AnagOpr WHERE (CodOpr = @CodOpr)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQuery(global::System.Nullable IdxRec, global::System.Nullable DtEnd, global::System.Nullable QtaEv) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5]; if ((IdxRec.HasValue == true)) { command.Parameters[1].Value = ((int)(IdxRec.Value)); } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index c1bfa15..1512374 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -330,6 +330,18 @@ FROM v_TaskRec + + + + dbo.stp_TR_GetByPost + + + + + + + + diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index 6d38525..a5fb398 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -4,19 +4,19 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - - - - - + + + + + - + 897 @@ -28,7 +28,7 @@ - + 900 @@ -40,7 +40,7 @@ - + 481 @@ -52,7 +52,7 @@ - + 630 diff --git a/C-TRACK/C-TRACK.csproj b/C-TRACK/C-TRACK.csproj index f604420..e381b94 100644 --- a/C-TRACK/C-TRACK.csproj +++ b/C-TRACK/C-TRACK.csproj @@ -267,6 +267,7 @@ + @@ -513,6 +514,13 @@ mod_enrollByJumperAuthKey.ascx + + mod_faseCurr.ascx + ASPXCodeBehind + + + mod_faseCurr.ascx + mod_footer.ascx ASPXCodeBehind diff --git a/C-TRACK/WebUserControls/mod_faseCurr.ascx b/C-TRACK/WebUserControls/mod_faseCurr.ascx new file mode 100644 index 0000000..e5f5c78 --- /dev/null +++ b/C-TRACK/WebUserControls/mod_faseCurr.ascx @@ -0,0 +1,17 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_faseCurr.ascx.cs" Inherits="C_TRACK.WebUserControls.mod_faseCurr" %> + +
+
+ <%: DescPost %> +
+ <%: NomeOpr %> +
+
+
FASE
+ <%: DescFaseCurr %> +
+
+ quantita evasa + +
+
diff --git a/C-TRACK/WebUserControls/mod_faseCurr.ascx.cs b/C-TRACK/WebUserControls/mod_faseCurr.ascx.cs new file mode 100644 index 0000000..bbe6406 --- /dev/null +++ b/C-TRACK/WebUserControls/mod_faseCurr.ascx.cs @@ -0,0 +1,149 @@ +using AppData; +using SteamWare; +using System; + +namespace C_TRACK.WebUserControls +{ + public partial class mod_faseCurr : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + setupValori(); + } + } + + private void setupValori() + { + // recupero riga TR e popolo valori visualizzati + var tabTR = dataLayer.man.taTR.getByPost(CodPost, false); + if (tabTR.Rows.Count > 0) + { + DescFaseCurr = tabTR[0].DescrFase; + QtaFaseCurr = tabTR[0].QtaEv; + txtQta.Text = QtaFaseCurr.ToString(); + idxRecCurr = tabTR[0].IdxRec; + } + } + + /// + /// Descrizione fase attiva + /// + public string DescFaseCurr + { + get + { + return memLayer.ML.StringSessionObj("DescFaseCurr"); + } + set + { + memLayer.ML.setSessionVal("DescFaseCurr", value); + } + } + /// + /// Qta della fase attiva + /// + public int QtaFaseCurr + { + get + { + return memLayer.ML.IntSessionObj("QtaFaseCurr"); + } + set + { + memLayer.ML.setSessionVal("QtaFaseCurr", value); + } + } + /// + /// idxRec della fase attiva + /// + public int idxRecCurr + { + get + { + return memLayer.ML.IntSessionObj("idxRecCurr"); + } + set + { + memLayer.ML.setSessionVal("idxRecCurr", value); + } + } + /// + /// Codice postazione di lavoro + /// + public string CodPost + { + get + { + return memLayer.ML.StringSessionObj("CodPost"); + } + } + /// + /// Codice Operatore + /// + public string CodOpr + { + get + { + return memLayer.ML.StringSessionObj("CodOpr"); + } + } + /// + /// Codice postazione di lavoro + /// + public string DescPost + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject("DescPost")) + { + answ = memLayer.ML.StringSessionObj("DescPost"); + } + if (answ == "") + { + var tabPost = dataLayer.man.taAP.getByKey(CodPost); + if (tabPost.Rows.Count > 0) + { + answ = tabPost[0].Descrizione; + } + memLayer.ML.setSessionVal("DescPost", answ); + } + return answ; + } + } + /// + /// Codice Operatore + /// + public string NomeOpr + { + get + { + string answ = ""; + if (memLayer.ML.isInSessionObject("NomeOpr")) + { + answ = memLayer.ML.StringSessionObj("NomeOpr"); + } + if (answ == "") + { + var tabOpr = dataLayer.man.taAO.getByKey(CodOpr); + if (tabOpr.Rows.Count > 0) + { + answ = string.Format("{0} {1}", tabOpr[0].Cognome, tabOpr[0].Nome); + } + memLayer.ML.setSessionVal("NomeOpr", answ); + } + return answ; + } + } + + protected void txtQta_TextChanged(object sender, EventArgs e) + { + int newQta = QtaFaseCurr; + int.TryParse(txtQta.Text, out newQta); + // salvo nuova qta... + QtaFaseCurr = newQta; + } + } +} \ No newline at end of file diff --git a/C-TRACK/WebUserControls/mod_faseCurr.ascx.designer.cs b/C-TRACK/WebUserControls/mod_faseCurr.ascx.designer.cs new file mode 100644 index 0000000..2f24cb3 --- /dev/null +++ b/C-TRACK/WebUserControls/mod_faseCurr.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace C_TRACK.WebUserControls { + + + public partial class mod_faseCurr { + + /// + /// Controllo txtQta. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.TextBox txtQta; + } +} diff --git a/C-TRACK/barcode.aspx b/C-TRACK/barcode.aspx index 57c8f09..6e340d9 100644 --- a/C-TRACK/barcode.aspx +++ b/C-TRACK/barcode.aspx @@ -5,6 +5,8 @@ <%@ Register Src="~/WebUserControls/mod_checkOpr.ascx" TagPrefix="uc1" TagName="mod_checkOpr" %> <%@ Register Src="~/WebUserControls/mod_checkPost.ascx" TagPrefix="uc1" TagName="mod_checkPost" %> <%@ Register Src="~/WebUserControls/mod_taskRec.ascx" TagPrefix="uc1" TagName="mod_taskRec" %> +<%@ Register Src="~/WebUserControls/mod_faseCurr.ascx" TagPrefix="uc1" TagName="mod_faseCurr" %> + @@ -17,6 +19,7 @@ + diff --git a/C-TRACK/barcode.aspx.cs b/C-TRACK/barcode.aspx.cs index abffd1e..e6a0bb8 100644 --- a/C-TRACK/barcode.aspx.cs +++ b/C-TRACK/barcode.aspx.cs @@ -45,6 +45,38 @@ namespace C_TRACK } } /// + /// idxRec della fase attiva + /// + public int idxRecCurr + { + get + { + return memLayer.ML.IntSessionObj("idxRecCurr"); + } +#if false + set + { + memLayer.ML.setSessionVal("idxRecCurr", value); + } +#endif + } + /// + /// Qta della fase attiva + /// + public int QtaFaseCurr + { + get + { + return memLayer.ML.IntSessionObj("QtaFaseCurr"); + } +#if false + set + { + memLayer.ML.setSessionVal("QtaFaseCurr", value); + } +#endif + } + /// /// Codice TASK corrente /// public string CurrNumTask @@ -367,7 +399,7 @@ namespace C_TRACK { Dictionary comandi = new Dictionary(); - // !!!FARE!!! togleire... + // !!!FARE!!! togliere... var tabCmd = dataLayer.man.taTE2S.getByMappa("E_BC"); foreach (var rigaCmd in tabCmd) { @@ -381,6 +413,7 @@ namespace C_TRACK comandi.Add(rigaFase.CodFase, rigaFase.DescrFase); } + #if false XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter taTrEv2St = new XPS_data.DS_applicazioneTableAdapters.TraEv2StatiTableAdapter(); DS_applicazione.TraEv2StatiDataTable _tabTran = taTrEv2St.getByCodMappa("E_BC"); @@ -522,6 +555,12 @@ namespace C_TRACK CurrNumTask = mod_barcode1.comandoRegistrato.valore; Response.Redirect("~/barcode"); } + else if (mod_barcode1.comandoRegistrato.prevCmdIn == "CLOSE") + { + // registro chiusura con la qta indicata + dataLayer.man.taTR.updateQuery(idxRecCurr, DateTime.Now, QtaFaseCurr); + Response.Redirect("~/barcode"); + } else if (dataLayer.man.taAF.getByKey(mod_barcode1.comandoRegistrato.prevCmdIn).Rows.Count > 0) { // se è un comando di fase --> registro INIZIO! diff --git a/C-TRACK/barcode.aspx.designer.cs b/C-TRACK/barcode.aspx.designer.cs index e24b914..4d18823 100644 --- a/C-TRACK/barcode.aspx.designer.cs +++ b/C-TRACK/barcode.aspx.designer.cs @@ -39,6 +39,15 @@ namespace C_TRACK { /// protected global::C_TRACK.WebUserControls.mod_barcode mod_barcode1; + /// + /// Controllo mod_faseCurr. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::C_TRACK.WebUserControls.mod_faseCurr mod_faseCurr; + /// /// Controllo mod_btnComandi1. ///