123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- using System;
- using Lottomat.Application.Entity.InformationManage;
- using Lottomat.Application.IService.InformationManage;
- using Lottomat.Data.Repository;
- using Lottomat.Util.WebControl;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using Lottomat.Application.Code;
- using Lottomat.Application.Entity.PublicInfoManage;
- using Lottomat.Util.Extension;
- using Newtonsoft.Json.Linq;
- namespace Lottomat.Application.Service.InformationManage
- {
-
-
-
-
-
-
-
- public class ZxNewsService : RepositoryFactory<ZxNewsEntity>, IZxNewsService
- {
- #region 获取数据
-
-
-
-
-
-
- public IEnumerable<ZxNewsEntity> GetPageList(Pagination pagination, string queryJson)
- {
- var expression = LinqExtensions.True<ZxNewsEntity>();
- JObject queryParam = queryJson.ToJObject();
- if (queryParam != null)
- {
- if (!queryParam["title"].IsEmpty())
- {
- string title = queryParam["title"].ToString();
- expression = expression.And(t => t.title.Contains(title));
- }
- }
- expression = expression.And(t => t.isDelete == false);
- return this.BaseRepository(DatabaseLinksEnum.InformationBase).FindList(expression, pagination);
-
- }
-
-
-
-
-
- public IEnumerable<ZxNewsEntity> GetList(string queryJson)
- {
- return this.BaseRepository(DatabaseLinksEnum.InformationBase).IQueryable().ToList();
- }
-
-
-
-
-
-
- public IEnumerable<ZxNewsEntity> GetList(Expression<Func<ZxNewsEntity, bool>> condition)
- {
- return this.BaseRepository(DatabaseLinksEnum.InformationBase).FindList(condition);
- }
-
-
-
-
-
- public ZxNewsEntity GetEntity(string keyValue)
- {
- return this.BaseRepository(DatabaseLinksEnum.InformationBase).FindEntity(keyValue);
- }
- #endregion
- #region 提交数据
-
-
-
-
- public void RemoveForm(string keyValue)
- {
- this.BaseRepository(DatabaseLinksEnum.InformationBase).Delete(keyValue);
- }
-
-
-
-
-
-
- public void SaveForm(string keyValue, ZxNewsEntity entity)
- {
- if (!string.IsNullOrEmpty(keyValue))
- {
- entity.Modify(keyValue);
- this.BaseRepository(DatabaseLinksEnum.InformationBase).Update(entity);
- }
- else
- {
- entity.Create();
- this.BaseRepository(DatabaseLinksEnum.InformationBase).Insert(entity);
- }
- }
- #endregion
- }
- }
|