public static StudentClassAttendanceOldViewData Create(ClassAttendanceDetails attendance, StudentClassAttendance studentAttendance, AttendanceReason reason) { var res = new StudentClassAttendanceOldViewData { PersonId = studentAttendance.StudentId, ClassId = attendance.Class.Id, ClassName = attendance.Class.Name, Date = studentAttendance.Date, AttendanceReasonId = studentAttendance.AttendanceReasonId, Student = StudentViewData.Create(studentAttendance.Student), Level = studentAttendance.Level, IsPosted = attendance.IsPosted, AbsentPreviousDay = studentAttendance.AbsentPreviousDay, ReadOnly = studentAttendance.ReadOnly, ReadOnlyReason = studentAttendance.ReadOnlyReason, FullClassReadOnly = attendance.ReadOnly, FullClassReadOnlyReason = attendance.ReadOnlyReason, IsDailyAttendancePeriod = attendance.IsDailyAttendancePeriod }; if (reason != null) { res.AttendanceReason = AttendanceReasonViewData.Create(reason); } return(res); }
protected StudentClassAttendanceViewData(StudentClassAttendance studentAttendance, AttendanceReason attendanceReason) : this(studentAttendance) { if (attendanceReason != null) { AttendanceReason = AttendanceReasonViewData.Create(attendanceReason); } }
public static StudentClassAttendanceViewData Create(StudentClassAttendance studentAttendance, AttendanceReason attendanceReason) { var res = new StudentClassAttendanceViewData(studentAttendance); if (attendanceReason != null) { res.AttendanceReason = AttendanceReasonViewData.Create(attendanceReason); } return(res); }