103 lines
2.5 KiB
C#
103 lines
2.5 KiB
C#
using System;
|
|
using System.Web.UI;
|
|
|
|
namespace NKC_WF.WebUserControls
|
|
{
|
|
public partial class cmp_BatchStatsList : BaseUserControl
|
|
{
|
|
#region Protected Properties
|
|
|
|
protected int ShowLast
|
|
{
|
|
get
|
|
{
|
|
int answ = 100;
|
|
int.TryParse(txtNumShow.Text, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
txtNumShow.Text = $"{value}";
|
|
}
|
|
}
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e)
|
|
{
|
|
// recupero num righe ed aggiorno...
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
grView.DataBind();
|
|
}
|
|
|
|
private void updateGraph()
|
|
{
|
|
cmp_BatchStatsPlot.PlotType = ddlType.SelectedValue;
|
|
cmp_BatchStatsPlot.ShowLast = ShowLast;
|
|
cmp_BatchStatsPlot.Legend = traduci($"rep_{ddlType.SelectedValue}");
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected void chkPlotGraph_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
protected void ddlPlaces_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Caricamento pagina
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
cmp_numRow.numRow = 10;
|
|
grView.PageSize = cmp_numRow.numRow;
|
|
divGraph.Visible = false;
|
|
ddlType.Visible = false;
|
|
}
|
|
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
|
}
|
|
|
|
protected void txtNumShow_TextChanged(object sender, EventArgs e)
|
|
{
|
|
doUpdate();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
public void doUpdate()
|
|
{
|
|
divGraph.Visible = chkPlotGraph.Checked;
|
|
ddlType.Visible = chkPlotGraph.Checked;
|
|
if (chkPlotGraph.Checked)
|
|
{
|
|
updateGraph();
|
|
}
|
|
grView.DataBind();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |