84 lines
1.7 KiB
C#
84 lines
1.7 KiB
C#
using MapoSDK;
|
|
using Newtonsoft.Json;
|
|
using SteamWare;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace ES3.WebUserControls
|
|
{
|
|
public partial class cmp_calStop : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// URL di base x chiamate remote
|
|
/// </summary>
|
|
protected string remoteApi = memLayer.ML.CRS("remoteApi");
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
setLimitDDl();
|
|
}
|
|
}
|
|
|
|
private void setLimitDDl()
|
|
{
|
|
int anno = DateTime.Now.Year;
|
|
hfMinAnno.Value = anno.ToString();
|
|
hfMaxAnno.Value = (anno + 3).ToString();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Anno selezionato
|
|
/// </summary>
|
|
public int anno
|
|
{
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(lblAnno.Text, out answ);
|
|
return answ;
|
|
}
|
|
set
|
|
{
|
|
lblAnno.Text = value.ToString();
|
|
grView.DataBind();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Anno selezionato
|
|
/// </summary>
|
|
public int mese
|
|
{
|
|
//get
|
|
//{
|
|
// int answ = 0;
|
|
// int.TryParse(lblMese.Text, out answ);
|
|
// return answ;
|
|
//}
|
|
set
|
|
{
|
|
lblMese.Text = value.ToString();
|
|
grView.DataBind();
|
|
}
|
|
}
|
|
|
|
protected void lbtGetHolidays_Click(object sender, EventArgs e)
|
|
{
|
|
// scarico elenco da web
|
|
string remoteUrl = $"{remoteApi}api/Holiday/{anno}";
|
|
// chiamo
|
|
string rawResult = ES3.callUrl(remoteUrl);
|
|
if (!string.IsNullOrEmpty(rawResult))
|
|
{
|
|
// deserializzo
|
|
//var elenco = JsonConvert.DeserializeObject<List<EventDetail>>(rawResult);
|
|
|
|
}
|
|
}
|
|
}
|
|
} |