CacheHelper.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using JLHHJSvr.BLL;
  2. using JLHHJSvr.Com.Model;
  3. using LJLib.DAL.SQL;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace JLHHJSvr.Helper
  10. {
  11. internal sealed class CacheHelper : HelperBase
  12. {
  13. /// <summary>
  14. /// 部件选配项
  15. /// </summary>
  16. /// <param name="typeid"></param>
  17. /// <param name="name"></param>
  18. /// <returns></returns>
  19. public erp_configure_code u_configure_code(int typeid, string name)
  20. {
  21. string key = string.Format("typeid:{0},name:{1}", typeid, name);
  22. if (_u_configure_code != null)
  23. {
  24. if (_u_configure_code.ContainsKey(key))
  25. {
  26. return _u_configure_code[key];
  27. }
  28. }
  29. else
  30. {
  31. _u_configure_code = new Dictionary<string, erp_configure_code>();
  32. }
  33. var rslt = new erp_configure_code
  34. {
  35. typeid = typeid,
  36. name = name,
  37. };
  38. DbSqlHelper.SelectOne(cmd, rslt,
  39. "typeid,pzid,pzcode,name,inputtype,configtype,ifcross,ifcheck,ifuse,rulestr,ifnum,decnum,maxnum,minnum");
  40. _u_configure_code[key] = rslt;
  41. return rslt;
  42. }
  43. private Dictionary<string, erp_configure_code> _u_configure_code = null;
  44. }
  45. }