<%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Register TagPrefix="uc" TagName="Menu" Src="~/Views/Shared/Menu.ascx" %>
<%@ Register TagPrefix="uc" TagName="CourseMenu" Src="~/Views/Course/CourseMenu.ascx" %>
<%@ Register TagPrefix="uc" TagName="CourseSearch" Src="~/Views/Course/Search.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
</head>
<body>
    <uc:Menu id="MenuTop" 
        runat="server" 
        MinValue="1" 
        MaxValue="10" />
    <uc:CourseMenu id="SubMenu" 
        runat="server" 
        MinValue="1" 
        MaxValue="10" />
        <a href="<%response.write( global_asax.WebPath)%>Course/Create">Ajouter un cours</a>
    <h1>Liste des cours</h1>
        <form name="SearchForm" id="SearchForm" method="post" action="course/SetCourseFilter" runat="server" >
    <uc:CourseSearch id="SearchPanel" runat="server" />
    </form>
    <div>
   <%  
       Dim dt As CoursE.coursedata.courseDataTable = Me.ViewData.Item("tablecourse")
     
       %><table class="table_client"><tr><th>Prénom</th><th>Nom</th><th></th></tr>
       <%
           For intCpt As Integer = 0 To dt.DefaultView.ToTable.Rows.Count - 1
       %><tr><td><%                     
                     Response.Write(dt.DefaultView.Item(intCpt).Item("COURSE_CODE"))
       %></td><td><%
                      Response.Write(dt.DefaultView.Item(intCpt).Item("COURSE_DESCRIPTION"))
                      'Response.Write(dt.Item(intCpt).COURSE_DESCRIPTION)
       %></td><td><a href="Course/Details/<% Response.Write(dt.DefaultView.Item(intCpt).Item("COURSE_ID")) %>">Voir</a></td></tr><%
             Next
                    %></table>
                    <%
                        Response.Write("<br />Total : " & dt.DefaultView.ToTable.Rows.Count)
   %> 
    
    </div>
</body>
</html>
