Beispiel #1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            lstGroupRoles.Items.Clear();
            CmdDB.FillToListBox(lstGroupRoles.Items);

            DataTable dtGroupRoles = CmdRoleDB.GetGroupRoles(groupInfo.Group_ID);
            string    roles        = "|";

            foreach (DataRow row in dtGroupRoles.Rows)
            {
                roles += row["Cmd_ID"] + "|";
            }

            int i = 0;

            while (i < lstGroupRoles.Items.Count)
            {
                if (roles.IndexOf("|" + lstGroupRoles.Items[i].Value + "|") < 0)
                {
                    lstGroupRoles.Items.RemoveAt(i);
                }
                else
                {
                    i += 1;
                }
            }
        }
Beispiel #2
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            CmdDB.FillToListBox(dropParent.Items);
            dropParent.Items.Insert(0, new ListItem("Root", "0"));

            if (txtID.Text != string.Empty)
            {
                CmdInfo info = CmdDB.GetInfo(ConvertUtility.ToInt32(txtID.Text));
                if (info != null)
                {
                    dropParent.SelectedIndex = -1;
                    MiscUtility.SetSelected(dropParent.Items, info.Cmd_ParentID.ToString());
                }
            }

            nodePath = "|";
            TreeViewNode focusNode = tvwCmds.SelectedNode;

            if (focusNode != null)
            {
                while (true)
                {
                    if (focusNode.ParentNode == null)
                    {
                        break;
                    }
                    else
                    {
                        focusNode = focusNode.ParentNode;
                        nodePath += focusNode.ID + "|";
                    }
                }
            }

            tvwCmds.Nodes.Clear();
            TreeViewNode topRoot = new TreeViewNode();

            topRoot.Text = "Root";
            topRoot.ID   = "0";
            tvwCmds.Nodes.Add(topRoot);

            DataTable dtRoot = CmdDB.GetByParentID(0);

            foreach (DataRow row in dtRoot.Rows)
            {
                TreeViewNode rootNode = new TreeViewNode();
                rootNode.Text = row["Cmd_Name"].ToString();
                rootNode.ID   = row["Cmd_ID"].ToString();

                if (nodePath.IndexOf("|" + rootNode.ID + "|") >= 0)
                {
                    rootNode.Expanded = true;
                }
                tvwCmds.Nodes.Add(rootNode);
                LoadCmdItem(rootNode);
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            groupInfo = GroupDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["groupid"]));
            if (groupInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_PATH);
            }

            txtGroupName.Text    = groupInfo.Group_Name;
            lblUpdateStatus.Text = string.Empty;
            if (!IsPostBack)
            {
                lstRoles.Items.Clear();
                CmdDB.FillToListBox(lstRoles.Items);
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            userInfo = UserDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["userid"]));
            if (userInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_PATH);
            }

            lblUserEmail.Text    = userInfo.User_Email;
            lblUpdateStatus.Text = string.Empty;
            if (!IsPostBack)
            {
                lstRoles.Items.Clear();
                CmdDB.FillToListBox(lstRoles.Items);
            }
        }