1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using Lottomat.Application.Code;
- using Lottomat.Application.Entity.LotteryNumberManage;
- using Lottomat.Application.IService.LotteryNumberManage;
- using Lottomat.Data.Repository;
- using Lottomat.Util.Extension;
- using Lottomat.Util.WebControl;
- using Newtonsoft.Json.Linq;
- using System.Collections.Generic;
- using System.Linq;
- namespace Lottomat.Application.Service.LotteryNumberManage
- {
- /// <summary>
- /// 版 本 1.0
- /// Copyright (c) 2016-2017
- /// 创 建:超级管理员
- /// 日 期:2018-05-22 13:45
- /// 描 述:LotteryGlossary
- /// </summary>
- public class LotteryGlossaryService : RepositoryFactory<LotteryGlossaryEntity>, ILotteryGlossaryService
- {
- #region 获取数据
- /// <summary>
- /// 获取列表
- /// </summary>
- /// <param name="pagination">分页</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns>返回分页列表</returns>
- public IEnumerable<LotteryGlossaryEntity> GetPageList(Pagination pagination, string queryJson)
- {
- var expression = LinqExtensions.True<LotteryGlossaryEntity>();
- JObject queryParam = queryJson.ToJObject();
- if (queryParam != null)
- {
- if (!queryParam["Title"].IsEmpty())
- {
- string Title = queryParam["Title"].ToString();
- expression = expression.And(t => t.Title.Contains(Title));
- }
- }
- return this.BaseRepository(DatabaseLinksEnum.LotteryNumber).FindList(expression, pagination);
- }
- /// <summary>
- /// 获取列表
- /// </summary>
- /// <param name="queryJson">查询参数</param>
- /// <returns>返回列表</returns>
- public IEnumerable<LotteryGlossaryEntity> GetList(string queryJson)
- {
- return this.BaseRepository(DatabaseLinksEnum.LotteryNumber).IQueryable().ToList();
- }
- /// <summary>
- /// 获取实体
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <returns></returns>
- public LotteryGlossaryEntity GetEntity(string keyValue)
- {
- return this.BaseRepository(DatabaseLinksEnum.LotteryNumber).FindEntity(keyValue);
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- public void RemoveForm(string keyValue)
- {
- this.BaseRepository().Delete(keyValue);
- }
- /// <summary>
- /// 保存表单(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键值</param>
- /// <param name="entity">实体对象</param>
- /// <returns></returns>
- public void SaveForm(string keyValue, LotteryGlossaryEntity entity)
- {
- if (!string.IsNullOrEmpty(keyValue))
- {
- entity.Modify(keyValue);
- this.BaseRepository().Update(entity);
- }
- else
- {
- entity.Create();
- this.BaseRepository().Insert(entity);
- }
- }
- #endregion
- }
- }
|