107 lines
2.7 KiB
C#
107 lines
2.7 KiB
C#
using SteamWare;
|
|
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace MoonProTablet.WebUserControls
|
|
{
|
|
public partial class mod_dettMacchina : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// fatto refresh --> chiedo remove modal (se c'è)
|
|
/// </summary>
|
|
public event EventHandler eh_reqRemoveModal;
|
|
/// <summary>
|
|
/// idx macchina selezionata
|
|
/// </summary>
|
|
public string idxMacchina
|
|
{
|
|
get
|
|
{
|
|
return memLayer.ML.StringSessionObj("IdxMacchina");
|
|
}
|
|
set
|
|
{
|
|
memLayer.ML.setSessionVal("IdxMacchina", value);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// caricamento pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
dmTimer.Interval = memLayer.ML.CRI("dtTimerInt");
|
|
}
|
|
// controllo se ho dett macchina altrimenti ritorno a pagina generale...
|
|
if (idxMacchina == "")
|
|
{
|
|
Response.Redirect("~/MappaStato.aspx");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// url completo immagine
|
|
/// </summary>
|
|
/// <param name="url"></param>
|
|
/// <returns></returns>
|
|
public string ImgUrl(object url)
|
|
{
|
|
if (url.ToString() == "")
|
|
{
|
|
url = "empty.png";
|
|
}
|
|
return string.Format("./images/macchine/{0}", url);
|
|
}
|
|
/// <summary>
|
|
/// fomratta durata in minuti/ore/gg a seconda del totale...
|
|
/// </summary>
|
|
/// <param name="minuti"></param>
|
|
/// <returns></returns>
|
|
public string formatDurata(object min)
|
|
{
|
|
return utility.formatDurata(min);
|
|
}
|
|
/// <summary>
|
|
/// fa update del controllo
|
|
/// </summary>
|
|
public void doUpdate()
|
|
{
|
|
ods.DataBind();
|
|
repLI.DataBind();
|
|
}
|
|
/// <summary>
|
|
/// timeout scaduto
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Timer1_Tick(object sender, EventArgs e)
|
|
{
|
|
// sollevo evento!
|
|
if (eh_reqRemoveModal != null)
|
|
{
|
|
eh_reqRemoveModal(this, new EventArgs());
|
|
}
|
|
// update
|
|
doUpdate();
|
|
//ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('div').trigger('create');</script>", false);
|
|
ScriptManager.RegisterStartupScript(Page, GetType(), "temp", "<script type='text/javascript'>$('#dettMacch').trigger('create');</script>", false);
|
|
}
|
|
/// <summary>
|
|
/// Determina se il refresh (via timer) sia o meno abilitato
|
|
/// </summary>
|
|
public bool refreshEnabled
|
|
{
|
|
get
|
|
{
|
|
return dmTimer.Enabled;
|
|
}
|
|
set
|
|
{
|
|
dmTimer.Enabled = value;
|
|
}
|
|
}
|
|
}
|
|
} |