Merge branch 'release/UpdateAlarmsDisplay'

This commit is contained in:
Samuele Locatelli
2022-07-01 17:24:55 +02:00
15 changed files with 472 additions and 263 deletions
+26 -5
View File
@@ -15,7 +15,7 @@
</div>
</div>
<asp:GridView ID="grView" runat="server" CssClass="table table-striped table-sm" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="AlarmLogId" AllowSorting="True" AllowPaging="True">
<asp:GridView ID="grView" runat="server" CssClass="table table-striped table-sm small" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="AlarmLogId" AllowSorting="True" AllowPaging="True">
<HeaderStyle CssClass="table-dark" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
@@ -24,7 +24,10 @@
Nessun record trovato
</EmptyDataTemplate>
<Columns>
<asp:BoundField DataField="DtRif" HeaderText="DtRif" ReadOnly="True" SortExpression="DtRif" ItemStyle-CssClass="text-nowrap" />
<asp:BoundField DataField="DtRif" HeaderText="Datat Ora" ReadOnly="True" SortExpression="DtRif" ItemStyle-CssClass="text-nowrap">
<ItemStyle CssClass="text-nowrap"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="Duration" HeaderText="Durata" SortExpression="Duration" />
<asp:TemplateField HeaderText="Mem" SortExpression="MemAddress" ItemStyle-CssClass="text-nowrap">
<%--<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("MemAddress") %>'></asp:Label>
@@ -34,10 +37,28 @@
<asp:Label ID="Label2" runat="server" Text='<%# Eval("MemIndex") %>'></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="text-nowrap"></ItemStyle>
</asp:TemplateField>
<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
<asp:BoundField DataField="ValDecoded" HeaderText="ValDecoded" SortExpression="ValDecoded" />
<%--<asp:BoundField DataField="DtNotify" HeaderText="DtNotify" ReadOnly="True" SortExpression="DtNotify" />--%>
<asp:BoundField DataField="StatusVal" HeaderText="Val" SortExpression="StatusVal" />
<asp:TemplateField HeaderText="Notif">
<ItemTemplate>
<%--<div class="text-truncate" runat="server" id="divNotify" visible='<%# getBool(Eval("ReqNotify")) %>'>
<asp:LinkButton runat="server" ID="lbtSendNotify" CssClass="btn btn-sm btn-primary py-0" ToolTip='<%# traduci("lblSendNotify") %>' OnClick="lbtSendNotify_Click" CommandArgument='<%# Eval("AlarmLogId") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaSendNotify") %>'>Invia <i class="fa fa-envelope-o" aria-hidden="true"></i></asp:LinkButton>
</div>
<div class="text-truncate" runat="server" id="divAck" visible='<%# getBool(Eval("ReqAck")) %>'>
<asp:LinkButton runat="server" ID="lbkDoAck" CssClass="btn btn-sm btn-warning py-0" ToolTip='<%# traduci("lblUserAck") %>' OnClick="lbkDoAck_Click" CommandArgument='<%# Eval("AlarmLogId") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaUserAck") %>'>Set <i class="fa fa-exclamation-triangle" aria-hidden="true"></i></asp:LinkButton>
</div>--%>
<div class="text-truncate bg-primary text-light py-1 px-0 rounded" runat="server" id="divUser" visible='<%# !string.IsNullOrEmpty(Eval("UserAck").ToString()) %>'>
<asp:Label ID="Label3" runat="server" ToolTip='<%# Eval("UserAck") %>'><i class="fa fa-user" aria-hidden="true"></i></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ValDecoded" HeaderText="Display" SortExpression="ValDecoded" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right" CssClass="small"></ItemStyle>
</asp:BoundField>
<%--<asp:BoundField DataField="UserAck" HeaderText="UserAck" ReadOnly="True" SortExpression="UserAck" />--%>
<%--<asp:BoundField DataField="DtAck" HeaderText="DtAck" ReadOnly="True" SortExpression="DtAck" />--%>
</Columns>
+64 -6
View File
@@ -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;
@@ -12,17 +10,17 @@ namespace MP_SITE.WebUserControls
{
#region Public Methods
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
logger.lg.scriviLog("inizio caricamento dati FluxLog", tipoLog.INFO);
logger.lg.scriviLog("inizio caricamento dati Allarmi", tipoLog.INFO);
}
grView.PageSize = _numRighe;
ods.DataBind();
if (memLayer.ML.CRI("_logLevel") > 5)
{
logger.lg.scriviLog("fine caricamento dati FluxLog", tipoLog.INFO);
logger.lg.scriviLog("fine caricamento dati Allarmi", tipoLog.INFO);
}
if (!Page.IsPostBack)
{
@@ -39,11 +37,71 @@ namespace MP_SITE.WebUserControls
#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)
{
// salvo ACK allarme
DataLayerObj.taAlarmLog.setAck(AlarmId, DateTime.Now, $"{DataLayerObj.MatrOpr} - {DataLayerObj.CognomeNomeOpr}");
// ricarico
grView.DataBind();
}
}
}
protected void lbtReset_Click(object sender, EventArgs e)
{
txtSearch.Text = "";
}
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)
{
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($"<b>{alarmRow.ValDecoded}</b>");
sb.AppendLine();
sb.AppendLine($"Info Area: {alarmRow.MemAddress}.{alarmRow.MemIndex} | Status {alarmRow.StatusVal}");
sb.AppendLine();
string corpo = sb.ToString().Replace($"{Environment.NewLine}", "<br/>");
// FIXME TODO scegliere destinatario
bool fatto = DataLayerObj.sendEmail("samuele@steamware.net,giancarlo@teamware.net", oggetto, corpo);
if (fatto)
{
// salvo invio Notifica allarme
DataLayerObj.taAlarmLog.setNotify(AlarmId, DateTime.Now);
}
}
// ricarico
//doUpdate();
grView.DataBind();
}
}
}
protected void txtSearch_TextChanged(object sender, EventArgs e)
{
grView.DataBind();
+24 -3
View File
@@ -11,7 +11,7 @@ namespace MP_SITE.WebUserControls
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
private DataLayer DataLayerObj = new DataLayer();
internal DataLayer DataLayerObj = new DataLayer();
#endregion Private Fields
@@ -65,7 +65,7 @@ namespace MP_SITE.WebUserControls
_resoconti = new resoconti();
if (!Page.IsPostBack)
{
aggiornamento();
doUpdate();
}
}
@@ -73,7 +73,7 @@ namespace MP_SITE.WebUserControls
#region Public Methods
public virtual void aggiornamento()
public virtual void doUpdate()
{
}
@@ -106,6 +106,27 @@ namespace MP_SITE.WebUserControls
return user_std.UtSn.TraduciEn(lemma);
}
/// <summary>
/// Conversione a bool del valore
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool getBool(object value)
{
bool answ = false;
string rawVal = $"{value}".ToUpper();
// se è 1/0 --> len 1
if (rawVal.Length == 1)
{
answ = rawVal == "1" || rawVal == "S" || rawVal == "Y";
}
else
{
bool.TryParse($"{value}", out answ);
}
return answ;
}
#endregion Public Methods
}
}
@@ -26,7 +26,7 @@ namespace MP_SITE.WebUserControls
#region Public Methods
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
@@ -5,7 +5,7 @@ namespace MP_SITE.WebUserControls
{
public partial class mod_logEventi : baseProdControl
{
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
@@ -8,7 +8,7 @@ namespace MP_SITE.WebUserControls
{
#region Public Methods
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
@@ -26,7 +26,7 @@ namespace MP_SITE.WebUserControls
#region Public Methods
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
+1 -1
View File
@@ -5,7 +5,7 @@ namespace MP_SITE.WebUserControls
{
public partial class mod_logStati : baseProdControl
{
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
+1 -1
View File
@@ -27,7 +27,7 @@ namespace MP_SITE.WebUserControls
#region Public Methods
public override void aggiornamento()
public override void doUpdate()
{
if (memLayer.ML.CRI("_logLevel") > 5)
{
+151 -134
View File
@@ -1,39 +1,12 @@
using MapoDb;
using Newtonsoft.Json;
using SteamWare;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
namespace MoonProTablet.WebUserControls
{
public class BaseUserControl : System.Web.UI.UserControl //SteamWare.UserControl //
{
#region Protected Fields
/// <summary>
/// indica conferma con rettifica (evento 121)
/// </summary>
protected bool confRett = memLayer.ML.CRB("confRett");
#endregion Protected Fields
#region Internal Fields
/// <summary>
/// classe MapoDB x uso locale
/// </summary>
internal MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
internal DataLayer DataLayerObj = new DataLayer();
#endregion Internal Fields
#region Public Fields
/// <summary>
@@ -61,6 +34,11 @@ namespace MoonProTablet.WebUserControls
/// </summary>
public bool enablePzProdLasciati = memLayer.ML.cdvb("enablePzProdLasciati");
/// <summary>
/// Verifica chiave enableRiattrezzaggio in tab Config
/// </summary>
public bool enableRiattrezzaggio = memLayer.ML.cdvb("enableRiattrezzaggio");
/// <summary>
/// Abilitazione gestione Richieste - Promesse - ODL
/// </summary>
@@ -76,11 +54,6 @@ namespace MoonProTablet.WebUserControls
/// </summary>
public bool enableSchedaTecnica = memLayer.ML.cdvb("enableSchedaTecnica");
/// <summary>
/// Verifica chiave enableRiattrezzaggio in tab Config
/// </summary>
public bool enableRiattrezzaggio = memLayer.ML.cdvb("enableRiattrezzaggio");
/// <summary>
/// Abilitazione gestione SplitODL
/// </summary>
@@ -107,70 +80,6 @@ namespace MoonProTablet.WebUserControls
#endregion Public Events
#region Protected Properties
/// <summary>
/// Restituisce il codice IdxMacchina dell'impianto PARENT (se multi) altrimenti la stessa macchina...
/// </summary>
protected string idxMaccParent
{
get
{
string answ = "";
// se è multi controllo
if (isMulti)
{
// verifico se SIA una tavola (ha char "#")
int iSharp = idxMacchinaFix.IndexOf('#');
if (iSharp > 0)
{
// sistemo nome
answ = idxMacchinaFix.Substring(0, iSharp);
}
}
return answ;
}
}
#endregion Protected Properties
#region Internal Properties
/// <summary>
/// Verifica se la macchina MAIN sia MASTER
/// </summary>
internal bool isMaster
{
get
{
return DataLayerObj.isMaster(idxMacchina);
}
}
/// <summary>
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
/// </summary>
internal bool isMulti
{
get
{
return DataLayerObj.isMulti(idxMacchina);
}
}
/// <summary>
/// Verifica se la macchina MAIN sia SLAVE
/// </summary>
internal bool isSlave
{
get
{
return DataLayerObj.isSlave(idxMacchina);
}
}
#endregion Internal Properties
#region Public Properties
/// <summary>
@@ -307,44 +216,6 @@ namespace MoonProTablet.WebUserControls
#endregion Public Properties
#region Protected Methods
/// <summary>
/// conversione da tempo minuti centesimali a minuti/secondi
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected TimeSpan minCent2Sec(decimal valore)
{
TimeSpan answ = new TimeSpan(0, 0, 1);
try
{
answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60));
}
catch
{ }
return answ;
}
/// <summary>
/// conversione da tempo minuti/secondi a minuti centesimali
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected decimal minSec2Cent(TimeSpan valore)
{
Decimal answ = 0;
try
{
answ = Math.Round((valore.Minutes + (decimal)valore.Seconds / 60), 3);
}
catch
{ }
return answ;
}
#endregion Protected Methods
#region Public Methods
public string encodeAuthKey(object plainUserAuthKey)
@@ -364,6 +235,27 @@ namespace MoonProTablet.WebUserControls
return utility.formatDurata(min);
}
/// <summary>
/// Conversione a bool del valore
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool getBool(object value)
{
bool answ = false;
string rawVal = $"{value}".ToUpper();
// se è 1/0 --> len 1
if (rawVal.Length == 1)
{
answ = rawVal == "1" || rawVal == "S" || rawVal == "Y";
}
else
{
bool.TryParse($"{value}", out answ);
}
return answ;
}
/// <summary>
/// url completo immagine icona
/// </summary>
@@ -496,5 +388,130 @@ namespace MoonProTablet.WebUserControls
}
#endregion Public Methods
#region Internal Fields
/// <summary>
/// classe MapoDB x uso locale
/// </summary>
internal MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
internal DataLayer DataLayerObj = new DataLayer();
#endregion Internal Fields
#region Internal Properties
/// <summary>
/// Verifica se la macchina MAIN sia MASTER
/// </summary>
internal bool isMaster
{
get
{
return DataLayerObj.isMaster(idxMacchina);
}
}
/// <summary>
/// Verifica se la macchina MAIN sia MULTI (da DatiMacchina / redis...)
/// </summary>
internal bool isMulti
{
get
{
return DataLayerObj.isMulti(idxMacchina);
}
}
/// <summary>
/// Verifica se la macchina MAIN sia SLAVE
/// </summary>
internal bool isSlave
{
get
{
return DataLayerObj.isSlave(idxMacchina);
}
}
#endregion Internal Properties
#region Protected Fields
/// <summary>
/// indica conferma con rettifica (evento 121)
/// </summary>
protected bool confRett = memLayer.ML.CRB("confRett");
#endregion Protected Fields
#region Protected Properties
/// <summary>
/// Restituisce il codice IdxMacchina dell'impianto PARENT (se multi) altrimenti la stessa macchina...
/// </summary>
protected string idxMaccParent
{
get
{
string answ = "";
// se è multi controllo
if (isMulti)
{
// verifico se SIA una tavola (ha char "#")
int iSharp = idxMacchinaFix.IndexOf('#');
if (iSharp > 0)
{
// sistemo nome
answ = idxMacchinaFix.Substring(0, iSharp);
}
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// conversione da tempo minuti centesimali a minuti/secondi
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected TimeSpan minCent2Sec(decimal valore)
{
TimeSpan answ = new TimeSpan(0, 0, 1);
try
{
answ = new TimeSpan(0, Convert.ToInt32(valore), Convert.ToInt32((valore - Convert.ToInt32(valore)) * 60));
}
catch
{ }
return answ;
}
/// <summary>
/// conversione da tempo minuti/secondi a minuti centesimali
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
protected decimal minSec2Cent(TimeSpan valore)
{
Decimal answ = 0;
try
{
answ = Math.Round((valore.Minutes + (decimal)valore.Seconds / 60), 3);
}
catch
{ }
return answ;
}
#endregion Protected Methods
}
}
+31 -24
View File
@@ -10,39 +10,46 @@
<asp:TemplateField HeaderText="Elenco Allarmi <i class='fa fa-sort'></i>" SortExpression="DtRif" HeaderStyle-CssClass="btn btn-sm btn-block btn-secondary text-info" HeaderStyle-ForeColor="White">
<ItemTemplate>
<div class="row">
<div class="col-7 small">
<div class="col-6 col-md-8 small">
<div>
Mem: <b>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("MemAddress") %>' />.
<asp:Label ID="Label2" runat="server" Text='<%# Eval("MemIndex") %>' /></b>
</div>
<div>
Val: <b>
<asp:Label ID="Label4" runat="server" CssClass='<%# cssByStatus(Eval("Status")) %>' Text='<%# Eval("ValDecoded") %>' /></b>
</div>
</div>
<div class="col-1 px-0 text-center">
<%--<i runat="server" class="fa fa-check-circle fa-3x text-success" aria-hidden="true" visible='<%# Convert.ToBoolean(Eval("EsitoOK")) %>'></i>
<i runat="server" class="fa fa-ban fa-3x text-danger" aria-hidden="true" visible='<%# !Convert.ToBoolean(Eval("EsitoOK")) %>'></i>--%>
</div>
<div class="col-4 text-right small">
<div class="text-truncate">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DtRif","{0:ddd dd.MM.yy HH:mm:ss}") %>' />
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
<div class="text-truncate" runat="server" id="divUser" visible='<%# hasAck(Eval("UserAck")) %>'>
<b>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("UserAck") %>' /></b>
<i class="fa fa-user" aria-hidden="true"></i>
</div>
<div class="text-truncate" runat="server" id="divAck" visible='<%# !hasAck(Eval("UserAck")) %>'>
<asp:LinkButton runat="server" ID="lbkDoAck" CssClass="btn btn-sm btn-warning py-0" ToolTip='<%# traduci("lblUserAck") %>' OnClick="lbkDoAck_Click" CommandArgument='<%# Eval("AlarmLogId") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaUserAck") %>'>Set <i class="fa fa-exclamation-triangle" aria-hidden="true"></i></asp:LinkButton>
<asp:Label ID="Label4" runat="server" CssClass="text-danger" Text='<%# Eval("ValDecoded") %>' /></b>
</div>
</div>
<div class="col-6 col-md-4 text-right small">
<div class="d-flex flex-row-reverse">
<div class="px-1">
<div class="text-truncate">
<asp:Label ID="Label1" runat="server" Text='<%# Eval("DtRif","{0:ddd dd.MM.yy HH:mm:ss}") %>' />
<i class="fa fa-clock-o" aria-hidden="true"></i>
</div>
<div class="text-truncate">
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Duration","{0:N2} min") %>' />
<i class="fa fa-hourglass-end" aria-hidden="true"></i>
</div>
</div>
<div class="px-1">
<div class="text-truncate bg-primary text-light p-1 rounded" runat="server" id="divUser" visible='<%# hasAck(Eval("UserAck")) %>'>
<b>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("UserAck") %>' /></b>
<i class="fa fa-user" aria-hidden="true"></i>
</div>
</div>
<div class="px-1">
<div class="text-truncate" runat="server" id="divNotify" visible='<%# getBool(Eval("ReqNotify")) %>'>
<asp:LinkButton runat="server" ID="lbtSendNotify" CssClass="btn btn-sm btn-primary py-0" ToolTip='<%# traduci("lblSendNotify") %>' OnClick="lbtSendNotify_Click" CommandArgument='<%# Eval("AlarmLogId") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaSendNotify") %>'>Invia <i class="fa fa-envelope-o" aria-hidden="true"></i></asp:LinkButton>
</div>
<div class="text-truncate" runat="server" id="divAck" visible='<%# getBool(Eval("ReqAck")) %>'>
<asp:LinkButton runat="server" ID="lbkDoAck" CssClass="btn btn-sm btn-warning py-0" ToolTip='<%# traduci("lblUserAck") %>' OnClick="lbkDoAck_Click" CommandArgument='<%# Eval("AlarmLogId") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaUserAck") %>'>Set <i class="fa fa-exclamation-triangle" aria-hidden="true"></i></asp:LinkButton>
</div>
</div>
</div>
</div>
<%--<div class="col-12 small">
<i runat="server" id="iNote" visible='<%# Eval("Note").ToString()!="" %>'>Nota:
<asp:Label ID="Label6" runat="server" CssClass="text-warning" Text='<%# Eval("Note") %>' /></i>
</div>--%>
</div>
</ItemTemplate>
</asp:TemplateField>
@@ -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();
}
/// <summary>
/// Indica se ci sia registrato ACK utente
/// </summary>
/// <param name="rawUser"></param>
/// <returns></returns>
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)
{
// 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)
{
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($"<b>{alarmRow.ValDecoded}</b>");
sb.AppendLine();
sb.AppendLine($"Info Area: {alarmRow.MemAddress}.{alarmRow.MemIndex} | Status {alarmRow.StatusVal}");
sb.AppendLine();
string corpo = sb.ToString().Replace($"{Environment.NewLine}", "<br/>");
// FIXME TODO scegliere destinatario
bool fatto = DataLayerObj.sendEmail("samuele@steamware.net", oggetto, corpo);
if (fatto)
{
// 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();
}
/// <summary>
/// css dato status (0 = all OK, > 0 ALLARMI)
/// </summary>
/// <param name="status"></param>
/// <returns></returns>
public string cssByStatus(object rawStatus)
{
int status = 0;
int.TryParse($"{rawStatus}", out status);
return status > 0 ? "text-danger" : "text-success";
}
/// <summary>
/// Indica se ci sia registrato ACK utente
/// </summary>
/// <param name="rawUser"></param>
/// <returns></returns>
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();
}
}
}
}
}
+53 -30
View File
@@ -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<global::System.DateTime> dtFrom, global::System.Nullable<global::System.DateTime> dtTo, global::System.Nullable<bool> showMulti) {
public virtual DS_applicazione.AlarmLogDataTable getByKey(global::System.Nullable<int> 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<global::System.DateTime> dtFrom, global::System.Nullable<global::System.DateTime> dtTo, global::System.Nullable<bool> 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<global::System.DateTime> dtFrom, global::System.Nullable<global::System.DateTime> dtTo, global::System.Nullable<bool> showMulti, global::System.Nullable<int> maximumRows, global::System.Nullable<int> 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<global::System.DateTime> dtFrom, global::System.Nullable<global::System.DateTime> dtTo, global::System.Nullable<bool> 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<global::System.DateTime> DtRif, string MachineId, string MemAddress, global::System.Nullable<int> MemIndex, global::System.Nullable<int> 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<int> AlarmLogId, global::System.Nullable<global::System.DateTime> 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<int> AlarmLogId, global::System.Nullable<global::System.DateTime> 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));
}
+11
View File
@@ -2893,6 +2893,17 @@ FROM v_AlarmLog</CommandText>
<Mapping SourceColumn="ReqAck" DataSetColumn="ReqAck" />
</Mappings>
<Sources>
<DbSource ConnectionRef="MoonProConnectionString (Settings)" DbObjectName="MoonPro.dbo.stp_AL_getByKey" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getByKey" GetMethodModifier="Public" GetMethodName="getByKey" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getByKey" UserSourceName="getByKey">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_AL_getByKey</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@AlarmLogId" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonProConnectionString (Settings)" DbObjectName="MoonPro.dbo.stp_AL_getFilt" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getFilt" GetMethodModifier="Public" GetMethodName="getFilt" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getFilt" UserSourceName="getFilt">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
+26 -1
View File
@@ -3597,13 +3597,38 @@ namespace MapoDb
userUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseUrl);
userWebUrl = string.Format("{2}jumper.aspx?UserAuthkey={0}&idxDipendente={1}", UserAuthKey, idxDipendente, baseWebUrl);
corpo = string.Format("Hai ricevuto questa email su richiesta tua o dell'Admin per poter procedere a registrare un (nuovo) devices con GPW:{0}<br/>Per proseguire clicca sul link seguente(rete interna):<br />{0}{0}{1}{0}{0}<br /><br />oppure sul link seguente (internet):<br />{0}{0}{2}{0}{0}<br /><br />Team GPW Steamware", Environment.NewLine, userUrl, userWebUrl);
gestEmail.ge.mandaEmail(mittente, destinatario, oggetto, corpo);
gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo);
fatto = true;
}
catch { }
return fatto;
}
/// <summary>
/// Invia una mail al destinatario con oggetto e contenuto
/// </summary>
/// <param name="destinatario"></param>
/// <param name="oggetto"></param>
/// <param name="corpo"></param>
/// <returns></returns>
public bool sendEmail(string destinatario, string oggetto, string corpo)
{
bool fatto = false;
try
{
// compongo la stringa
string mittente = memLayer.ML.CRS("_fromEmail");
gestEmail.geAuth.mandaEmail(mittente, destinatario, oggetto, corpo);
fatto = true;
}
catch(Exception exc)
{
logger.lg.scriviLog($"Eccezione in sendEmail{Environment.NewLine}{exc}", tipoLog.ERROR);
}
return fatto;
}
/// <summary>
/// Invia email di avviso che ci sono dei TC da confermare
/// </summary>