using Lottomat.Application.Entity.PublicInfoManage;
using Lottomat.Application.IService.PublicInfoManage;
using Lottomat.Application.Service.PublicInfoManage;
using Lottomat.Util;
using Lottomat.Util.WebControl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Lottomat.Utils;
using Lottomat.Utils.Web;
namespace Lottomat.Application.Busines.PublicInfoManage
{
///
/// 版 本 1.0
/// Copyright (c) 2016-2017
/// 创建人:赵轶
/// 日 期:2015.12.7 16:40
/// 描 述:新闻中心
///
public class NewsBLL
{
private INewsService service = new NewsService();
#region 获取数据
///
/// 新闻列表
///
/// 分页
/// 查询参数
///
public IEnumerable GetPageList(Pagination pagination, string queryJson)
{
return service.GetPageList(pagination, queryJson);
}
///
///
///
///
///
///
public IEnumerable GetPageList(Expression> condition, Pagination pagination)
{
return service.GetPageList(condition, pagination);
}
///
/// 新闻实体
///
/// 主键值
///
public NewsEntity GetEntity(string keyValue)
{
NewsEntity newsEntity = service.GetEntity(keyValue);
if (newsEntity != null)
newsEntity.NewsContent = WebHelper.HtmlDecode(newsEntity.NewsContent);
return newsEntity;
}
public NewsEntity GetEntity(Expression> condition)
{
NewsEntity newsEntity = service.GetEntity(condition);
if (newsEntity != null)
newsEntity.NewsContent = WebHelper.HtmlDecode(newsEntity.NewsContent);
return newsEntity;
}
///
/// 获取所有数据
///
///
///
public List GetList(Expression> condition)
{
return service.GetList(condition).ToList();
}
public IEnumerable FindList(Expression> condition, string orderField, bool isAsc, int pageSize, int pageIndex,
out int total) where T : class, new()
{
return service.FindList(condition, orderField, isAsc, pageSize, pageIndex, out total);
}
#endregion
#region 提交数据
///
/// 删除新闻
///
/// 主键
public void RemoveForm(string keyValue)
{
try
{
service.RemoveForm(keyValue);
}
catch (Exception)
{
throw;
}
}
///
/// 保存新闻表单(新增、修改)
///
/// 主键值
/// 新闻实体
///
public void SaveForm(string keyValue, NewsEntity newsEntity)
{
try
{
newsEntity.NewsContent = WebHelper.HtmlEncode(newsEntity.NewsContent);
service.SaveForm(keyValue, newsEntity);
}
catch (Exception)
{
throw;
}
}
///
/// 修改
///
/// 新闻实体
///
public void UpdateForm(NewsEntity newsEntity)
{
service.UpdateForm(newsEntity);
}
#endregion
#region 修改数据
///
/// 批量修改
///
/// 要修改的列及修改后列的值集合
/// 修改的条件
/// 修改列的名称的集合
/// 返回受影响行数
public int Modify(NewsEntity modelModifyProps, Expression> where, params string[] paramModifyStrings)
{
return service.Modify(modelModifyProps, where, paramModifyStrings);
}
#endregion
}
}