using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Estatisticas_Inc_Calendario_Anos : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { /* ================================================================================= */ /* ================================================================================= */ if (Request.ServerVariables["HTTP_REFERER"] == null || Request.ServerVariables["HTTP_REFERER"].ToUpper().IndexOf("/SITE/ESTATISTICAS") < 0) { // REDIRECCIONA PARA A PÁGINA DE LOGIN.aspx // CASO ESTA PÁGINA SEJA ACEDIDA DIRECTAMENTE SEM PASSAR PELO SITE Response.Redirect("/login.aspx"); } int ano = 0; int anoAnterior = 0; int anoProximo = 0; ano = Convert.ToInt16(Request.QueryString["a"].ToString()); if (ano == 0) { ano = DateTime.Now.Year; } /* ************************************************************************************************* */ /* NAVEGAÇÃO */ anoAnterior = ano; anoProximo = ano; /* ********************************************************************************* */ // ANO ANTERIOR anoAnterior = ano - 1; hlAnoAnterior.Text = "« " + anoAnterior; hlAnoAnterior.NavigateUrl = "javascript:new Estatisticas().AbrirAnos('" + anoAnterior + "');" + " new Estatisticas().AbrirEstatisticas('" + anoAnterior + "', '0', '0');"; /* ********************************************************************************* */ // ANO ACTUAL hlAnoActual.Text = ano.ToString(); hlAnoActual.NavigateUrl = "javascript:new Estatisticas().AbrirEstatisticas('" + ano + "', '0', '0');"; /* ********************************************************************************* */ // MÊS SEGUINTE anoProximo = ano + 1; hlAnoProximo.Text = anoProximo + " »"; hlAnoProximo.NavigateUrl = "javascript:new Estatisticas().AbrirAnos('" + anoProximo + "');" + " new Estatisticas().AbrirEstatisticas('" + anoProximo + "', '0', '0');"; /* ************************************************************************************************* */ } }