PosMachinesTwoDbconn.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using MySystem.MainModels;
  5. namespace MySystem
  6. {
  7. public class PosMachinesTwoDbconn
  8. {
  9. public readonly static PosMachinesTwoDbconn Instance = new PosMachinesTwoDbconn();
  10. #region 获取单个字段
  11. public PosMachinesTwo Get(int Id)
  12. {
  13. WebCMSEntities db = new WebCMSEntities();
  14. PosMachinesTwo order = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id);
  15. if (order != null)
  16. {
  17. // RedisDbconn.Instance.Set(key, order);
  18. // RedisDbconn.Instance.SetExpire(key, Library.function.get_Random(1800, 5400));
  19. }
  20. db.Dispose();
  21. return order;
  22. }
  23. public PosMachinesTwo Get(string PosSn)
  24. {
  25. WebCMSEntities db = new WebCMSEntities();
  26. PosMachinesTwo order = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
  27. if (order != null)
  28. {
  29. }
  30. return order;
  31. }
  32. #endregion
  33. }
  34. }