private void LoadUserRestrictions(string UserName) { try { //Load allowed navigation into tree DataTable NavigatorTree = new DataTable(); NavigatorTree = VSWebBL.SecurityBL.AdminTabBL.Ins.NavigatorVisibleUpdateTree(); NavigatorVisibleTreeList.ClearNodes(); if (NavigatorTree.Rows.Count > 0) { NavigatorVisibleTreeList.DataSource = NavigatorTree; NavigatorVisibleTreeList.DataBind(); } DataTable RestrictedNavigatorTree = VSWebBL.SecurityBL.AdminTabBL.Ins.GetRestrictedNavigatorByUserID(UserName, "<=2"); NavigatorNotVisibleTreeList.ClearNodes(); if (RestrictedNavigatorTree.Rows.Count >= 0) { NavigatorNotVisibleTreeList.DataSource = RestrictedNavigatorTree; NavigatorNotVisibleTreeList.KeyFieldName = "ID"; //NavigatorNotVisibleTreeList.ParentFieldName = "ParentID"; NavigatorNotVisibleTreeList.DataBind(); Session["DataNotVisible"] = RestrictedNavigatorTree; } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { FillUserNameComboBox(); Session["DataNotVisible"] = null; //Navigator panel fields and buttons //NavigatorRoundPanel.Enabled = false; } //Navigator if (Session["DataVisible"] == null) { DataTable NavigatorTree = VSWebBL.SecurityBL.AdminTabBL.Ins.NavigatorVisibleUpdateTree(); Session["DataVisible"] = NavigatorTree; } NavigatorVisibleTreeList.DataSource = (DataTable)Session["DataVisible"]; NavigatorVisibleTreeList.DataBind(); NavigatorNotVisibleTreeList.DataSource = (DataTable)Session["DataNotVisible"]; NavigatorNotVisibleTreeList.DataBind(); } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }