|
@@ -1,6 +1,7 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.ComponentModel;
|
|
|
+using System.Reflection;
|
|
|
using System.Text;
|
|
|
|
|
|
namespace YiSha.Enum.ZX
|
|
@@ -55,4 +56,227 @@ namespace YiSha.Enum.ZX
|
|
|
[Description("栏目发布统计")]
|
|
|
栏目发布统计 = 1
|
|
|
}
|
|
|
+ #region 老系统数据
|
|
|
+ /// <summary>
|
|
|
+ /// 模板类型 来源老系统
|
|
|
+ /// </summary>
|
|
|
+ public enum TemplateType : int
|
|
|
+ {
|
|
|
+ // 0.$$TitleDescription$$ 标题描述
|
|
|
+ // 1.$$Keywords$$ 关键字
|
|
|
+ // 2.$$Description$$ 描述
|
|
|
+ // 3.$$NewsTitle$$ 新闻标题
|
|
|
+ // 4.$$AuthorAndNewsAddtime$$ 作者和资讯添加时间
|
|
|
+ // 5.$$NewsContentKeywords$$ 资讯关键字
|
|
|
+ // 6.$$NewsContent$$ 资讯详情
|
|
|
+ // 7.$$NewsLatestUpdate$$ 最新更新
|
|
|
+ // 8.$$Navigation$$ 面包屑导航
|
|
|
+ // 9.$$PuzzlesTypeName$$ 字谜类型
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 福彩3D
|
|
|
+ /// </summary>
|
|
|
+ [Description("福彩3D")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "3d")]
|
|
|
+ Fucai3D_1 = 14,
|
|
|
+ /// <summary>
|
|
|
+ /// 福彩3D
|
|
|
+ /// </summary>
|
|
|
+ [Description("福彩3D")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "3d")]
|
|
|
+ Fucai3D_2 = 55,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 排列三
|
|
|
+ /// </summary>
|
|
|
+ [Description("排列三")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "p3")]
|
|
|
+ ArrangementThree_1 = 22,
|
|
|
+ /// <summary>
|
|
|
+ /// 排列三
|
|
|
+ /// </summary>
|
|
|
+ [Description("排列三")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "p3")]
|
|
|
+ ArrangementThree_2 = 57,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 太湖字谜
|
|
|
+ /// </summary>
|
|
|
+ [Description("太湖字谜")]
|
|
|
+ [Text("../../Template/Puzzles_Template.html", "3d/thzm")]
|
|
|
+ TaihuPuzzles = 18,
|
|
|
+ /// <summary>
|
|
|
+ /// 彩神通字谜
|
|
|
+ /// </summary>
|
|
|
+ [Description("彩神通字谜")]
|
|
|
+ [Text("../../Template/Puzzles_Template.html", "3d/cstzm")]
|
|
|
+ CrosswordPuzzle = 25,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 双色球
|
|
|
+ /// </summary>
|
|
|
+ [Description("双色球")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "ssq")]
|
|
|
+ Chromosphere_1 = 41,
|
|
|
+ /// <summary>
|
|
|
+ /// 双色球
|
|
|
+ /// </summary>
|
|
|
+ [Description("双色球")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "ssq")]
|
|
|
+ Chromosphere_2 = 56,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 其他彩种
|
|
|
+ /// </summary>
|
|
|
+ [Description("其他彩种")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "qita")]
|
|
|
+ OtherColoredSpecies = 44,
|
|
|
+ /// <summary>
|
|
|
+ /// 大乐透
|
|
|
+ /// </summary>
|
|
|
+ [Description("大乐透")]
|
|
|
+ [Text("../../Template/InformationDetails_Template.html", "qita")]
|
|
|
+ Lotto = 58,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 55128专题
|
|
|
+ /// </summary>
|
|
|
+ Special55128 = 54,
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 友情链接
|
|
|
+ /// </summary>
|
|
|
+ [Description("友情链接")]
|
|
|
+ [Text("../../../Template/FriendlyLink_Template.html", "")]
|
|
|
+ FriendshipLink = 99,
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 推广广告
|
|
|
+ /// </summary>
|
|
|
+ [Description("推广广告")]
|
|
|
+ [Text("../../../Template/Advertisement_Template.html", "../../../Template/json.txt")]
|
|
|
+ Advertisement = 98
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取实体类Attribute自定义属性
|
|
|
+ /// </summary>
|
|
|
+ public static class EnumAttribute
|
|
|
+ {
|
|
|
+ private static Dictionary<string, Dictionary<string, string[]>> _enumCache;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 缓存
|
|
|
+ /// </summary>
|
|
|
+ private static Dictionary<string, Dictionary<string, string[]>> EnumCache
|
|
|
+ {
|
|
|
+ get { return _enumCache ?? (_enumCache = new Dictionary<string, Dictionary<string, string[]>>()); }
|
|
|
+ set { _enumCache = value; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 返回枚举项的描述信息。
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="value">要获取描述信息的枚举项。</param>
|
|
|
+ /// <returns>枚举想的描述信息。</returns>
|
|
|
+ public static string GetEnumDescription(this System.Enum value)
|
|
|
+ {
|
|
|
+ Type enumType = value.GetType();
|
|
|
+ // 获取枚举常数名称。
|
|
|
+ string name = System.Enum.GetName(enumType, value);
|
|
|
+ if (name != null)
|
|
|
+ {
|
|
|
+ // 获取枚举字段。
|
|
|
+ FieldInfo fieldInfo = enumType.GetField(name);
|
|
|
+ if (fieldInfo != null)
|
|
|
+ {
|
|
|
+ // 获取描述的属性。
|
|
|
+ DescriptionAttribute attr = Attribute.GetCustomAttribute(fieldInfo,
|
|
|
+ typeof(DescriptionAttribute), false) as DescriptionAttribute;
|
|
|
+ if (attr != null)
|
|
|
+ {
|
|
|
+ return attr.Description;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取自定义枚举描述信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="en"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static string[] GetEnumText(this System.Enum en)
|
|
|
+ {
|
|
|
+ string enString = string.Empty;
|
|
|
+ if (null == en) return new[] { "", "" };
|
|
|
+
|
|
|
+ Type type = en.GetType();
|
|
|
+ enString = en.ToString();
|
|
|
+
|
|
|
+ if (type.FullName != null && !EnumCache.ContainsKey(type.FullName))
|
|
|
+ {
|
|
|
+ System.Reflection.FieldInfo[] fields = type.GetFields();
|
|
|
+ Dictionary<string, string[]> temp = new Dictionary<string, string[]>();
|
|
|
+ foreach (FieldInfo item in fields)
|
|
|
+ {
|
|
|
+ object[] attrs = item.GetCustomAttributes(typeof(TextAttribute), false);
|
|
|
+ if (attrs.Length == 1)
|
|
|
+ {
|
|
|
+ string v = ((TextAttribute)attrs[0]).Value;
|
|
|
+ string e = ((TextAttribute)attrs[0]).Ex;
|
|
|
+ temp.Add(item.Name, new[] { v, e });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ EnumCache.Add(type.FullName, temp);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (type.FullName != null && EnumCache[type.FullName].ContainsKey(enString))
|
|
|
+ {
|
|
|
+ return EnumCache[type.FullName][enString];
|
|
|
+ }
|
|
|
+ return new[] { "", "" };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 枚举值描述 来源老系统
|
|
|
+ /// </summary>
|
|
|
+ public class TextAttribute : Attribute
|
|
|
+ {
|
|
|
+ public TextAttribute(string value, string ex = "")
|
|
|
+ {
|
|
|
+ Value = value;
|
|
|
+ Ex = ex;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 描述信息
|
|
|
+ /// </summary>
|
|
|
+ public string Value { get; private set; }
|
|
|
+ public string Ex { get; private set; }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static class ZxCzTemplateTypeHelper
|
|
|
+ {
|
|
|
+ public static readonly Dictionary<int, TemplateType> dict = new Dictionary<int, TemplateType> {
|
|
|
+ { 14,TemplateType.Fucai3D_1 },
|
|
|
+ { 55,TemplateType.Fucai3D_2 },
|
|
|
+ { 22,TemplateType.ArrangementThree_1 },
|
|
|
+ { 57,TemplateType.ArrangementThree_2 },
|
|
|
+ { 18,TemplateType.TaihuPuzzles },
|
|
|
+ { 25,TemplateType.CrosswordPuzzle },
|
|
|
+
|
|
|
+ { 41,TemplateType.Chromosphere_1 },
|
|
|
+ { 56,TemplateType.Chromosphere_2 },
|
|
|
+ { 44,TemplateType.OtherColoredSpecies },
|
|
|
+ { 58,TemplateType.Lotto },
|
|
|
+ { 54,TemplateType.Special55128 },
|
|
|
+ { 99,TemplateType.FriendshipLink },
|
|
|
+ { 98,TemplateType.Advertisement },
|
|
|
+ };
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|