示例#1
0
        /// <summary>
        /// 检测当前用户在当前页面的操作Code
        /// </summary>
        /// <param name="nowUserName">当前登录用户</param>
        /// <param name="nowCompanyId">当前企业</param>
        /// <param name="pageUrl">当前页面链接</param>
        /// <param name="functionCode">当前进行的操作</param>
        /// <returns></returns>
        public static bool CheckNowPageFunctionCode(string nowUserName, int nowCompanyId, string pageUrl, int functionCode)
        {
            List <int> intList = new List <int>();
            IList <SYSRoleMenuFunction> list = SYSRoleMenuFunctionManager.GetSYSRoleMenuFunctionByUserNameAndCompanyIdAndCityIdAndUrlAndFunctionCodes(GetNowCityId(), nowCompanyId, nowUserName, pageUrl, new int[] { functionCode });

            if (list != null && list.Count > 0)
            {
                return(true);
            }
            return(false);
        }
示例#2
0
        /// <summary>
        /// 检测当前用户在当前页面的操作Code
        /// </summary>
        /// <param name="pageUrl">当前页面链接</param>
        /// <param name="functionCode">当前进行的操作</param>
        /// <returns></returns>
        public static bool CheckNowPageFunctionCode(string pageUrl, int functionCode)
        {
            UserCenter_LoginUserInfo user    = GetNowLoginUser();
            List <int> intList               = new List <int>();
            IList <SYSRoleMenuFunction> list = SYSRoleMenuFunctionManager.GetSYSRoleMenuFunctionByUserNameAndCompanyIdAndCityIdAndUrlAndFunctionCodes(GetNowCityId(), user.FxtCompanyId, user.UserName, pageUrl, new int[] { functionCode });

            if (list != null && list.Count > 0)
            {
                return(true);
            }
            return(false);
        }
示例#3
0
        /// <summary>
        /// 获取当前用户在当前页面的所有审核类型的操作权限
        /// </summary>
        /// <param name="nowUserName"></param>
        /// <param name="nowCompanyId"></param>
        /// <param name="pageUrl"></param>
        /// <returns></returns>
        public static List <int> GetNowPageFunctionCodesByAudit(string nowUserName, int nowCompanyId, string pageUrl)
        {
            List <int> intList = new List <int>();
            IList <SYSRoleMenuFunction> list = SYSRoleMenuFunctionManager.GetSYSRoleMenuFunctionByUserNameAndCompanyIdAndCityIdAndUrlAndFunctionCodes(GetNowCityId(), nowCompanyId, nowUserName, pageUrl, SYSCodeManager.FunOperCodes_Audit);

            if (list != null)
            {
                intList = list.Select(obj => obj.FunctionCode).ToList();
            }
            return(intList);
            //return SYSCodeManager.FunOperCodes_Audit.ToList();
        }
示例#4
0
        /// <summary>
        /// 获取当前用户在当前页面的指定操作权限中包含的操作权限
        /// </summary>
        /// <param name="nowUserName"></param>
        /// <param name="nowCompanyId"></param>
        /// <param name="pageUrl"></param>
        /// <param name="functionCodes">指定操作权限</param>
        /// <returns></returns>
        public static List <int> GetNowPageFunctionCodesByFunctionCodes(string nowUserName, int nowCompanyId, string pageUrl, int[] functionCodes)
        {
            List <int> intList = new List <int>();
            IList <SYSRoleMenuFunction> list = SYSRoleMenuFunctionManager.GetSYSRoleMenuFunctionByUserNameAndCompanyIdAndCityIdAndUrlAndFunctionCodes(GetNowCityId(), nowCompanyId, nowUserName, pageUrl, functionCodes);

            if (list != null)
            {
                intList = list.Select(obj => obj.FunctionCode).ToList();
            }
            return(intList);
            //if (functionCodes == null)
            //{
            //    return new List<int>();
            //}
            //return functionCodes.ToList<int>();
        }