[Original] Use Microsoft.Web.ui.WebControls to easily resolve permission tree issues (unlimited level permission management) 3

xiaoxiao2021-03-05  31

PURVIEW_USER_INITIAL.ASPX: User Permissions Initialization, the user data table system function data table is used to make the card set, and deposit the permissions allocation database.

using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.web.ui.htmlcontrols; using microsoft.web.ui.webControls;

Namespace Yljweb._admin.purview_manage {///

/// purview_user_initial's summary description. /// public class Purview_User_Initial: System.Web.UI.Page {protected System.Web.UI.WebControls.Label lbl_Curnodeid; protected Microsoft.Web.UI.WebControls.TreeView TreeViewAll; protected System.Web.UI. WebControls.Button BTN_PURVIEW_INITIAL; protected system.web.ui.webcontrols.label lbl_mesg; protected yljweb.classes.treeControl Tree = new yljweb.classes.treeControl ();

Private void page_load (object sender, system.eventargs e) {// Place user code here to initialize page if (! page.ispostback) // is the first to respond to the client or whether it is the first visit, The system automatically generates {bindtreeViewall ();}}

#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private void InitializeComponent () {this.btn_Purview_Initial.Click = new System.EventHandler (this.btn_Purview_Initial_Click); this.Load = new System.EventHandler (this.Page_Load);

} #Endregion

private void BindTreeViewAll () {string str_Sql = "select * from Purview_All order by order_id"; if (YljWeb.Classes.SqlConn.IsExist (str_Sql)) // tree traversal {tree.BindTreeViewShow ( "nodeid", "parentid", " location "," mytext ", str_Sql, lbl_Curnodeid, TreeViewAll);}} private void btn_Purview_Initial_Click (object sender, System.EventArgs e) {this.lbl_mesg.Text ="! user rights system is initializing operation, please wait " ; // Clear the list of permissions string strSql_Clear = "Delete from Purview_User_Have"; YljWeb.Classes.SqlConn.ExecuteSql (strSql_Clear); // find out all users string strSql_User = "Select * from AdminUser"; DataSet ds_user = new DataSet () DS_USER = YLJWEB.CLASS.SQLCONN.EXECUtesqlFordataset (strsql_user); if (DS_USER.TABLES [0] .Rows.count> 0) {for (int i = 0; i

/// Combined user permission list item / if (DS_PURVIEW.TABLES [0] .Rows.count> 0) {for (int J = 0; j

转载请注明原文地址:https://www.9cbs.com/read-37037.html

New Post(0)