diff --git a/MP-TAB/WebUserControls/mod_dettMacchina.ascx b/MP-TAB/WebUserControls/mod_dettMacchina.ascx index 63c62f3c..cf90f0f3 100644 --- a/MP-TAB/WebUserControls/mod_dettMacchina.ascx +++ b/MP-TAB/WebUserControls/mod_dettMacchina.ascx @@ -58,13 +58,10 @@ - - - - + - + diff --git a/MP-TAB/WebUserControls/mod_dichiarazione.ascx.cs b/MP-TAB/WebUserControls/mod_dichiarazione.ascx.cs index e26cf8ff..79dd6c65 100644 --- a/MP-TAB/WebUserControls/mod_dichiarazione.ascx.cs +++ b/MP-TAB/WebUserControls/mod_dichiarazione.ascx.cs @@ -58,17 +58,17 @@ namespace MoonProTablet.WebUserControls DS_applicazione.AnagraficaEventiRow rigaEvento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0]; if (rigaEvento != null) { - DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina.ToString())[0]; + DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0]; // processo evento... if (insRealtime) { // se realtime - controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, rigaStato.CodArticolo, "DRT", DataLayer.MatrOpr, rigaStato.pallet); + controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, "DRT", DataLayer.MatrOpr, rigaStato.pallet); } else { // in primis disabilito insert... - DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina.ToString(), false); + DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina, false); // calcolo evento string evento = idxEvento.ToString(); string commento = ""; @@ -84,7 +84,7 @@ namespace MoonProTablet.WebUserControls try { // cerco da 1 sec DOPO evento... - DS_applicazione.DiarioDiBordoDataTable tabNext = controllerMapo.nextEventoImpiantoFrom(idxMacchina.ToString(), dataOraEv.AddSeconds(1)); + DS_applicazione.DiarioDiBordoDataTable tabNext = controllerMapo.nextEventoImpiantoFrom(idxMacchina, dataOraEv.AddSeconds(1)); DateTime nextEvDT = DateTime.Now; if (tabNext.Rows.Count > 0) @@ -98,14 +98,14 @@ namespace MoonProTablet.WebUserControls } // fix salvo la dichiarazione di chiusura commento = string.Format("999 - M.Lav EndEvt: {0} [{1}]", evento, codRich); - controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), 1, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, nextEvDT.AddSeconds(-1), DateTime.Now); // 1 hard-coded x resettare + controllerMapo.scriviRigaEventoBarcode(idxMacchina, 1, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, nextEvDT.AddSeconds(-1), DateTime.Now); // 1 hard-coded x resettare } catch { } // update commento! commento = string.Format("999 - Dich StartEvt: {0} [{1}]", evento, codRich); // recupero data/ora evento da inserire (quella selezionata) ed AGGIUNGO 1 sec!!! così rimane traccia - controllerMapo.scriviRigaEventoBarcode(idxMacchina.ToString(), idxEvento, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, dataOraEv.AddSeconds(1), DateTime.Now); + controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, dataOraEv.AddSeconds(1), DateTime.Now); // eseguo ricalcolo! DateTime startRicalcolo = dataOraEv.AddMinutes(memLayer.ML.confReadInt("minAnticipoRicalcolo")); @@ -113,11 +113,11 @@ namespace MoonProTablet.WebUserControls int rdm_nEvStep = memLayer.ML.CRI("rdm_nEvStep"); int rdm_nEvCheck = memLayer.ML.CRI("rdm_nEvCheck"); bool rdm_ChkOnly = memLayer.ML.CRB("rdm_ChkOnly"); - DataLayer.obj.taComm.stp_ricalcolaDatiMacchinaFromDate(idxMacchina.ToString(), startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly); // nella stored imposto macchina OFFline e poi ONline, parto da "minAnticipoRicalcolo" minuti prima... - // aggiorno data evento x insert eventuale commento (5 sec...) + DataLayer.obj.taComm.stp_ricalcolaDatiMacchinaFromDate(idxMacchina, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly); // nella stored imposto macchina OFFline e poi ONline, parto da "minAnticipoRicalcolo" minuti prima... + // aggiorno data evento x insert eventuale commento (5 sec...) dataOraEv = dataOraEv.AddSeconds(5); // riabilito insert... anche se non dovrebbe servire x stored ricalcolo precedente... - DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina.ToString(), true); + DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina, true); } // mostro esito lblOut.Text = "Registrata dichiarazione fermata"; @@ -127,7 +127,10 @@ namespace MoonProTablet.WebUserControls lblOut.Text = string.Format("Codice evento non valido! {0}", idxEvento); } } + // refresh fermate repLI.DataBind(); + // faccio refresh SOLO macchina corrente + DataLayer.obj.taMSE.forceRefreshMacchina(idxMacchina); // sollevo evento! if (eh_newVal != null) { diff --git a/MapoDb/DS_ProdTempi.Designer.cs b/MapoDb/DS_ProdTempi.Designer.cs index 10431800..573145ff 100644 --- a/MapoDb/DS_ProdTempi.Designer.cs +++ b/MapoDb/DS_ProdTempi.Designer.cs @@ -24496,7 +24496,7 @@ SELECT RowNum, lastUpdate, IdxMacchina, CodMacchina, Nome, url, idxODL, CodArtic [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 RowNum, lastUpdate, IdxMacchina, CodMacchina, Nome, url, idxODL, CodArticolo, Disegno, NumPezzi, TCAssegnato, DataInizioODL, Semaforo, idxStato, DescrizioneStato, durata, PezziProd, PezziConf, TempoOn, TempoAuto, TempoRun, @@ -24505,23 +24505,29 @@ FROM MappaStatoExpl"; 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_MSE_getByIdxMacchina"; + this._commandCollection[1].CommandText = "dbo.stp_MSE_refresh"; 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("@IdxMacchina", 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_MSE_getData"; + this._commandCollection[2].CommandText = "dbo.stp_MSE_getByIdxMacchina"; 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("@maxAgeSec", 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("@IdxMacchina", 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_MSE_getDataByOpr"; + this._commandCollection[3].CommandText = "dbo.stp_MSE_getData"; 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("@maxAgeSec", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@MatrOpr", 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_MSE_getDataByOpr"; + 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("@maxAgeSec", 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("@MatrOpr", 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()] @@ -24553,7 +24559,7 @@ FROM MappaStatoExpl"; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_ProdTempi.MappaStatoExplDataTable getByIdxMacchina(string IdxMacchina) { - this.Adapter.SelectCommand = this.CommandCollection[1]; + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -24570,7 +24576,7 @@ FROM MappaStatoExpl"; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_ProdTempi.MappaStatoExplDataTable getByRefreshData(global::System.Nullable maxAgeSec) { - this.Adapter.SelectCommand = this.CommandCollection[2]; + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((maxAgeSec.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(maxAgeSec.Value)); } @@ -24587,7 +24593,7 @@ FROM MappaStatoExpl"; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_ProdTempi.MappaStatoExplDataTable getByRefreshDataOpr(global::System.Nullable maxAgeSec, global::System.Nullable MatrOpr) { - this.Adapter.SelectCommand = this.CommandCollection[3]; + this.Adapter.SelectCommand = this.CommandCollection[4]; if ((maxAgeSec.HasValue == true)) { this.Adapter.SelectCommand.Parameters[1].Value = ((int)(maxAgeSec.Value)); } @@ -25595,6 +25601,34 @@ FROM MappaStatoExpl"; int RowNum) { return this.Update(lastUpdate, Original_IdxMacchina, CodMacchina, Nome, url, idxODL, CodArticolo, Disegno, NumPezzi, TCAssegnato, DataInizioODL, Semaforo, idxStato, DescrizioneStato, durata, PezziProd, PezziConf, TempoOn, TempoAuto, TempoRun, TCMedio, TCLav, TCEff, TCMedioRT, TCLavRT, TCEffRT, Original_RowNum, Original_lastUpdate, Original_IdxMacchina, Original_CodMacchina, Original_Nome, Original_url, Original_idxODL, Original_CodArticolo, Original_Disegno, Original_NumPezzi, Original_TCAssegnato, Original_DataInizioODL, Original_Semaforo, Original_idxStato, Original_DescrizioneStato, Original_durata, Original_PezziProd, Original_PezziConf, Original_TempoOn, Original_TempoAuto, Original_TempoRun, Original_TCMedio, Original_TCLav, Original_TCEff, Original_TCMedioRT, Original_TCLavRT, Original_TCEffRT, RowNum); } + + [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 forceRefreshMacchina(string IdxMacchina) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((IdxMacchina == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(IdxMacchina)); + } + 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/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index 5fc2c5dd..fd3f63ce 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -1713,6 +1713,17 @@ SELECT RowNum, lastUpdate, IdxMacchina, CodMacchina, Nome, url, idxODL, CodArtic + + + + dbo.stp_MSE_refresh + + + + + + + diff --git a/MapoDb/DS_ProdTempi.xss b/MapoDb/DS_ProdTempi.xss index bb5e1d12..26873afb 100644 --- a/MapoDb/DS_ProdTempi.xss +++ b/MapoDb/DS_ProdTempi.xss @@ -4,32 +4,32 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - + + + - - + + - - + + - - - + + + - - + + \ No newline at end of file