/// <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); }
public string TagValue(Lebi_Language_Tag tag, string lang) { if (tag == null) { return(""); } string res = ""; Type type = tag.GetType(); System.Reflection.PropertyInfo p = type.GetProperty(lang); if (p == null) { return(""); } res = p.GetValue(tag, null).ToString(); return(res); }
/// <summary> /// 更新一条数据 /// </summary> public static void Update(Lebi_Language_Tag model) { D_Lebi_Language_Tag.Instance.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public static int Add(Lebi_Language_Tag model) { return(D_Lebi_Language_Tag.Instance.Add(model)); }
/// <summary> /// 安全方式绑定表单数据 /// </summary> public static Lebi_Language_Tag SafeBindForm(Lebi_Language_Tag model) { return(D_Lebi_Language_Tag.Instance.SafeBindForm(model)); }