Exemple #1
0
        /// <summary>
        /// 通过消息字段类型枚举值获取消息字段类型名称
        /// </summary>
        /// <param name="em"></param>
        /// <returns></returns>
        public static string EnumMessageFieldType_GetFieldTypeNameByEnum(EnumMessageFieldType em)
        {
            var fieldTypeName = "";

            switch (em)
            {
            case EnumMessageFieldType.CustomField:
                fieldTypeName = "自定义字段";
                break;

            case EnumMessageFieldType.MessageField:
                fieldTypeName = "短信字段";
                break;
            }
            return(fieldTypeName);
        }
Exemple #2
0
        /// <summary>
        /// 通过消息字段类型枚举值获取消息字段类型代码
        /// </summary>
        /// <param name="em"></param>
        /// <returns></returns>
        public static int EnumMessageFieldType_GetFieldTypeCodeByEnum(EnumMessageFieldType em)
        {
            var fieldTypeCode = 0;

            switch (em)
            {
            case EnumMessageFieldType.CustomField:
                fieldTypeCode = 1;
                break;

            case EnumMessageFieldType.MessageField:
                fieldTypeCode = 2;
                break;
            }
            return(fieldTypeCode);
        }
Exemple #3
0
        /// <summary>
        /// 通过消息字段类型名称获取消息字段类型枚举值
        /// </summary>
        /// <param name="fieldTypeName"></param>
        /// <returns></returns>
        public static EnumMessageFieldType EnumMessageFieldType_GetFieldEnumByName(string fieldTypeName)
        {
            var fieldTypeEnum = new EnumMessageFieldType();

            switch (fieldTypeName)
            {
            case "自定义字段":
                fieldTypeEnum = EnumMessageFieldType.CustomField;
                break;

            case "短信字段":
                fieldTypeEnum = EnumMessageFieldType.MessageField;
                break;
            }
            return(fieldTypeEnum);
        }