ExamsStateSettingDAL.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Repositories;
  6. using EMIS.ViewModel;
  7. namespace EMIS.DataLogic.ScoreManage
  8. {
  9. public class ExamsStateSettingDAL
  10. {
  11. public ExamsStateSettingRepository ExamsStateSettingRepository { get; set; }
  12. public DictionaryItemRepository DictionaryItemRepository { get; set; }
  13. public int? GetExaminationSuspensionID()
  14. {
  15. var examinationSuspensionID = ExamsStateSettingRepository
  16. .GetList(x => x.IsSuspension == true)
  17. .Select(x => x.ExamsStateID)
  18. .FirstOrDefault();
  19. return examinationSuspensionID;
  20. }
  21. public int? GetNormalID()
  22. {
  23. var normalID = ExamsStateSettingRepository
  24. .GetList(x => x.IsNormal == true)
  25. .Select(x => x.ExamsStateID)
  26. .FirstOrDefault();
  27. return normalID;
  28. }
  29. public int? GetExaminationExemptionID()
  30. {
  31. var examinationExemptionID = ExamsStateSettingRepository
  32. .GetList(x => x.IsExemption == true)
  33. .Select(x => x.ExamsStateID)
  34. .FirstOrDefault();
  35. return examinationExemptionID;
  36. }
  37. //public decimal? GetExemptionScore()
  38. //{
  39. // var Score = ExamsStateSettingRepository
  40. // .GetList(x => x.IsExemption == true)
  41. // .Select(x => x.Score)
  42. // .FirstOrDefault();
  43. // return Score;
  44. //}
  45. public List<int?> GetMisconductIDList()
  46. {
  47. var q = ExamsStateSettingRepository
  48. .GetList(x => x.IsMisconduct == true)
  49. .Select(x => x.ExamsStateID)
  50. .ToList();
  51. return q.ToList();
  52. }
  53. public List<int?> GetResitIDList()
  54. {
  55. var q = ExamsStateSettingRepository
  56. .GetList(x => x.CanResit == true)
  57. .Select(x => x.ExamsStateID)
  58. .ToList();
  59. return q.ToList();
  60. }
  61. public int? GetSuspensionResitCategory()
  62. {
  63. var q = ExamsStateSettingRepository
  64. .GetList(x => x.ExamsStateID == (int)CF_ExamsState.Suspension)
  65. .Select(x => x.ResitCategory);
  66. return q.FirstOrDefault();
  67. }
  68. public List<int?> GetCanGraduateList()
  69. {
  70. var q = ExamsStateSettingRepository
  71. .GetList(x => x.CanGraduateResit == true)
  72. .Select(x => x.ExamsStateID)
  73. .ToList();
  74. return q.ToList();
  75. }
  76. }
  77. }