-
+
-
- <%--
- --%>
-
-
+
- <%--
--%>
diff --git a/MP-TAB/WebUserControls/mod_elencoAllarmi.ascx.cs b/MP-TAB/WebUserControls/mod_elencoAllarmi.ascx.cs
index d40bf99f..af793c63 100644
--- a/MP-TAB/WebUserControls/mod_elencoAllarmi.ascx.cs
+++ b/MP-TAB/WebUserControls/mod_elencoAllarmi.ascx.cs
@@ -1,8 +1,6 @@
using SteamWare;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -10,8 +8,87 @@ namespace MoonProTablet.WebUserControls
{
public partial class mod_elencoAllarmi : BaseUserControl
{
+ #region Public Methods
+
+ public void doUpdate()
+ {
+ grView.DataBind();
+ }
+
+ ///
+ /// Indica se ci sia registrato ACK utente
+ ///
+ ///
+ ///
+ public bool hasAck(object rawUser)
+ {
+ return !string.IsNullOrEmpty($"{rawUser}");
+ }
+
+ #endregion Public Methods
+
#region Protected Methods
+ protected void lbkDoAck_Click(object sender, EventArgs e)
+ {
+ // recupero button
+ LinkButton lbtn = (LinkButton)sender;
+ if (lbtn != null)
+ {
+ var rawAlarmId = lbtn.CommandArgument;
+ int AlarmId = 0;
+ int.TryParse(rawAlarmId, out AlarmId);
+ if (AlarmId > 0)
+ {
+ var alarmTab = DataLayerObj.taAlarmLog.getByKey(AlarmId);
+ if (alarmTab != null && alarmTab.Count > 0)
+ {
+ var alarmRow = alarmTab[0];
+ // invio email...
+ string oggetto = $"Notifica allarme impianto {alarmRow.MachineId}";
+ StringBuilder sb = new StringBuilder();
+ sb.AppendLine("Attenzione: allarme presente per un periodo superiore alla soglia di controllo.");
+ sb.AppendLine();
+ sb.AppendLine($"
{alarmRow.ValDecoded}");
+ sb.AppendLine();
+ sb.AppendLine($"Info Area: {alarmRow.MemAddress}.{alarmRow.MemIndex} | Status {alarmRow.StatusVal}");
+ sb.AppendLine();
+ string corpo = sb.ToString().Replace($"{Environment.NewLine}", "
");
+
+ // FIXME TODO scegliere destinatario
+ bool fatto = DataLayerObj.sendEmail("samuele@steamware.net", oggetto, corpo);
+ if (fatto)
+ {
+ // salvo ACK allarme
+ DataLayerObj.taAlarmLog.setAck(AlarmId, DateTime.Now, $"{DataLayerObj.MatrOpr} - {DataLayerObj.CognomeNomeOpr}");
+ }
+ }
+ // ricarico
+ doUpdate();
+ }
+ }
+ }
+
+ protected void lbtSendNotify_Click(object sender, EventArgs e)
+ {
+ // recupero button
+ LinkButton lbtn = (LinkButton)sender;
+ if (lbtn != null)
+ {
+ var rawAlarmId = lbtn.CommandArgument;
+ int AlarmId = 0;
+ int.TryParse(rawAlarmId, out AlarmId);
+ if (AlarmId > 0)
+ {
+ // salvo invio Notifica allarme
+ DataLayerObj.taAlarmLog.setNotify(AlarmId, DateTime.Now);
+ // ricarico
+ doUpdate();
+ }
+ }
+ }
+
+
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
@@ -26,56 +103,5 @@ namespace MoonProTablet.WebUserControls
}
#endregion Protected Methods
-
- #region Public Methods
-
- public void doUpdate()
- {
- grView.DataBind();
- }
-
- ///
- /// css dato status (0 = all OK, > 0 ALLARMI)
- ///
- ///
- ///
- public string cssByStatus(object rawStatus)
- {
- int status = 0;
- int.TryParse($"{rawStatus}", out status);
- return status > 0 ? "text-danger" : "text-success";
- }
-
- ///
- /// Indica se ci sia registrato ACK utente
- ///
- ///
- ///
- public bool hasAck(object rawUser)
- {
- return !string.IsNullOrEmpty($"{rawUser}");
- }
-
-
- #endregion Public Methods
-
- protected void lbkDoAck_Click(object sender, EventArgs e)
- {
- // recupero button
- LinkButton lbtn = (LinkButton)sender;
- if (lbtn != null)
- {
- var rawAlarmId = lbtn.CommandArgument;
- int AlarmId = 0;
- int.TryParse(rawAlarmId, out AlarmId);
- if (AlarmId > 0)
- {
- // salvo ACK allarme
- DataLayerObj.taAlarmLog.setAck(AlarmId, DateTime.Now, $"{DataLayerObj.MatrOpr} - {DataLayerObj.CognomeNomeOpr}");
- // ricarico
- doUpdate();
- }
- }
- }
}
}
\ No newline at end of file
diff --git a/MapoDb/DS_applicazione.Designer.cs b/MapoDb/DS_applicazione.Designer.cs
index 4ec8d829..ea2d0bba 100644
--- a/MapoDb/DS_applicazione.Designer.cs
+++ b/MapoDb/DS_applicazione.Designer.cs
@@ -30688,68 +30688,74 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.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_AlarmLog";
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_AL_getFilt";
+ this._commandCollection[1].CommandText = "dbo.stp_AL_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("@IdxMacchina", 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("@dtFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@AlarmLogId", 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_AL_getFiltCount";
+ this._commandCollection[2].CommandText = "dbo.stp_AL_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("@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].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@searchVal", 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_AL_getFiltPaged";
+ this._commandCollection[3].CommandText = "dbo.stp_AL_getFiltCount";
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("@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].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtFrom", 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("@dtTo", 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("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@maximumRows", 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("@startRowIndex", 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("@searchVal", 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_AL_insertQuery";
+ this._commandCollection[4].CommandText = "dbo.stp_AL_getFiltPaged";
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("@DtRif", 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("@MachineId", 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("@MemAddress", 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("@MemIndex", 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("@StatusVal", 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("@ValDecoded", global::System.Data.SqlDbType.NVarChar, 2500, 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("@IdxMacchina", 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("@dtFrom", 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("@dtTo", 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("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@maximumRows", 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("@startRowIndex", 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("@searchVal", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_AL_setAck";
+ this._commandCollection[5].CommandText = "dbo.stp_AL_insertQuery";
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("@AlarmLogId", 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("@DtAck", 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("@UserAck", 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("@DtRif", 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("@MachineId", 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("@MemAddress", 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("@MemIndex", 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("@StatusVal", 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("@ValDecoded", global::System.Data.SqlDbType.NVarChar, 2500, global::System.Data.ParameterDirection.Input, 0, 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_AL_setNotify";
+ this._commandCollection[6].CommandText = "dbo.stp_AL_setAck";
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("@AlarmLogId", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
- this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtNotify", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtAck", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UserAck", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_AL_setNotify";
+ 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("@AlarmLogId", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
+ this._commandCollection[7].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DtNotify", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -30780,8 +30786,25 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
- public virtual DS_applicazione.AlarmLogDataTable getFilt(string IdxMacchina, global::System.Nullable
dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti) {
+ public virtual DS_applicazione.AlarmLogDataTable getByKey(global::System.Nullable AlarmLogId) {
this.Adapter.SelectCommand = this.CommandCollection[1];
+ if ((AlarmLogId.HasValue == true)) {
+ this.Adapter.SelectCommand.Parameters[1].Value = ((int)(AlarmLogId.Value));
+ }
+ else {
+ this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
+ }
+ DS_applicazione.AlarmLogDataTable dataTable = new DS_applicazione.AlarmLogDataTable();
+ this.Adapter.Fill(dataTable);
+ return dataTable;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
+ [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
+ [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
+ public virtual DS_applicazione.AlarmLogDataTable getFilt(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti) {
+ this.Adapter.SelectCommand = this.CommandCollection[2];
if ((IdxMacchina == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -30816,7 +30839,7 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_applicazione.AlarmLogDataTable getFiltPaged(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, global::System.Nullable maximumRows, global::System.Nullable startRowIndex, string searchVal) {
- this.Adapter.SelectCommand = this.CommandCollection[3];
+ this.Adapter.SelectCommand = this.CommandCollection[4];
if ((IdxMacchina == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -30868,7 +30891,7 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual object getFiltCount(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, string searchVal) {
- global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2];
+ global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3];
if ((IdxMacchina == null)) {
command.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -30926,7 +30949,7 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int insertQuery(global::System.Nullable DtRif, string MachineId, string MemAddress, global::System.Nullable MemIndex, global::System.Nullable StatusVal, string ValDecoded) {
- global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4];
+ global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5];
if ((DtRif.HasValue == true)) {
command.Parameters[1].Value = ((System.DateTime)(DtRif.Value));
}
@@ -30984,7 +31007,7 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int setAck(global::System.Nullable AlarmLogId, global::System.Nullable DtAck, string UserAck) {
- global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[5];
+ global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6];
if ((AlarmLogId.HasValue == true)) {
command.Parameters[1].Value = ((int)(AlarmLogId.Value));
}
@@ -31024,7 +31047,7 @@ SELECT TagCode, TagDescr, DisplOrd, CssClass FROM AnagTags WHERE (TagCode = @Tag
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int setNotify(global::System.Nullable AlarmLogId, global::System.Nullable DtNotify) {
- global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[6];
+ global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[7];
if ((AlarmLogId.HasValue == true)) {
command.Parameters[1].Value = ((int)(AlarmLogId.Value));
}
diff --git a/MapoDb/DS_applicazione.xsd b/MapoDb/DS_applicazione.xsd
index 66cb384c..b1ee7546 100644
--- a/MapoDb/DS_applicazione.xsd
+++ b/MapoDb/DS_applicazione.xsd
@@ -2893,6 +2893,17 @@ FROM v_AlarmLog
+
+
+
+ dbo.stp_AL_getByKey
+
+
+
+
+
+
+
diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs
index 7962b851..5f887560 100644
--- a/MapoDb/DataLayer.cs
+++ b/MapoDb/DataLayer.cs
@@ -3604,6 +3604,31 @@ namespace MapoDb
return fatto;
}
+
+ ///
+ /// Invia una mail al destinatario con oggetto e contenuto
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool sendEmail(string destinatario, string oggetto, string corpo)
+ {
+ bool fatto = false;
+ try
+ {
+ // compongo la stringa
+ string mittente = memLayer.ML.CRS("_fromEmail");
+ gestEmail.ge.mandaEmail(mittente, destinatario, oggetto, corpo);
+ fatto = true;
+ }
+ catch(Exception exc)
+ {
+ logger.lg.scriviLog($"Eccezione in sendEmail{Environment.NewLine}{exc}", tipoLog.ERROR);
+ }
+ return fatto;
+ }
+
///
/// Invia email di avviso che ci sono dei TC da confermare
///