1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections.Generic;
- using CB.Entity;
- using CB.Interface.Infrastructure;
- namespace CB.Data
- {
- //DT_Topic
- public class TopicService
- {
- public static bool Save(TopicInfo entity)
- {
- var ok = DatabaseProvider.GetDbProvider<ITopicService>().Save(entity);
- CB.Cache.CBCache.GetCacheService().RemoveByRegex(CB.Cache.CacheKeys.TopicList);
- return ok;
- }
- public static bool Update(TopicInfo entity)
- {
- var ok = DatabaseProvider.GetDbProvider<ITopicService>().Update(entity);
- CB.Cache.CBCache.GetCacheService().RemoveByRegex(CB.Cache.CacheKeys.TopicList);
- return ok;
- }
- public static bool Delete(int id)
- {
- var ok = DatabaseProvider.GetDbProvider<ITopicService>().Delete(id);
- CB.Cache.CBCache.GetCacheService().RemoveByRegex(CB.Cache.CacheKeys.TopicList);
- return ok;
- }
- public static TopicInfo Get(int id)
- {
- return DatabaseProvider.GetDbProvider<ITopicService>().Get(id);
- }
- public static IList<TopicInfo> ToList()
- {
- return DatabaseProvider.GetDbProvider<ITopicService>().ToList();
- }
- /// <summary>
- /// 查询所有文章(限WEB前端使用)
- /// </summary>
- /// <param name="entity"></param>
- /// <returns></returns>
- public static IList<TopicInfo> ToList(TopicInfo entity)
- {
- return DatabaseProvider.GetDbProvider<ITopicService>().ToList(entity);
- }
- public static IList<TopicInfo> ToPaging(TopicInfo entity, int pageSize, int pageIndex, out int recordCount)
- {
- return DatabaseProvider.GetDbProvider<ITopicService>().ToPaging(entity, pageSize, pageIndex, out recordCount);
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="cids">分类列表用,隔开</param>
- /// <param name="pageSize"></param>
- /// <param name="pageIndex"></param>
- /// <param name="recordCount"></param>
- /// <returns></returns>
- public static IList<TopicInfo> ToPaging(string cids, int pageSize, int pageIndex, out int recordCount, string orderStr)
- {
- return DatabaseProvider.GetDbProvider<ITopicService>().ToPaging(cids, pageSize, pageIndex, out recordCount, orderStr);
- }
- }
- }
|