Esempio n. 1
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="queryEr"></param>
        /// <param name="sqlPart"></param>
        /// <returns></returns>
        public IList GetData(ExecSqlQuery queryEr, SqlPart sqlPart)
        {
            queryEr.Sql = SqlPartHelp.ConvertToSqlString(sqlPart);
            IList listData = Ht.ExecuteFind(queryEr);

            return(listData);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取行数
        /// </summary>
        /// <param name="queryEr"></param>
        /// <param name="sqlPart"></param>
        /// <returns></returns>
        public int GetCount(ExecSqlQuery queryEr, SqlPart sqlPart)
        {
            int          total      = 0;
            ExecSqlQuery countQuery = new ExecSqlQuery();

            countQuery.Sql = SqlPartHelp.GetCountSql(sqlPart);
            countQuery.ParamerList.AddRange(queryEr.ParamerList);
            IList listCountData = Ht.ExecuteFind(countQuery);

            if (listCountData != null && listCountData.Count > 0)
            {
                int.TryParse(Convert.ToString((listCountData[0] as Hashtable)["total"]), out total);
            }
            return(total);
        }