ScoreRuleServices.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMISOnline.Entities;
  6. using Bowin.Common.Linq.Entity;
  7. using System.Linq.Expressions;
  8. using EMISOnline.DataLogic.Educational;
  9. namespace EMISOnline.CommonLogic.EducationalServices
  10. {
  11. public class ScoreRuleServices : BaseServices, IScoreRuleServices
  12. {
  13. public ScoreRuleDAL ScoreRuleDAL { get; set; }
  14. public IGridResultSet<ER_ScoreRule> GetScoreRuleList(int pageIndex, int pageSize)
  15. {
  16. Expression<Func<ER_ScoreRule, bool>> exp = (e => true);
  17. var list = ScoreRuleDAL.GetScoreRuleList(exp).OrderByDescending(r => r.ScoreRuleID).ToGridResultSet(pageIndex, pageSize);
  18. return list;
  19. }
  20. public ER_ScoreRule GetScoreRule(Guid ScoreRuleID)
  21. {
  22. return ScoreRuleDAL.ScoreRuleRepository.GetSingle(e => e.ScoreRuleID == ScoreRuleID);
  23. }
  24. public void AddScoreRule(ER_ScoreRule model)
  25. {
  26. UnitOfWork.Remove<ER_ScoreRule>(e => true);
  27. UnitOfWork.Add(model);
  28. UnitOfWork.Commit();
  29. }
  30. }
  31. }