File size: 1,642 Bytes
03549e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.cs102.attendance.dto;

import java.util.List;

public class MainViewDto {
    private List<SessionDto> todaySessions;
    private List<StudentRosterDto> studentRoster;
    private int totalStudents;
    private int totalSessions;
    
    // Constructors
    public MainViewDto() {}
    
    public MainViewDto(List<SessionDto> todaySessions, List<StudentRosterDto> studentRoster) {
        this.todaySessions = todaySessions;
        this.studentRoster = studentRoster;
        this.totalStudents = studentRoster != null ? studentRoster.size() : 0;
        this.totalSessions = todaySessions != null ? todaySessions.size() : 0;
    }
    
    // Getters and Setters
    public List<SessionDto> getTodaySessions() {
        return todaySessions;
    }
    
    public void setTodaySessions(List<SessionDto> todaySessions) {
        this.todaySessions = todaySessions;
        this.totalSessions = todaySessions != null ? todaySessions.size() : 0;
    }
    
    public List<StudentRosterDto> getStudentRoster() {
        return studentRoster;
    }
    
    public void setStudentRoster(List<StudentRosterDto> studentRoster) {
        this.studentRoster = studentRoster;
        this.totalStudents = studentRoster != null ? studentRoster.size() : 0;
    }
    
    public int getTotalStudents() {
        return totalStudents;
    }
    
    public void setTotalStudents(int totalStudents) {
        this.totalStudents = totalStudents;
    }
    
    public int getTotalSessions() {
        return totalSessions;
    }
    
    public void setTotalSessions(int totalSessions) {
        this.totalSessions = totalSessions;
    }
}