Ejemplo n.º 1
0
        public TreeNode GenerateManageWebTreeNodeByParentDepartment(string rootImageUrl, string itemImageUrl, int rootDepartmentID)
        {
            SuperWebTreeNode baseTreeNode = new SuperWebTreeNode(SYSTEMDEPARTMENT_MIN_DEPTH, SYSTEMDEPARTMENT_MAX_DEPTH, 0);

            baseTreeNode.Checked      = false;
            baseTreeNode.SelectAction = TreeNodeSelectAction.Select;
            baseTreeNode.Text         = "²¿ÃŹÜÀí";
            baseTreeNode.Value        = "0";
            baseTreeNode.ImageUrl     = rootImageUrl;

            SystemDepartment rootDepartment = null;

            if (rootDepartmentID > 0)
            {
                rootDepartment = this.SelfDao.Load(rootDepartmentID);
            }

            List <SystemDepartment> topLevelSystemDepartment =
                this.SelfDao.GetSubDepartmentByParentDepartment(rootDepartment);

            foreach (SystemDepartment topDepartment in topLevelSystemDepartment)
            {
                GenerateSubManageWebTreeNodeByParentDepartment(itemImageUrl, topDepartment, baseTreeNode);
            }

            return(baseTreeNode);
        }
Ejemplo n.º 2
0
        public TreeNode GenerateSelectAssignedWebTreeNodeByApplication(SystemApplication app, string rootImageUrl, string groupImageUrl, string itemImageUrl)
        {
            SuperWebTreeNode baseTreeNode = new SuperWebTreeNode(SYSTEMMENU_MIN_DEPTH, SYSTEMMENU_MAX_DEPTH, 0);

            baseTreeNode.ShowCheckBox = false;
            baseTreeNode.SelectAction = TreeNodeSelectAction.None;
            baseTreeNode.Text         = app.SystemApplicationName;
            baseTreeNode.Value        = "0";
            baseTreeNode.ImageUrl     = rootImageUrl;


            List <SystemMenu> listmenu =
                this.SelfDao.GetMenuByApplication(app);

            foreach (SystemMenu groupMenu in listmenu)
            {
                if (groupMenu.MenuIsEnable && groupMenu.MenuIsCategory)
                {
                    SuperWebTreeNode groupTreeNode = new SuperWebTreeNode(SYSTEMMENU_MIN_DEPTH, SYSTEMMENU_MAX_DEPTH, 0);
                    groupTreeNode.Checked      = false;
                    groupTreeNode.SelectAction = TreeNodeSelectAction.None;
                    groupTreeNode.Text         = groupMenu.MenuName;
                    groupTreeNode.ImageUrl     = groupImageUrl;
                    groupTreeNode.Value        = groupMenu.MenuID.ToString();
                    baseTreeNode.ChildNodes.Add(groupTreeNode);
                    foreach (SystemMenu itemMenu in listmenu)
                    {
                        if (itemMenu.MenuIsEnable && !itemMenu.MenuIsCategory && itemMenu.ParentMenuID == groupMenu)
                        {
                            SuperWebTreeNode itemTreeNode = new SuperWebTreeNode(SYSTEMMENU_MIN_DEPTH, SYSTEMMENU_MAX_DEPTH, 0);
                            itemTreeNode.Checked      = false;
                            itemTreeNode.SelectAction = TreeNodeSelectAction.None;
                            itemTreeNode.Text         = itemMenu.MenuName;
                            itemTreeNode.ImageUrl     = itemImageUrl;
                            itemTreeNode.Value        = itemMenu.MenuID.ToString();
                            groupTreeNode.ChildNodes.Add(itemTreeNode);
                        }
                    }
                }
            }

            return(baseTreeNode);
        }
Ejemplo n.º 3
0
        private void GenerateSubManageWebTreeNodeByParentDepartment(string itemImageUrl, SystemDepartment upDepartment, TreeNode upTreeNode)
        {
            SuperWebTreeNode groupTreeNode = new SuperWebTreeNode(SYSTEMDEPARTMENT_MIN_DEPTH, SYSTEMDEPARTMENT_MAX_DEPTH, 0);

            groupTreeNode.Checked      = false;
            groupTreeNode.SelectAction = TreeNodeSelectAction.Select;
            groupTreeNode.Text         = upDepartment.DepartmentNameCn;
            groupTreeNode.ImageUrl     = itemImageUrl;
            groupTreeNode.Value        = upDepartment.DepartmentID.ToString();
            upTreeNode.ChildNodes.Add(groupTreeNode);

            List <SystemDepartment> topLevelSystemDepartment =
                this.SelfDao.GetSubDepartmentByParentDepartment(upDepartment);

            foreach (SystemDepartment department in topLevelSystemDepartment)
            {
                GenerateSubManageWebTreeNodeByParentDepartment(itemImageUrl, department, groupTreeNode);
            }
        }
