Subversion Repositories bacoAlunos

Rev

Rev 1310 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
180 jmachado 1
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
2
<%@ page import="jomm.dao.impl.AbstractDao" %>
3
<%@ page import="pt.estgp.estgweb.domain.Course" %>
4
<%@ page import="java.util.List" %>
5
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
6
<%@ page import="pt.estgp.estgweb.domain.Teacher" %>
7
<%--
8
  Created by IntelliJ IDEA.
9
  User: Jorge
10
  Date: 27/Mai/2008
11
  Time: 12:20:34
12
  To change this template use File | Settings | File Templates.
13
--%>
14
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
15
 
16
<%
17
    AbstractDao.getCurrentSession().beginTransaction();
18
 
19
    List<Course> courses = DaoFactory.getCourseDaoImpl().findAll();
20
 
21
    for(Course c: courses)
22
    {
23
%>
24
<table border="1">
25
    <tr>
26
        <th>Nome</th>
27
        <td><%=c.getName()%></td>
28
    </tr>
29
    <tr>
30
        <th>Codigo</th>
31
        <td><%=c.getCode()%></td>
32
    </tr>
33
    <tr>
34
        <th>Grau</th>
35
        <td><%=c.getDegree()%></td>
36
    </tr>
37
</table>
38
 
39
<table border="1">
40
    <tr>
41
        <th>
42
            Unidade
43
        </th>
44
        <th>
45
            Semestre
46
        </th>
47
    </tr>
48
    <%
49
        for (CourseUnit cu : c.getCourseUnits())
50
        {
51
    %>
52
    <tr>
53
        <td>
54
            <%=cu.getName()%>
55
        </td>
56
        <td>
57
            <%=cu.getSemestre()%>
58
        </td>
59
        <%
60
            for (Teacher t: cu.getTeachers())
61
            {
62
        %>
63
            <td><%=t.getName()%></td>
64
        <%
65
            }
66
        %>
67
    </tr>
68
    <%
69
        }
70
    %>
71
</table>
72
<%
73
    }
74
    AbstractDao.getCurrentSession().getTransaction().commit();
75
%>