/// <summary>
        /// 授权页面列表
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public ActionResult AuthorityAction(int key = 0)
        {
            var menuList = new ManagerEfRepository <WebManageMenus>().GetModel().ToList();

            List <Tuple <string, string> > model = new List <Tuple <string, string> >();

            FillAuthorityAction(model);
            //查询需要配置的菜单
            if (key == 1)
            {
                model = model.Where(i => !menuList.Select(j => j.LinkUrl).Contains(i.Item2)).ToList();
            }
            return(View(model));
        }
        /// <summary>
        /// 填充缺失数据表的菜单
        /// </summary>
        /// <returns></returns>
        public ActionResult DoAuthorityAction()
        {
            var menuList = new ManagerEfRepository <WebManageMenus>().GetModel().ToList();

            List <Tuple <string, string> > model = new List <Tuple <string, string> >();

            FillAuthorityAction(model);
            model = model.Where(i => !menuList.Select(j => j.LinkUrl).Contains(i.Item2)).ToList();
            var menu = menuRepository.Find(i => i.Name == "未分配的授权页面");

            if (menu == null)
            {
                var root = menuRepository.Find(i => !i.ParentID.HasValue);
                if (root == null)
                {
                    throw new ArgumentException("没有根节点!或者根节点的ParentID不是null");
                }
                menu = new WebManageMenus
                {
                    About             = "",
                    IsDisplayMenuTree = false,
                    Level             = 1,
                    LinkUrl           = "",
                    Name       = "未分配的授权页面",
                    Operator   = Lind.DDD.Authorization.CurrentUser.UserName,
                    ParentID   = root.Id,
                    SortNumber = 0
                };
                menuRepository.Insert(menu);
            }
            List <WebManageMenus> newMenuList = new List <WebManageMenus>();

            model.ForEach(i =>
            {
                newMenuList.Add(new WebManageMenus
                {
                    About             = "",
                    IsDisplayMenuTree = false,
                    Level             = menu.Level + 1,
                    LinkUrl           = i.Item2,
                    Name       = i.Item1,
                    Operator   = Lind.DDD.Authorization.CurrentUser.UserName,
                    ParentID   = menu.Id,
                    SortNumber = 0
                });
            });
            menuRepository.Insert(newMenuList);
            return(RedirectToAction("AuthorityAction", new { key = 1 }));
        }