1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using CP.Cache;
- using CP.Dapper;
- using CP.Model;
- using MC.ORM;
- using MySql.Data.MySqlClient;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CP.Business
- {
- public class TbHelpBll : BaseBll
- {
- /// <summary>
- /// 缓存
- /// </summary>
- static WMCache cache = WMCache.GetCacheService();
- public static List<TbHelp> GetHelpList()
- {
- string key = string.Format(CacheKeys.Help);
- List<TbHelp> list = cache.GetObject<List<TbHelp>>(key);
- if (list == null)
- {
- list = new List<TbHelp>();
- var dc = new DataConnect();
- string sql = string.Format(" order by seq asc");
- list = dc.db.Fetch<TbHelp>(sql);
- cache.AddObject(key, list, (int)CacheTime.System);
- }
- return list;
- }
- public static List<TbHelp> GetHelpPage(int pageSize, int pageIndex,out int count)
- {
- var list = GetHelpList();
- count = list.Count;
- return list == null ? new List<TbHelp>() : list.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
- }
- public static List<TbHelp> GetCzHelp(int cid)
- {
- var list = GetHelpList();
- return list == null ? new List<TbHelp>() : list.Where(a=>a.cid == cid).ToList();
- }
- }
- }
|