diff --git a/AppData/DS_App.Designer.cs b/AppData/DS_App.Designer.cs index 6b470e0..7d0b52d 100644 --- a/AppData/DS_App.Designer.cs +++ b/AppData/DS_App.Designer.cs @@ -6835,7 +6835,7 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ [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[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 CodPost, Descrizione, PreselFasi, CodOpr, Operatore\r\nFROM v_AnagPost"; @@ -6848,17 +6848,23 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ 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[2] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[2].Connection = this.Connection; - this._commandCollection[2].CommandText = "dbo.stp_AP_resetOpr"; + this._commandCollection[2].CommandText = "dbo.stp_AP_getByOpr"; 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("@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_AP_setOpr"; + this._commandCollection[3].CommandText = "dbo.stp_AP_resetOpr"; 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("@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("@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] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[4].Connection = this.Connection; + this._commandCollection[4].CommandText = "dbo.stp_AP_setOpr"; + 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("@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("@CodOpr", 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()] @@ -6902,6 +6908,23 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ 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.AnagPostDataTable getByOpr(string CodOpr) { + this.Adapter.SelectCommand = this.CommandCollection[2]; + if ((CodOpr == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodOpr)); + } + DS_App.AnagPostDataTable dataTable = new DS_App.AnagPostDataTable(); + 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")] @@ -7102,7 +7125,7 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int resetOpr(string CodOpr) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((CodOpr == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -7130,7 +7153,7 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int setOpr(string CodPost, string CodOpr) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((CodPost == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/AppData/DS_App.xsd b/AppData/DS_App.xsd index a78dc59..c652b11 100644 --- a/AppData/DS_App.xsd +++ b/AppData/DS_App.xsd @@ -80,7 +80,7 @@ - + dbo.stp_TL_deleteQuery @@ -126,7 +126,7 @@ - + dbo.stp_TL_insertQuery @@ -333,7 +333,7 @@ FROM v_TaskRec - + dbo.stp_TR_closePending @@ -387,7 +387,7 @@ FROM v_TaskRec - + dbo.stp_TR_insertQuery @@ -402,7 +402,7 @@ FROM v_TaskRec - + dbo.stp_TR_updateQuery @@ -487,7 +487,18 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ - + + + + dbo.stp_AP_getByOpr + + + + + + + + dbo.stp_AP_resetOpr @@ -498,7 +509,7 @@ SELECT CodPost, Descrizione, PreselFasi, CodOpr FROM AnagPost WHERE (CodPost = @ - + dbo.stp_AP_setOpr @@ -780,7 +791,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -806,7 +817,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -828,7 +839,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -855,7 +866,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -924,7 +935,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -965,7 +976,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -1027,7 +1038,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -1061,7 +1072,7 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - + @@ -1166,10 +1177,10 @@ SELECT CodMappa, CodObj, CodStato, CodEvento, NextCodStato, CmdPlugin, text2show - - - - + + + + \ No newline at end of file diff --git a/AppData/DS_App.xss b/AppData/DS_App.xss index 1eb0d47..3c34117 100644 --- a/AppData/DS_App.xss +++ b/AppData/DS_App.xss @@ -6,11 +6,11 @@ --> - - + + - - + + @@ -56,7 +56,7 @@ 630 - 441 + 464 630 diff --git a/C-TRACK/WebUserControls/mod_checkPost.ascx.cs b/C-TRACK/WebUserControls/mod_checkPost.ascx.cs index 147f09e..04d6596 100644 --- a/C-TRACK/WebUserControls/mod_checkPost.ascx.cs +++ b/C-TRACK/WebUserControls/mod_checkPost.ascx.cs @@ -1,4 +1,5 @@ -using SteamWare; +using AppData; +using SteamWare; using System; namespace C_TRACK.WebUserControls @@ -7,8 +8,17 @@ namespace C_TRACK.WebUserControls { protected void Page_Load(object sender, EventArgs e) { - - // verifico di avere CodOpr ins essione... + // se ho operatore in sessione ma NON HO postazione... cerco di recuperare postazione + if (CodOpr != "" && CodPost == "") + { + // cerco da tab se ha una postazione (prendo la prima...) + var righeOpr = dataLayer.man.taAP.getByOpr(CodOpr); + if (righeOpr.Rows.Count > 0) + { + CodPost = righeOpr[0].CodPost; + } + } + // verifico di avere CodOpr in sessione... if (CodPost == "") { // mostro warning.. @@ -33,6 +43,21 @@ namespace C_TRACK.WebUserControls { return memLayer.ML.StringSessionObj("CodPost"); } + set + { + memLayer.ML.setSessionVal("CodPost", value); + memLayer.ML.emptySessionVal("DescPost"); + } + } + /// + /// Codice postazione di lavoro + /// + public string CodOpr + { + get + { + return memLayer.ML.StringSessionObj("CodOpr"); + } } } } \ No newline at end of file diff --git a/C-TRACK/barcode.aspx.cs b/C-TRACK/barcode.aspx.cs index 0035864..a6c1663 100644 --- a/C-TRACK/barcode.aspx.cs +++ b/C-TRACK/barcode.aspx.cs @@ -501,11 +501,12 @@ namespace C_TRACK } else if (mod_barcode1.comandoRegistrato.valore.Contains("OPR.")) { + // imposto operatore CodOpr = mod_barcode1.comandoRegistrato.valore; - // SE HO postsazione ... + // SE HO postazione... if (CodPost != "") { - // ...e SE la postazione è libera o c'è lui associo e registro + // ...e SE la postazione è libera associo e registro var tabPost = dataLayer.man.taAP.getByKey(CodPost); if (tabPost.Rows.Count == 1) { @@ -514,6 +515,11 @@ namespace C_TRACK { dataLayer.man.taAP.setOpr(CodPost, CodOpr); } + else + { + // tolgo postazione (è occupata...) + CodPost = ""; + } } } Response.Redirect("~/barcode");