125 lines
3.9 KiB
C#
125 lines
3.9 KiB
C#
using MapoDb;
|
|
using MoonPro.WebUserControls;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace MoonPro
|
|
{
|
|
public partial class MappaStatoSeq : System.Web.UI.Page
|
|
{
|
|
public resoconti _resoconti;
|
|
public int numGg
|
|
{
|
|
get
|
|
{
|
|
int answ = 1;
|
|
try
|
|
{
|
|
answ = Convert.ToInt32(ddlNumgg.SelectedValue);
|
|
}
|
|
catch
|
|
{
|
|
answ = 1;
|
|
}
|
|
return answ;
|
|
}
|
|
}
|
|
public intervalloDate intervalloAnalisi
|
|
{
|
|
get
|
|
{
|
|
intervalloDate answ = new intervalloDate();
|
|
answ.fine = DateTime.Now;
|
|
answ.inizio = answ.fine.AddDays(-numGg);
|
|
return answ;
|
|
}
|
|
}
|
|
protected DS_applicazione.MacchineDataTable tabMacchine;
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
_resoconti = new resoconti();
|
|
tabMacchine = MapoDb.DataLayer.obj.taMacchine.GetData();
|
|
if (!Page.IsPostBack)
|
|
{
|
|
ddlNumgg.DataBind();
|
|
ddlNumgg.SelectedValue = memLayer.ML.confReadString("seq_gg");
|
|
}
|
|
if (memLayer.ML.BoolSessionObj("graphDataRefresh"))
|
|
{
|
|
repSeq.DataBind();
|
|
}
|
|
}
|
|
|
|
|
|
protected void repSeq_ItemDataBound(object sender, RepeaterItemEventArgs e)
|
|
{
|
|
mod_sequencerStati sequencer = (mod_sequencerStati)e.Item.FindControl("seqStato");
|
|
sequencer.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100;
|
|
sequencer.graphHeight = memLayer.ML.confReadInt("seq_height");
|
|
sequencer.numSplit = memLayer.ML.confReadInt("seq_numSpl");
|
|
try
|
|
{
|
|
sequencer.datiSequencer = _resoconti.sequenzaDati(sequencer.identificativo, intervalloAnalisi);
|
|
sequencer.doUpdate();
|
|
sequencer.Visible = true;
|
|
}
|
|
catch
|
|
{
|
|
sequencer.Visible = false;
|
|
}
|
|
}
|
|
|
|
protected void lnkCambiaModo_Click(object sender, EventArgs e)
|
|
{
|
|
// passa alla pagina richiesta...
|
|
LinkButton lb = (LinkButton)sender;
|
|
Response.Redirect(lb.CommandArgument);
|
|
}
|
|
|
|
protected void ddlNumgg_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
repSeq.DataBind();
|
|
}
|
|
/// <summary>
|
|
/// recupera nome macchina da idx
|
|
/// </summary>
|
|
/// <param name="idxMacchina"></param>
|
|
/// <returns></returns>
|
|
public string nomeMacchina(string idxMacchina)
|
|
{
|
|
string answ = "...";
|
|
answ = tabMacchine.FindByIdxMacchina(idxMacchina).Nome;
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// recupera stato macchina da idx
|
|
/// </summary>
|
|
/// <param name="idxMacchina"></param>
|
|
/// <returns></returns>
|
|
public string cssStatoMacchina(string idxMacchina)
|
|
{
|
|
string answ = "...";
|
|
string codColore = resoconti.mngr.semaforoDaIdxStato(resoconti.mngr.statoMacchina(idxMacchina));
|
|
answ = codColore;
|
|
return answ;
|
|
}
|
|
/// <summary>
|
|
/// rimanda alla pagina di dettaglio della macchina scelta
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void lnkMacchina_Click(object sender, EventArgs e)
|
|
{
|
|
LinkButton lb = (LinkButton)sender;
|
|
Session["IdxMacchina"] = lb.CommandArgument;
|
|
Response.Redirect("~/DettaglioMacchina.aspx");
|
|
}
|
|
|
|
protected void btnReload_Click(object sender, EventArgs e)
|
|
{
|
|
repSeq.DataBind();
|
|
}
|
|
}
|
|
} |