﻿@model IEnumerable<Soldier>

<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>

<table class="table table-striped">
    <thead>
        <tr>
            <th></th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Rank)</th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().LastName)</th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().FirstName)</th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Unit)</th>
            <th></th>
        </tr>
    </thead>

    <tbody>
        @foreach (var soldier in Model)
        {
            <tr>
                <td>@Html.ActionLink("Details", "Details", new { soldier.Id })</td>
                <td>@Html.DisplayFor(s => soldier.Rank)</td>
                <td>@Html.DisplayFor(s => soldier.LastName)</td>
                <td>@Html.DisplayFor(s => soldier.FirstName)</td>
                <td>@Html.DisplayFor(s => soldier.Unit)</td>
                <td>
                    @Html.ActionLink("Add ABCP", "New", "ABCP", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
                    @Html.ActionLink("Add APFT", "New", "APFT", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
                </td>
            </tr>
        }
    </tbody>
</table>
﻿@model IEnumerable<Soldier>

<h2>Soldiers @Html.ActionLink("Add New", "New", "Soldiers", null, new { @class = "btn btn-default" })</h2>

<table class="table table-striped">
    <thead>
        <tr>
            <th></th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().FirstName)</th>
            <th>@Html.DisplayNameFor(_ => _.FirstOrDefault().Unit)</th>
            <th></th>
        </tr>
    </thead>

    <tbody>
        @foreach (var soldier in Model)
        {
            <tr>
                <td>@Html.ActionLink("Details", "Details", new { soldier.Id })</td>
                <td>@Html.DisplayFor(s => soldier)</td>
                <td>@Html.DisplayFor(s => soldier.Unit)</td>
                <td>
                    @Html.ActionLink("Add ABCP", "New", "ABCP", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
                    @Html.ActionLink("Add APFT", "New", "APFT", new { soldier = soldier.Id }, new { @class = "btn btn-default" })
                </td>
            </tr>
        }
    </tbody>
</table>
Change list display for soldiers
Change list display for soldiers
