public IList <NursingQuestion> LstNurseQuestion() { var cache = CacheIO.Get(KEY); if (cache == null) { var data = List <NursingQuestion>(null); CacheIO.Insert(KEY, data); return(data); } return(cache as IList <NursingQuestion>); }
public IList <NursingMark> GetMarks() { var cache = CacheIO.Get(KEY); if (cache == null) { var data = this.List <NursingMark>(null); CacheIO.Insert(KEY, data); return(data); } return(cache as IList <NursingMark>); }
/// <summary> /// 根据Code查找 /// </summary> /// <param name="code">因素/ys、目标/mb、措施/cs、评估/pg</param> /// <returns></returns> public IList <NursingPlanTarget> GetPlanTargetByCode(string code) { if (string.IsNullOrEmpty(code)) { return(null); } var key = string.Format("{0}_{1}", PREFIX, code); var cache = CacheIO.Get(key); if (cache == null) { var data = List <NursingPlanTarget>(new { Code = code }.toStrObjDict()); CacheIO.Insert(key, data); return(data); } return(cache as IList <NursingPlanTarget>); }
public object Intercept(InvocationInfo info) { //Console.WriteLine(">>Intercepting " + info.TargetMethod.Name); PropertyInfo p = this._target.GetType().GetProperty("ID"); string s = p.GetValue(this._target, null).ToString(); string key = s + "("; if (info.Arguments != null && info.Arguments.Length > 0) { StrObjectDict sod = null; for (int i = 0; i < info.Arguments.Length; i++) { if (i != 0) { key += ", "; } sod = info.Arguments[i] as StrObjectDict; if (sod == null || sod.Count() == 0) { key += "null"; } else { foreach (var item in sod.Keys) { key += sod[item] + ","; } } } } key += ")"; object obj = CacheIO.Get(key); return(obj == null?Fetch(key, info) : obj); }