CourseExamServices.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using Bowin.Common.Linq.Entity;
  7. using EMISOnline.ViewModel.SystemView;
  8. using EMISOnline.DataLogic.SystemDAL;
  9. using EMISOnline.Entities;
  10. using EMISOnline.DataLogic.Student;
  11. using EMISOnline.CommonLogic.StudentServices;
  12. using Bowin.Web.Controls.Mvc;
  13. using Bowin.Common.Linq;
  14. using EMISOnline.ViewModel.Student;
  15. using EMISOnline.DataLogic.Repositories;
  16. namespace EMISOnline.CommonLogic.StudentServices
  17. {
  18. public class CourseExamServices : ICourseExamServices
  19. {
  20. public StudentHomeWorkDAL HomeWorkDAL { get; set; }
  21. public CourseEaxmDAL courseEaxmDAL { get; set; }
  22. public SchoolyearDAL SchoolyearDAL { get; set; }
  23. public IGridResultSet<CourseExamView> getCourseExamList(string CourseName, int? ExamStatus, Guid UserId, int page, int rows)
  24. {
  25. var curSchoolyearID = SchoolyearDAL.GetCurSchoolyear();
  26. var sql = courseEaxmDAL.getStudentEaxmListbySchoolyear(UserId, curSchoolyearID.SchoolyearID);
  27. if (!string.IsNullOrEmpty(CourseName))
  28. {
  29. sql = sql.Where(w =>w.CourseName.Contains(CourseName));
  30. }
  31. if (ExamStatus.HasValue && ExamStatus.Value!=0)
  32. {
  33. sql = sql.Where(w => w.ExamStatus == ExamStatus);
  34. }
  35. return sql.OrderByDescending(o=>o.test_begin_date).ToGridResultSet(page,rows);
  36. }
  37. public List<Sys_DictionaryItem> getExamResult_state()
  38. {
  39. var dics = HomeWorkDAL.examResultRepository.UnitOfWork.Sys_DictionaryItem.Where(w => w.DictionaryCode == "ExamResult_state").OrderBy(o=>o.OrderNo);
  40. return dics.ToList();
  41. }
  42. }
  43. }