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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CVManager.Models.ViewData.IndexModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>Graduations</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>List Graduations</h2>
<%= Html.ValidationSummary("Creation was unsuccessful. Please correct the errors and try again.")%>
<table class="data-table" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th class="actions">
Edit
</th>
<th class="actions">
Delete
</th>
<th>
Name
</th>
<th>
# Diploma
</th>
</tr>
</thead>
<tbody>
<% var diplomaInGrade = new ArrayList();
foreach (var item in Model.DiplomaInGrade)
{
diplomaInGrade.Add(item.Diploma.Count);
}
int i = 0;
foreach (var item in Model.Grades) { %>
<tr>
<td class="actions">
<a href='<%= Url.Action("Edit", new {id=item.Id}) %>'><img src="../../Content/Edit.png" alt="Edit" /></a>
</td>
<td class="actions">
<a href='<%= Url.Action("Delete", new {id=item.Id}) %>'><img src="../../Content/Delete.png" alt="Delete" /></a>
</td>
<td>
<%= Html.Encode(item.Name) %>
</td>
<td>
<%= Html.Encode(diplomaInGrade[i].ToString())%>
</td>
</tr>
<%i++;} %>
<tr>
<th colspan="5">Add:</th>
</tr>
<tr><% using (Html.BeginForm("Index", "Grade", FormMethod.Post, new { id = "TheForm" }))
{ %>
<td class="actions" colspan="2">
<input type="submit" value="Create" />
</td>
<td>
<%= Html.TextBox("Name") %>
<%= Html.ValidationMessage("Name", "*") %>
</td>
<td></td>
<% } %>
</tr>
</tbody>
</table>
</asp:Content> |