/// <summary> /// 根据代理机构代码返回MC /// </summary> /// <param name="_strAGNM"></param> /// <returns></returns> public static string getAGame(string _strAGNM) { try { CfgDataManagerDataContext db = new CfgDataManagerDataContext(); Table<ZPT_SJWH_DLJGPZB> tbZpt = db.ZPT_SJWH_DLJGPZB; var result = from item in tbZpt where item.DAILIJGDM.Equals(_strAGNM.Trim()) select item; if (result.Count() > 0) { return result.First().DAILIJGMC.Trim(); } else { return _strAGNM; } } catch (Exception ex) { logger.Error(ex.ToString()); return _strAGNM; } }
static DmManager() { // //TODO: 在此处添加构造函数逻辑 // CfgDataManagerDataContext db = new CfgDataManagerDataContext(); Table<CountryConfig> tbCountryConfig = db.CountryConfig; var result = from item in tbCountryConfig select new { Key = item.DaiMa.Trim(), Value = item.MingCheng.Trim(), }; DicGsDm = result.ToDictionary(c => c.Key, c => c.Value); }
/// <summary> /// 获取用户自定义信息 /// </summary> /// <param name="_strApNo"></param> /// <param name="_strUid"></param> /// <returns></returns> public static string getUsetInfo(string _strApNo, int _nUid) { string strInfo = ""; try { CfgDataManagerDataContext db = new CfgDataManagerDataContext(); Table<Tb_UsetPatentInfo> tbUsetInfo = db.Tb_UsetPatentInfo; strInfo = db.Tb_UsetPatentInfo.First(p => p.UId.Equals(_nUid) && p.ApNo.Equals(_strApNo)).Info; } catch (Exception ex) { logger.Error(ex.ToString()); } return strInfo; }