Esempio n. 1
0
    protected void gv_listaPerfiles_RowEditing(object sender, GridViewEditEventArgs e)
    {
        PerfilBC perfil = new PerfilBC();

        gv_listar.SelectedIndex = e.NewEditIndex;
        int id = int.Parse(this.gv_listar.SelectedDataKey.Value.ToString());

        perfil = perfil.ObtenerXId(id, true);
        if (perfil.ID > 0)
        {
            this.hf_id.Value               = perfil.ID.ToString();
            this.txt_nombreEdita.Text      = perfil.NOMBRE;
            this.txt_descripcionEdita.Text = perfil.DESCRIPCION;
            this.txt_editPermisos.Text     = perfil.NIVEL_PERMISOS.ToString();
            this.hf_checkMenus.Value       = perfil.MENU;
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "checkSorting", "checkSorting();", true);
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "modalPerfil();", true);
        }
        else
        {
            string texto = "No se encontró el perfil seleccionado!";
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "mensaje", "alert('" + texto + "');", true);
        }
    }