You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using ICSSoft.Entity; using System; using System.Collections.Generic; using System.Data;
namespace ICSSoft.DataProject { public static class LanguageHelper { /// <summary>
/// 根据传入代码模糊查找获取对应的语言提示信息
/// </summary>
/// <param name="Code"></param>
/// <returns></returns>
public static Dictionary<string, string> GetName(string Code) { WMSBarCoreModel model = new WMSBarCoreModel(); model.Code = Code; var resultStr = ICSSubmitService.PromptInformationGet(model); Dictionary<string, string> dic = new Dictionary<string, string>(); foreach (DataRow dr in resultStr.Rows) { dic.Add(dr["Code"].ToString(), dr["Name"].ToString()); } return dic; } /// <summary>
/// 根据传入代码模糊查找获取对应的一行语言提示信息
/// </summary>
/// <param name="Code"></param>
/// <returns></returns>
public static string GetNameSingle(string Code) { WMSBarCoreModel model = new WMSBarCoreModel(); model.Code = Code; var resultStr = ICSSubmitService.PromptInformationGet(model); if (resultStr == null || resultStr.Rows.Count <= 0) throw new Exception(string.Format("未查询到编码:{0} 对应的语言信息!",Code)); return resultStr.Rows[0]["Name"].ToString(); }
public static string GetNameByCode(this Dictionary<string, string> language, string Code) { return language.ContainsKey(Code) ? language[Code] : "未维护多语言代码:"+Code+"!"; } } }
|