Example #1
0
        protected override bool beforeInsert()
        {
            AppSort sort = new AppSort(this.FK_AppSort);

            // 求系统类别的菜单 .
            Menu menu = new Menu(sort.RefMenuNo);

            // 创建子菜单.
            Menu appMenu = menu.DoCreateSubNode() as Menu;

            appMenu.FK_App      = this.No;
            appMenu.Name        = this.Name;
            appMenu.HisMenuType = MenuType.App;
            appMenu.Update();

            //设置相关的菜单编号.
            this.RefMenuNo = appMenu.No;

            #region 为该系统创建几个空白菜单
            //Menu en = appMenu.DoCreateSubNode() as Menu;
            //en.FK_App = this.No;
            //en.Name = this.Name;
            //en.MenuType = 2;
            //en.IsDir = true;
            //en.Update();

            Menu dir = appMenu.DoCreateSubNode() as Menu;
            dir.FK_App   = this.No;
            dir.Name     = "功能目录1";
            dir.MenuType = MenuType.Dir;
            dir.Update();

            Menu func = dir.DoCreateSubNode() as Menu;
            func.Name     = "xxx管理1";
            func.FK_App   = this.No;
            func.MenuType = MenuType.Menu;
            func.Url      = "http://ccflow.org";
            func.Update();

            Menu funcDot = func.DoCreateSubNode() as Menu;
            funcDot.Name     = "查看";
            funcDot.MenuType = MenuType.Function;
            funcDot.FK_App   = this.No;
            funcDot.Update();

            funcDot          = func.DoCreateSubNode() as Menu;
            funcDot.Name     = "增加";
            funcDot.MenuType = MenuType.Function;
            funcDot.FK_App   = this.No;
            funcDot.Update();

            funcDot          = func.DoCreateSubNode() as Menu;
            funcDot.Name     = "删除";
            funcDot.MenuType = MenuType.Function;
            funcDot.FK_App   = this.No;
            funcDot.Update();
            #endregion

            return(base.beforeInsert());
        }
        protected override bool beforeUpdate()
        {
            //系统类别
            AppSort appSort = new AppSort(this.FK_AppSort);
            Menu    menu    = new Menu(this.RefMenuNo);

            menu.Name     = this.Name;
            menu.ParentNo = appSort.RefMenuNo;
            menu.Update();
            return(base.beforeUpdate());
        }
Example #3
0
        protected override bool beforeUpdate()
        {
            if (DataType.IsNullOrEmpty(this.RefMenuNo) == false)
            {
                //系统类别
                AppSort appSort = new AppSort(this.FK_AppSort);

                Menu menu = new Menu(this.RefMenuNo);
                menu.Name     = this.Name;
                menu.ParentNo = appSort.RefMenuNo;
                menu.Update();
            }

            return(base.beforeUpdate());
        }
Example #4
0
        /// <summary>
        /// 为BPM初始化菜单.
        /// </summary>
        public static void InitBPMMenu()
        {
            AppSort sort = new AppSort();

            sort.No = "01";
            if (sort.RetrieveFromDBSources() == 0)
            {
                sort.Name      = "应用系统";
                sort.RefMenuNo = "2000";
                sort.Insert();
            }

            App app = new App();

            app.No         = "CCFlowBPM";
            app.Name       = "BPM系统";
            app.FK_AppSort = "01";
            app.Insert();
        }