郑许地铁

T_Mac.cs 987B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ZXDT.DBUtility;
  6. namespace ZXDT.CallCenter.DAL
  7. {
  8. /// <summary>
  9. /// T_Sys_MobileData:实体类(属性说明自动提取数据库字段的描述信息)
  10. /// </summary>
  11. public partial class T_Mac
  12. {
  13. public T_Mac()
  14. { }
  15. /// <summary>
  16. /// 获取
  17. /// </summary>
  18. public int GetNum(string mac)
  19. {
  20. StringBuilder strSql = new StringBuilder();
  21. strSql.Append("select top 1 num FROM T_Mac ");
  22. if (mac.Trim() != "")
  23. {
  24. strSql.AppendFormat(" where mac='{0}' OR REPLACE(mac,':','')='{0}'", mac.ToLower());
  25. }
  26. object obj = DbHelperSQL.GetSingle(strSql.ToString());
  27. if (obj == null)
  28. {
  29. return 0;
  30. }
  31. else
  32. {
  33. return obj.ToInt32();
  34. }
  35. }
  36. }
  37. }