Exemplo n.º 1
0
        /// <summary>
        /// 获取model
        /// </summary>
        /// <param name="db"></param>
        /// <param name="query"></param>
        /// <param name="pageNum"></param>
        /// <returns></returns>
        public List <object> GetListModel(string db, string query, int pageNum)
        {
            if (!PageConfig.isMemory)
            {
                return(null);
            }
            Dictionary <string, PageSQL> pageSQL = null;
            PageSQL page = null;

            if (dicPageQuery.TryGetValue(db, out pageSQL))
            {
                if (pageSQL.TryGetValue(query, out page))
                {
                    var lst = queryCache.GetListModel(db, page.ID, pageNum);
                    if (lst == null && PageConfig.IsCacheFile)
                    {
                        return((List <object>)GetFile(db, page.ID, pageNum, true));
                    }
                    return(lst);
                }
            }
            else
            {
                Dictionary <string, DBQueryCache> cur = null;
                DBQueryCache cache = null;
                if (dicSQL.TryGetValue(db, out cur))
                {
                    if (cur.TryGetValue(query, out cache))
                    {
                        return(cache.GetListModel(pageNum));
                    }
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        public List <object> GetListModel(long queryID, int pageNum)
        {
            DBQueryCache queryCache = null;

            if (dicQuery.TryGetValue(queryID, out queryCache))
            {
                return(queryCache.GetListModel(pageNum));
            }
            return(null);
        }