Ejemplo n.º 1
0
        public void Init()
        {
            try
            {
                Guid pId;

                Mod mod = new Mod();

                mod = new Mod();
                mod.Name = "SystemManager";
                mod.Text = "系统管理";
                mod.Icon = "glyphicon glyphicon-cog";
                mod.Type = 1; //有子菜单
                mod.Href = "";
                mod.Index = 1;
                modOper.Add(mod);

                pId = mod.Id;

                Type type = typeof(ModController);
                //添加菜单的操作函数
                ModFunc modFunc = new ModFunc();
                modFunc.Cls = type.FullName;
                modFuncOper.Add(modFunc);

                Mod subMod = new Mod();
                subMod.Name = "ModManager";
                subMod.Text = "菜单管理";
                subMod.Icon = "glyphicon glyphicon-user";
                subMod.Type = 0; //没有子菜单
                subMod.Href = "/Admin/ModManager";
                subMod.PId = pId;
                subMod.Index = 0;
                subMod.ModFunc = modFunc;
                modOper.Add(subMod);

                type = typeof(EmployeeController);
                //添加菜单的操作函数
                modFunc = new ModFunc();
                modFunc.Cls = type.FullName;
                modFuncOper.Add(modFunc);

                subMod = new Mod();
                subMod.Name = "PowerManager";
                subMod.Text = "权限管理";
                subMod.Icon = "glyphicon glyphicon-user";
                subMod.Type = 0; //没有子菜单
                subMod.Href = "/Admin/PowerManager";
                subMod.PId = pId;
                subMod.Index = 0;
                subMod.ModFunc = modFunc;
                modOper.Add(subMod);

            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
        }
Ejemplo n.º 2
0
        private void LoadSubMod(Mod menu)
        {
            if (menu != null)
            {
                try
                {
                    menu.Mods = GetMods(menu.Id);
                }
                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }

                if (menu.Mods != null && menu.Mods.Count > 0)
                {
                    menu.Type = 1;
                }
                else
                {
                    menu.Type = 0;
                }
            }
        }
Ejemplo n.º 3
0
 public ActionResult Del(Mod mod)
 {
     return Json(modOper.Del(mod));
 }
Ejemplo n.º 4
0
 public ActionResult Update(Mod mod)
 {
     return Json(modOper.Update(mod));
 }
Ejemplo n.º 5
0
 public ActionResult Add(Mod mod)
 {
     return Json(modOper.Add(mod));
 }