public void AddModuleDays(ClassModuleDayStatusEnum status, Class current_class = null) { this.Class_Module_Days.Clear(); current_class = current_class == null ? this.Class : current_class; var dates = GetDatesBySessionStartEnd(); if (dates != null) { foreach (var date in dates) { this.AddModuleDay(date, current_class, ClassModuleDayStatusEnum.Scheduled); } } }
public void AddModuleDay(DateTime date, Class current_class, ClassModuleDayStatusEnum status) { var day = new Class_Module_Day { Class_Module_Day_Date = date, Class_Module_Day_Status = (int)status, Status = (int)EntityStatus.Visible, Created_Date = DateTime.Now }; //foreach (var student in current_class.Students) //{ // day.Class_Module_Day_Students.Add(new Class_Module_Day_Student { // Student_Id = student.Id, // Attendance_Status = (int)StudentClassModuleAttendanceEnum.P, // Status = (int)EntityStatus.Visible, // Created_Date = DateTime.Now }); //} this.Class_Module_Days.Add(day); }