ClassroomExcessiveUseView.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using EMIS.Entities;
  8. namespace EMIS.ViewModel.EducationSchedule
  9. {
  10. public class ClassroomExcessiveUseView
  11. {
  12. public ClassroomExcessiveUseView()
  13. {
  14. this.Scheduling = new List<ClassroomExcessiveUseSchedulingView>();
  15. }
  16. public System.Guid ClassroomExcessiveUseID { get; set; }
  17. [Required]
  18. [DisplayName("教室")]
  19. public Nullable<System.Guid> ClassroomID { get; set; }
  20. public string ClassroomName { get; set; }
  21. [Required]
  22. [DisplayName("学年学期")]
  23. public Nullable<System.Guid> SchoolyearID { get; set; }
  24. public string SchoolyearCode { get; set; }
  25. [Required]
  26. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "UsingCollege")]
  27. public Nullable<System.Guid> CollegeID { get; set; }
  28. public string CollegeName { get; set; }
  29. [Required]
  30. [DisplayName("使用人")]
  31. public Nullable<System.Guid> UserID { get; set; }
  32. public string UserName { get; set; }
  33. [Required]
  34. [DisplayName("活动内容")]
  35. public string Content { get; set; }
  36. [DisplayName("时间安排")]
  37. public List<ClassroomExcessiveUseSchedulingView> Scheduling { get; set; }
  38. public string SchedulingString
  39. {
  40. get
  41. {
  42. var schedulingStringList = Scheduling.OrderBy(x => x.StartTimes)
  43. .Select(x => new
  44. {
  45. x.Weekday,
  46. x.WeekdayDesc,
  47. x.CoursesTimeID,
  48. x.StartTimes,
  49. x.EndTimes,
  50. x.StartHour,
  51. x.StartMinute,
  52. x.EndHour,
  53. x.EndMinute,
  54. WeekNums = x.WeekNumList.ToList().GetWeekNumString()
  55. })
  56. .Select(x => string.Format("{0}第{1}-{2}节({3})", x.WeekdayDesc, x.StartTimes, x.EndTimes, x.WeekNums));
  57. return string.Join(",", schedulingStringList);
  58. }
  59. }
  60. [DisplayName("申请人")]
  61. public Guid? CreateUserID { get; set; }
  62. public string CreateUserName { get; set; }
  63. public DateTime? CreateTime { get; set; }
  64. public string CreateTimeStr {
  65. get {
  66. return CreateTime == null ? "" : CreateTime.Value.ToString();
  67. }
  68. }
  69. }
  70. }