Files
2021-03-23 08:37:31 +01:00

64 lines
1.6 KiB
C#

using GPW_data;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GPW_Commesse.WebUserControls
{
public partial class cmp_chart : BaseUserControl
{
#region Public Properties
public DateTime dtRif
{
get
{
DateTime answ = DateTime.Today.AddYears(-10);
DateTime.TryParse(hfData.Value, out answ);
return answ;
}
set
{
hfData.Value = value.ToString("yyyy-MM-dd");
ddlMaxNum.DataBind();
}
}
#endregion Public Properties
#region Protected Methods
protected void ddlMaxNum_SelectedIndexChanged(object sender, EventArgs e)
{
doUpdate();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (DateTime.Today.Subtract(dtRif).TotalDays > 3650)
{
dtRif = DateTime.Today;
}
}
// imposto valori...
hfIdxDip.Value = $"{DataProxy.idxDipendente}";
}
#endregion Protected Methods
#region Public Methods
public void doUpdate()
{
ScriptManager.RegisterStartupScript(divGraphs, this.GetType(), "ForceAction", $"forceRedrawAll({ddlMaxNum.SelectedValue});", true);
}
#endregion Public Methods
}
}