protected void Page_Load(object sender, EventArgs e)
        {
            //TODO: AL INICIAR EL FORMULARIO VALIDO QUE TIPO DE PERSONA ES Y VALIDO SI DEJO ENTRAR O NO...
            //TODO: TODOS LOS WEB FORM DEBEN IMPLEMENTAR ESTE PEDAZO DE CODIGO PARA QUE SE VALIDEN LOS PERMISOS DE USUARIOS...
            TipoPersona tipo = (TipoPersona)Session["tipousuario"];

            if (tipo != null)
            {
                if (!ValidarPermisos.TienePermisosUsuario(tipo.Id, this.Page.AppRelativeVirtualPath.Replace("~/", "").Replace(".aspx", "")))
                {
                    Response.Redirect("~/Permisos.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
            if (!IsPostBack)
            {
                this.BindGV();
                var dataList = cplan.dameTodos();

                this.listIdPlan.DataSource = dataList;

                this.listIdPlan.DataValueField = "Id";
                this.listIdPlan.DataTextField  = "DescripcionPlan";
                this.listIdPlan.DataBind();
            }
            this.formActionPanel.Visible = false;
            this.formPanel.Visible       = false;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            TipoPersona tipo = (TipoPersona)Session["tipousuario"];

            if (tipo != null)
            {
                if (!Util.ValidarPermisos.TienePermisosUsuario(tipo.Id, this.Page.AppRelativeVirtualPath.Replace("~/", "").Replace(".aspx", "")))
                {
                    Response.Redirect("~/Permisos.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Login.aspx");
            }
            if (!IsPostBack)
            {
                this.BindGV();
                var dataList = cp.dameTodos();

                this.listIdPlan.DataSource     = dataList;
                this.listIdPlan.DataValueField = "Id";
                this.listIdPlan.DataTextField  = "DescripcionPlan";
                this.listIdPlan.DataBind();
            }
            this.formActionPanel.Visible = false;
            this.formPanel.Visible       = false;
        }
예제 #3
0
        protected void BindGV()
        {
            List <Entidades.Plan> planes = new List <Entidades.Plan>();

            planes = cp.dameTodos();
            this.gridView.DataSource = planes;
            this.gridView.DataBind();
        }
예제 #4
0
        public void Listar()
        {
            ControladorPlanes ul = new ControladorPlanes();

            dgvPlanes.DataSource = ul.dameTodos();  //asignaremos el resultado a la propiedad DataSource de la grilla
        }