51 lines
1.5 KiB
C#
51 lines
1.5 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;
|
|
using WebSCR_data;
|
|
|
|
namespace WebSCR.WebUserControls
|
|
{
|
|
public partial class mod_squadre : System.Web.UI.UserControl
|
|
{
|
|
|
|
protected string cookieName = "colorSquadraCurr";
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
bool showSel = true;
|
|
// controllo se c'è il cookie
|
|
if (memLayer.ML.hasCookieVal(cookieName))
|
|
{
|
|
// se c'è e non è expired
|
|
showSel = false;
|
|
}
|
|
rblSquadre.Visible = showSel;
|
|
}
|
|
/// <summary>
|
|
/// selezione nuova squadra...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void rblSquadre_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
// salvo cookie!
|
|
string codSquadra = "";
|
|
try
|
|
{
|
|
codSquadra = rblSquadre.SelectedValue;
|
|
}
|
|
catch
|
|
{ }
|
|
if (codSquadra != "")
|
|
{
|
|
DS_Applicazione.AnagSquadreRow riga = DtProxy.man.taAS.getByKey(codSquadra)[0];
|
|
memLayer.ML.setCookieVal(cookieName, riga.CssColor, DateTime.Now.AddMinutes(memLayer.ML.confReadInt("minCookieSquadra")));
|
|
Response.Redirect(devicesAuthProxy.pagCorrente);
|
|
}
|
|
}
|
|
}
|
|
} |