示例#1
0
        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 { }
        }
示例#2
0
        private string GetRestrictedMenu()
        {
            string selValues = "";
            TreeListNodeIterator iterator = NavigatorNotVisibleTreeList.CreateNodeIterator();
            TreeListNode         node;

            while (true)
            {
                node = iterator.GetNext();
                if (node == null)
                {
                    break;
                }
                if (selValues == "")
                {
                    selValues = "" + node.Key + "";
                }
                else
                {
                    selValues += "," + "" + node.Key + "";
                }
            }

            return(selValues);
        }
示例#3
0
        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 { }
        }
示例#4
0
        protected void ResetServerAccessButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsPostBack)
                {
                    FillUserNameComboBox();
                    UserNameComboBox.Text = "";

                    NavigatorNotVisibleTreeList.ClearNodes();
                    NavigatorVisibleTreeList.UnselectAll();
                }
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }