Пример #1
0
        /// <summary>
        /// 权限类型工厂
        /// </summary>
        /// <param name="type">权限类型</param>
        /// <returns></returns>
        public IRight GetInstance(RightType type)
        {
            IRight right;

            switch (type)
            {
            case RightType.Function:
                right = new FunctionRight();
                break;

            case RightType.EntryRight:
                right = new EntryRight();
                break;

            case RightType.ButtonRight:
                right = new ButtonRight();
                break;

            case RightType.ButtonRightByMenu:
                right = new ButtonRightByMenu();
                break;

            case RightType.Field:
                right = new FieldRight();
                break;

            default:
                right = null;
                break;
            }
            return(right);
        }