public SessionClass(SESSIONS session, UserTypeClass userType) { id = session.SESSION_ID; title = session.TITLE; expectedDate = session.EXPECTED_DATE; lessons = session.LESSONS .OrderBy(s => s.ORDR) .Select(l => new LessonClass(l, userType)).ToList(); }
private void setInstance(USERS user) { if (user == null) { return; } id = user.USER_ID; userName = user.USER_NAME; fullName = user.FULL_NAME; profileImage = user.IMAGE; type = GetUserType(user); }
public LessonClass(LESSONS lesson, UserTypeClass userType) { title = lesson.TITLE; duration = lesson.DURATION == null ? 0 : lesson.DURATION.Value; if (userType.userType == UserType.Teacher) { files = lesson.LESSONS_SECTIONS .Where(ls => ls.TEACHER == 1) .Select(ls => new Resource(ls.RESOURCES)).ToList(); } else { files = lesson.LESSONS_SECTIONS .Where(ls => ls.STUDENTS == 1) .Select(ls => new Resource(ls.RESOURCES)).ToList(); } }