Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        panelMens.Visible = false;
        panelErr.Visible  = false;
        if (!IsPostBack)
        {
            try
            {
                StringBuilder oStringBuilder = new StringBuilder();
                using (ControladorMenus mnu = new ControladorMenus())
                {
                    int       idOperador = ApplicationSesion.ActiveUser.Idusuario;
                    int       idSucursal = ApplicationSesion.ActiveSucursal.IdSucursal;
                    DataTable dtMenus    = mnu.ObtenerMenusUsuario(idOperador, idSucursal, 1); // (Convert.ToInt32(Session["codusuario"]));
                    //DataTable dtMenus = mnu.ObtenerMenusUsuario(50237, 1, 1);
                    DataRow[] rowsMenu = dtMenus.Select("nivel = 1");
                    string    menu     = GenerarMenu(rowsMenu, dtMenus, oStringBuilder);
                    LiteralMenu.Text = menu;
                }
                lblSucursal.Text = ApplicationSesion.ActiveSucursal.Descripcion;


                mostrarCaja();
            }
            catch (Exception)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                Session.Clear();
                Session.Abandon();
                Session.Clear();
                Response.Redirect("~/Login.aspx");
            }
        }
    }