예제 #1
0
        /// <summary>
        /// 添加角色的权限信息
        /// </summary>
        /// <param name="menuIds">新设置的权限的信息</param>
        /// <param name="roleId">角色的编号</param>
        /// <returns></returns>
        public bool AddRoleMenu(string menuIds, string roleId)
        {
            List <RoleMenuModel> roleMenus = new List <RoleMenuModel>();

            string[] menuIdArray = menuIds.Split(';');

            foreach (string menuId in menuIdArray)
            {
                RoleMenuModel userRole = new RoleMenuModel()
                {
                    F_Id     = Utility.GuId(),
                    F_RoleId = roleId,
                    F_MenuId = menuId
                };
                roleMenus.Add(userRole);
            }

            return(roleDal.AddRoleMenu(roleMenus, roleId));
        }