using AppData;
using SteamWare;
using System;
using System.Web.UI.WebControls;
namespace C_TRACK.WebUserControls
{
public partial class mod_btnComandi : System.Web.UI.UserControl
{
///
/// Codice TASK corrente
///
public string CurrNumTask
{
get
{
return memLayer.ML.StringSessionObj("CurrNumTask");
}
}
///
/// evento comando clicked
///
public event EventHandler eh_clickComando;
protected void Page_Load(object sender, EventArgs e)
{
updateBtn();
}
///
/// segnala click su button comando
///
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();
}
///
/// Verifica btn siano abilitati e nel caso x css aggiunge DISABLED
/// - ho una commessa
/// - la commessa NON E' chiusa...
///
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;
}
}
}
}