Example #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Mod_Sys_User> GetList(Hashtable ht, string order, Mod_Com_Pager pager = null)
        {
            DataSet             dataSet     = null;
            List <Mod_Sys_User> li_Sys_User = new List <Mod_Sys_User>();
            StringBuilder       strSql      = new StringBuilder();

            strSql.Append("select * ");
            strSql.Append(" FROM Sys_User ");
            strSql.Append(" Where 1=1  ");
            if (ht != null)
            {
                foreach (DictionaryEntry de in ht)
                {
                    strSql.AppendLine(de.Value.ToString());
                }
            }
            string strPageSql = string.Empty;

            if (pager != null)
            {
                Dal_Common.GetPageSql(ref strPageSql, strSql.ToString(), order, pager);
            }
            if (!string.IsNullOrEmpty(strPageSql))
            {
                dataSet = SqlEasy.ExecuteDataSet(strPageSql);
                return(ConvertToListData(dataSet));
                //return dataSet;
            }
            else
            {
                dataSet = SqlEasy.ExecuteDataSet(strSql.ToString());
                return(ConvertToListData(dataSet));
                //return dataSet;
            }
        }
Example #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(Hashtable ht, string order = null, Mod_Com_Pager pager = null)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.*,b.Name as RoleStatusName ");
            strSql.Append(" FROM Sys_Role a ");
            strSql.Append(" LEFT JOIN Sys_Role_Status b on a.RoleStatus=b.ID ");
            strSql.Append(" Where 1=1  ");
            if (ht != null)
            {
                foreach (DictionaryEntry de in ht)
                {
                    strSql.AppendLine(de.Value.ToString());
                }
            }
            string strPageSql = string.Empty;

            if (pager != null)
            {
                Dal_Common.GetPageSql(ref strPageSql, strSql.ToString(), order, pager);
            }
            if (!string.IsNullOrEmpty(strPageSql))
            {
                return(SqlEasy.ExecuteDataSet(strPageSql));
            }
            else
            {
                return(SqlEasy.ExecuteDataSet(strSql.ToString()));
            }
        }