using SteamWare; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace MoonProTablet.WebUserControls { public partial class cmp_selPODL : BaseUserControl { #region Public Properties /// /// selezione checkbox x mostrare TUTTI i dati /// public bool checkAll { get { return chkTutti.Checked; } } /// /// Visibilità Controlli /// public bool CtrlVisible { get { return ddlODL.Visible; } set { ddlODL.Visible = value; chkTutti.Visible = value; } } /// /// abilitazione selezione dati /// public bool Enabled { get { return ddlODL.Enabled; } set { ddlODL.Enabled = value; if (value) { odsODL.DataBind(); } fixWCtrStatus(ddlODL); } } /// /// idxMacchina selezionata /// public new string idxMacchinaFix { get { return hfIdxMacchina.Value; } set { hfIdxMacchina.Value = value; ddlODL.DataBind(); } } /// /// codice ODL selezionato /// public int idxODLSel { get { int answ = 0; try { answ = Convert.ToInt32(ddlODL.SelectedValue); } catch { } return answ; } } /// /// Indice selezione in DropDown /// public int SelectedIndex { get { return ddlODL.SelectedIndex; } set { try { ddlODL.SelectedIndex = value; } catch { } } } #endregion Public Properties #region Protected Methods protected void chkTutti_CheckedChanged(object sender, EventArgs e) { reportUpdate(); SelectedIndex = -1; reportSelect(); } /// /// selezionato un ODL mostro note/tempo da validare /// /// /// protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e) { reportSelect(); } /// /// Sistema CSS x status enabled/disabled /// /// protected void fixWCtrStatus(object lbtn) { // tolgo (eventuale) classe try { ((WebControl)lbtn).CssClass = ((WebControl)lbtn).CssClass.Replace("disabled", ""); // se richiesto metto disabled... if (!((WebControl)lbtn).Enabled) { ((WebControl)lbtn).CssClass += " disabled"; } } catch { } } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // verifico parametro attivabilità come filtraggio bool OptOdlStartAttivabili = memLayer.ML.cdvb("OptOdlStartAttivabili"); hfFiltroAttivabili.Value = $"{OptOdlStartAttivabili}"; hfNumDayOdl.Value = $"{numDaySelOdl}"; } } protected void txtSearchODL_TextChanged(object sender, EventArgs e) { odsODL.DataBind(); } #endregion Protected Methods } }