Esempio n. 1
0
        /// <summary>
        /// 分页获取数据
        /// </summary>
        /// <param name="start">起始记录号</param>
        /// <param name="limit">每页记录数</param>
        /// <param name="type">方式:0sql升序分页,1sql降序分页;10存储过程升序,11存储过程降序</param>
        /// <param name="Extconditions">EXT查询条件</param>
        /// <param name="conditions">普通查询条件</param>
        /// <returns>返回符合记录的当前页数据</returns>
        public IList <T> FindAllByPage(int start, int limit, int type, string Extconditions, string where)
        {
            CJSearchSql CJSearchSql = new CJSearchSql();
            string      con         = CJSearchSql.GetConditonSQL(Extconditions);

            con = con.Length <= 0 ? where : con + (where.Length > 0 ? " and " + where : "");
            if (type == 0)
            {
                return(CJDAL.FindAllByPageAsc(start, limit, con));
            }
            else if (type == 1)
            {
                return(CJDAL.FindAllByPageDesc(start, limit, con));
            }
            else if (type == 10)
            {
                return(CJDAL.FindByProcPage(start, limit, con, 0));
            }
            else if (type == 11)
            {
                return(CJDAL.FindByProcPage(start, limit, con, 1));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public DataTable GetDtByCondition(string Extconditions)
        {
            CJSearchSql CJSearchSql = new CJSearchSql();
            string      con         = CJSearchSql.GetConditonSQL(Extconditions);

            return(CJDAL.GetDtByCondition(con));
        }
Esempio n. 3
0
        /// <summary>
        /// 查找符合条件记录的总条数
        /// </summary>
        /// <param name="Extconditions">Ext查询条件</param>
        /// <param name="conditions">普通查询条件</param>
        /// <returns>返回符合的记录条数</returns>
        public string GetTotalCount(string Extconditions, string where)
        {
            CJSearchSql CJSearchSql = new CJSearchSql();
            string      con         = CJSearchSql.GetConditonSQL(Extconditions);

            con = con.Length <= 0 ? where : con + (where.Length > 0 ? " and " + where : "");
            return(CJDAL.GetTotalCount(con));
        }