Files
C.TRACK/C-TRACK/WebUserControls/mod_btnComandi.ascx.cs
T
2018-09-05 13:11:52 +02:00

78 lines
1.8 KiB
C#

using AppData;
using SteamWare;
using System;
using System.Web.UI.WebControls;
namespace C_TRACK.WebUserControls
{
public partial class mod_btnComandi : System.Web.UI.UserControl
{
/// <summary>
/// Codice TASK corrente
/// </summary>
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
/// <summary>
/// evento comando clicked
/// </summary>
public event EventHandler eh_clickComando;
protected void Page_Load(object sender, EventArgs e)
{
updateBtn();
}
/// <summary>
/// segnala click su button comando
/// </summary>
public void segnalaClick()
{
if (eh_clickComando != null)
{
eh_clickComando(this, new EventArgs());
}
}
protected void lbtCmd_Click(object sender, EventArgs e)
{
LinkButton lb = (LinkButton)sender;
memLayer.ML.setSessionVal("btnCmdPress", lb.CommandArgument, false);
segnalaClick();
}
public void updateBtn()
{
// verifico se ho comandi PREVALENTI (es: ho UNA FASE APERTA) !!!FARE!!!
// altrimenti imposto fasi da postazione...
repComandi.DataBind();
}
/// <summary>
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
/// </summary>
public string cssEnabled
{
get
{
string answ = "";
bool noTask = CurrNumTask == "";
bool isChiuso = false;
try
{
isChiuso = dataLayer.man.taTL.getByKey(CurrNumTask)[0].Concluso;
}
catch
{ }
// controllos e ho in sessione numTask altrimenti NON E' abilitato...
answ = (noTask || isChiuso) ? "disabled" : "";
return answ;
}
}
}
}