123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- using System;
- using Lottomat.Application.Entity.PublicInfoManage;
- using Lottomat.Application.IService.PublicInfoManage;
- using Lottomat.Data.Repository;
- using Lottomat.Util;
- using Lottomat.Util.Extension;
- using Lottomat.Util.WebControl;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using Newtonsoft.Json.Linq;
- namespace Lottomat.Application.Service.PublicInfoManage
- {
-
-
-
-
-
-
-
- public class NoticeService : RepositoryFactory<NewsEntity>, INoticeService
- {
- #region 获取数据
-
-
-
-
-
-
- public IEnumerable<NewsEntity> GetPageList(Pagination pagination, string queryJson)
- {
- var expression = LinqExtensions.True<NewsEntity>();
- JObject queryParam = queryJson.ToJObject();
- if (queryParam != null)
- {
- if (!queryParam["FullHead"].IsEmpty())
- {
- string FullHead = queryParam["FullHead"].ToString();
- expression = expression.And(t => t.FullHead.Contains(FullHead));
- }
- if (!queryParam["Category"].IsEmpty())
- {
- string Category = queryParam["Category"].ToString();
- expression = expression.And(t => t.Category == Category);
- }
- }
-
- expression = expression.And(t => t.TypeId == 2);
- return this.BaseRepository().FindList(expression, pagination);
- }
-
-
-
-
-
- public NewsEntity GetEntity(string keyValue)
- {
- return this.BaseRepository().FindEntity(keyValue);
- }
-
-
-
-
-
- public IEnumerable<NewsEntity> GetList(Expression<Func<NewsEntity, bool>> condition)
- {
- return this.BaseRepository().FindList(condition);
- }
- #endregion
- #region 提交数据
-
-
-
-
- public void RemoveForm(string keyValue)
- {
- this.BaseRepository().Delete(keyValue);
- }
-
-
-
-
-
-
- public void SaveForm(string keyValue, NewsEntity newsEntity)
- {
- if (!string.IsNullOrEmpty(keyValue))
- {
- newsEntity.Modify(keyValue);
- newsEntity.TypeId = 2;
- this.BaseRepository().Update(newsEntity);
- }
- else
- {
- newsEntity.Create();
- newsEntity.TypeId = 2;
-
- }
- }
- #endregion
- }
- }
|