예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CapaDatos.ClsCapaDatos objDatos = new CapaDatos.ClsCapaDatos();
        objDatos.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ConnectionString;
        //lblUser.Text ="Usuario: " + (string)HttpContext.Current.Session[Constantes.Session.Usuario];
        //lblUser.Text = lblUser.Text + AVE.Contexto.Usuario;

        if (!objDatos.HaySesionActivaTPV())
        {
            Response.Redirect(Constantes.Paginas.Login);
        }

        if (Page.IsPostBack)
        {
            this.lblUser.Text = lblUser.Text;
        }
        else
        {
            string usu = (string)HttpContext.Current.Session[Constantes.Session.Usuario];
            if (!string.IsNullOrEmpty(usu))
            {
                string[] ar = usu.Split(' ');
                this.lblUser.Text = ar[1].ToUpper() + ", " + ar[0];
            }
            else
            {
                this.lblUser.Text = "";
            }
        }
    }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     CapaDatos.ClsCapaDatos objDatos = new CapaDatos.ClsCapaDatos();
     objDatos.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ConnectionString;
     if (!objDatos.HaySesionActivaTPV())
     {
         Response.Redirect(Constantes.Paginas.Login);
     }
 }