Files
2021-03-15 19:06:54 +01:00

175 lines
4.2 KiB
C#

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
/// <summary>
/// selezione checkbox x mostrare TUTTI i dati
/// </summary>
public bool checkAll
{
get
{
return chkTutti.Checked;
}
}
/// <summary>
/// Visibilità Controlli
/// </summary>
public bool CtrlVisible
{
get
{
return ddlODL.Visible;
}
set
{
ddlODL.Visible = value;
chkTutti.Visible = value;
}
}
/// <summary>
/// abilitazione selezione dati
/// </summary>
public bool Enabled
{
get
{
return ddlODL.Enabled;
}
set
{
ddlODL.Enabled = value;
if (value)
{
odsODL.DataBind();
}
fixWCtrStatus(ddlODL);
}
}
/// <summary>
/// idxMacchina selezionata
/// </summary>
public new string idxMacchinaFix
{
get
{
return hfIdxMacchina.Value;
}
set
{
hfIdxMacchina.Value = value;
ddlODL.DataBind();
}
}
/// <summary>
/// codice ODL selezionato
/// </summary>
public int idxODLSel
{
get
{
int answ = 0;
try
{
answ = Convert.ToInt32(ddlODL.SelectedValue);
}
catch
{ }
return answ;
}
}
/// <summary>
/// Indice selezione in DropDown
/// </summary>
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();
}
/// <summary>
/// selezionato un ODL mostro note/tempo da validare
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e)
{
reportSelect();
}
/// <summary>
/// Sistema CSS x status enabled/disabled
/// </summary>
/// <param name="lbtn"></param>
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
}
}