Ejemplo n.º 4
0
        private void SetButtonProperty(SuperWebTreeNode node)
        {
            this.btnAddSubMenu.Visible  = node.CanAddSubItem;
            this.btnAddSubMenu.Disabled = !node.AllowAddSubItem;
            this.btnSave.Visible        = node.CanModify;
            this.btnSave.Disabled       = !node.AllowModify;
            this.btnDelete.Visible      = node.CanDelete;
            this.btnDelete.Disabled     = !node.AllowDelete;
            this.btnUp.Visible          = node.CanMoveUp;
            this.btnUp.Disabled         = !node.AllowMoveUp;
            this.btnDown.Visible        = node.CanMoveDown;
            this.btnDown.Disabled       = !node.AllowMoveDown;
            this.btnReSorted.Visible    = node.CanResortSub;
            this.btnReSorted.Disabled   = !node.AllowResortSub;
            InputControlHelper.ClearInputButton(btnAddSubMenu, new string[] { "onclick", "Title" });
            InputControlHelper.ClearInputButton(btnSave, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDelete, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnUp, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDown, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnReSorted, new string[] { "Title" });


            if (node.CanDelete && !node.AllowDelete)
            {
                this.btnDelete.Attributes["Title"] = "请先删除下面的子菜单。";
            }

            if (node.CanMoveUp && !node.AllowMoveUp)
            {
                this.btnUp.Attributes["Title"] = "该菜单是第一个,无法上移。";
            }

            if (node.CanMoveDown && !node.AllowMoveDown)
            {
                this.btnDown.Attributes["Title"] = "该菜单是最后一个,无法下移。";
            }
        }
Ejemplo n.º 5
0
        private void SelectNode(TreeNode selectNode)
        {
            SuperWebTreeNode node = (SuperWebTreeNode)selectNode;

            SetButtonProperty(node);

            this.txtMenuName.ReadOnly = false;
            this.txtMenuDescription.Attributes.Remove("readOnly");
            this.txtMenuUrl.ReadOnly = false;

            int menuID = CurrentSelectMenuID;

            switch (selectNode.Depth)
            {
            case 0:
                this.txtMenuName.ReadOnly = true;
                this.txtMenuDescription.Attributes["readOnly"] = "true";
                this.txtMenuUrl.ReadOnly = true;

                this.lblParentMenuName.Text   = "无";
                this.txtMenuName.Text         = "";
                this.txtMenuDescription.Value = "";
                this.txtMenuUrl.Text          = "";

                this.btnAddSubMenu.Attributes["onclick"] =
                    "OpenDialogHelper.openModalDlg(\"AddPage.aspx?mode=new&appid=" + this.ddlSelectApplication.SelectedValue + "&cRebtn=" + this.btnReset.ClientID + "&pid=0" + "\", window, 420, 280);";

                break;

            case 1:
                this.txtMenuUrl.ReadOnly = true;
                this.txtMenuUrl.Text     = "";
                try
                {
                    SystemMenu systemMenu = systemMenuServiceInstance.FindById(menuID);
                    this.lblParentMenuName.Text              = "根菜单";
                    this.txtMenuName.Text                    = systemMenu.MenuName;
                    this.txtMenuDescription.Value            = systemMenu.MenuDescription;;
                    this.btnAddSubMenu.Attributes["onclick"] =
                        "OpenDialogHelper.openModalDlg(\"AddPage.aspx?mode=new&appid=" + this.ddlSelectApplication.SelectedValue + "&pid=" + menuID.ToString() + "&cRebtn=" + this.btnReset.ClientID + "\", window, 420, 280);";
                }
                catch (Exception ex)
                {
                    this.lblMessage.Text  = "系统错误:" + ex.Message;
                    this.btnSave.Disabled = true;
                }

                break;

            case 2:
                try
                {
                    SystemMenu systemMenu = systemMenuServiceInstance.FindById(menuID);
                    this.lblParentMenuName.Text   = systemMenu.ParentMenuID.MenuName;
                    this.txtMenuName.Text         = systemMenu.MenuName;
                    this.txtMenuDescription.Value = systemMenu.MenuDescription;
                    this.txtMenuUrl.Text          = systemMenu.MenuUrl;
                }
                catch (Exception ex)
                {
                    this.lblMessage.Text  = "系统错误:" + ex.Message;
                    this.btnSave.Disabled = true;
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 6
0
        private void SetButtonProperty(SuperWebTreeNode node)
        {
            this.btnAddSubMenu.Visible = node.CanAddSubItem;
            this.btnAddSubMenu.Disabled = !node.AllowAddSubItem;
            this.btnSave.Visible = node.CanModify;
            this.btnSave.Disabled = !node.AllowModify;
            this.btnDelete.Visible = node.CanDelete;
            this.btnDelete.Disabled = !node.AllowDelete;
            this.btnUp.Visible = node.CanMoveUp;
            this.btnUp.Disabled = !node.AllowMoveUp;
            this.btnDown.Visible = node.CanMoveDown;
            this.btnDown.Disabled = !node.AllowMoveDown;
            this.btnReSorted.Visible = node.CanResortSub;
            this.btnReSorted.Disabled = !node.AllowResortSub;
            InputControlHelper.ClearInputButton(btnAddSubMenu,new string[] {"onclick", "Title"});
            InputControlHelper.ClearInputButton(btnSave, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDelete, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnUp, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDown, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnReSorted, new string[] { "Title" });

            if (node.CanDelete && !node.AllowDelete)
            {
                this.btnDelete.Attributes["Title"] = "请先删除下面的子菜单。";
            }

            if (node.CanMoveUp && !node.AllowMoveUp)
            {
                this.btnUp.Attributes["Title"] = "该菜单是第一个,无法上移。";
            }

            if (node.CanMoveDown && !node.AllowMoveDown)
            {
                this.btnDown.Attributes["Title"] = "该菜单是最后一个,无法下移。";
            }
        }