TerminalDAL.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Common.Model;
  2. using CoreEntity.Entity;
  3. using PublicLibrary.Model;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Data.SqlClient;
  8. using System.Text;
  9. using ZcPeng.PublicLibrary;
  10. namespace CoreEntity.DAL
  11. {
  12. public class TerminalDAL
  13. {
  14. public static IList<Mem_Terminaldoc> getTerms()
  15. {
  16. #region 获取机构列表
  17. DataTable dt = new DataTable();
  18. string result;
  19. IList<Mem_Terminaldoc> permss = new List<Mem_Terminaldoc>(0);
  20. string commandText1 =
  21. //"select A.*" +
  22. //" from Mem_Terminaldoc as A " +
  23. //" where 1=1 "
  24. //+ " ORDER BY A.TerminalCode desc";
  25. @" select Text as TerminalName,[Value] as TerminalCode,[Key] as TerminalDesc,cast(Id as varchar) as SourceTerminalKey,ParentId as ParentTerminalKey,SortKey as SourceTerminalSort from Mall..DataDictory b where b.ParentId IN (785,786) AND b.IsHide=0 ";
  26. bool success = DataAccess.GetValues(commandText1, ref dt, null, out result);
  27. #endregion
  28. if (dt != null && dt.Rows.Count > 0)
  29. {
  30. // 把DataTable转换为IList<T>
  31. permss = ModelConvertHelper<Mem_Terminaldoc>.ConvertToModel(dt);
  32. }
  33. return permss;
  34. }
  35. }
  36. }