Fix causali x indicare flashing richeista riqualifica

This commit is contained in:
Samuele E. Locatelli
2018-03-14 18:17:48 +01:00
parent 94c332dfda
commit 0355551fe6
13 changed files with 433 additions and 152 deletions
@@ -1,4 +1,5 @@
using SteamWare;
using MapoDb;
using SteamWare;
using System;
using System.Web.UI;
@@ -41,6 +42,7 @@ namespace MoonProTablet.WebUserControls
{
Response.Redirect("~/MappaStato.aspx");
}
//hlFermate.Visible = showInsFermata;
}
/// <summary>
/// url completo immagine
@@ -78,7 +80,7 @@ namespace MoonProTablet.WebUserControls
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Timer1_Tick(object sender, EventArgs e)
{
{
// sollevo evento!
if (eh_reqRemoveModal != null)
{
@@ -103,5 +105,30 @@ namespace MoonProTablet.WebUserControls
dmTimer.Enabled = value;
}
}
/// <summary>
/// Determina se dato lo stato dell'impianto si debba mostrare btn fermata perché
/// - fermo > xx min (da web.config, es 20')
/// - impianto fermo (controllando idxStato: priorità > 1)
/// </summary>
public bool showInsFermata(object _idxStato, object _durata)
{
int idxStato = 0;
int durata = 0;
int durMinWarning = memLayer.ML.CRI("durMinWarning");
int.TryParse(_idxStato.ToString(), out idxStato);
int.TryParse(_durata.ToString(), out durata);
bool answ = false;
if (durata >= durMinWarning)
{
try
{
// in questo caso controllo idxStato... e recupero priorità se > 1 --> richiesta qualifica
answ = (DataLayer.obj.taAnagStati.GetByIdx(idxStato)[0].Priorita > 1);
}
catch
{ }
}
return answ;
}
}
}