12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using Common.Model;
- using CoreEntity.Entity;
- using PublicLibrary.Model;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Text;
- using ZcPeng.PublicLibrary;
- namespace CoreEntity.DAL
- {
- public class TerminalDAL
- {
- public static IList<Mem_Terminaldoc> getTerms()
- {
- #region 获取机构列表
- DataTable dt = new DataTable();
- string result;
- IList<Mem_Terminaldoc> permss = new List<Mem_Terminaldoc>(0);
-
- string commandText1 =
- //"select A.*" +
- //" from Mem_Terminaldoc as A " +
- //" where 1=1 "
- //+ " ORDER BY A.TerminalCode desc";
- @" 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 ";
- bool success = DataAccess.GetValues(commandText1, ref dt, null, out result);
- #endregion
- if (dt != null && dt.Rows.Count > 0)
- {
- // 把DataTable转换为IList<T>
- permss = ModelConvertHelper<Mem_Terminaldoc>.ConvertToModel(dt);
- }
- return permss;
- }
- }
- }
|