예제 #1
0
        /// <summary>
        /// 处理文字标签
        /// </summary>
        /// <param name="str"></param>
        /// <param name="langFlag"></param>
        /// <returns></returns>
        public static string Tag(string str, string langFlag)
        {
            List <Lebi_Language_Tag> models = ShopCache.GetLanguageTag();
            Lebi_Language_Tag        tag    = (from m in models
                                               where m.tag == str
                                               select m).ToList().FirstOrDefault();

            if (tag == null)
            {
                tag = B_Lebi_Language_Tag.GetModel("tag='" + str + "'");
            }
            if (tag == null)
            {
                tag     = new Lebi_Language_Tag();
                tag.tag = str;
                tag.CN  = str;
                //tag.JP = str;
                tag.EN = str;
                B_Lebi_Language_Tag.Add(tag);
            }
            else
            {
                try
                {
                    Type         t        = tag.GetType();
                    PropertyInfo pi_count = t.GetProperty(langFlag);
                    str = pi_count.GetValue(tag, null).ToString();
                }
                catch
                {
                }
            }
            return(str);
        }
예제 #2
0
        /// <summary>
        /// 设置语言标签缓存
        /// </summary>
        public static void SetLanguageTag()
        {
            List <Lebi_Language_Tag> models = B_Lebi_Language_Tag.GetList("", "");

            CacheTool.Permanent("LanguageTag", models);
        }