Skip to content
Snippets Groups Projects
Commit b9451eb1 authored by Clément's avatar Clément
Browse files

Few Details

parent a54fa552
Branches
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -39,6 +39,7 @@ namespace MVC.Controllers
public async Task<ActionResult> Details(int id)
{
IEnumerable<FightModels> fights = new List<FightModels>();
IEnumerable<FightModels> Fi = new List<FightModels>();
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost:13666/");
......@@ -52,8 +53,9 @@ namespace MVC.Controllers
fights = JsonConvert.DeserializeObject<List<FightModels>>(temp);
}
}
Fi = fights.Where(c => c.War.ID==id).ToList();
ViewBag.Title = (fights.Count() == 0) ? "No Fights for this War" : "All Fights for " + fights.First().War.Name;
return View(fights);
return View(Fi);
}
// GET: War/Create
......
......
......@@ -53,18 +53,6 @@
<dd>
@Html.DisplayFor(model => model.Characteristics.Type)
</dd>
<dt>
@Html.DisplayNameFor(model => model.RelationShips)
</dt>
@foreach (var rel in Model.RelationShips) {
<dd>
@Html.DisplayFor(model => rel.CharacterID)
</dd>
<dd>
@Html.DisplayFor(model => rel.Type)
</dd>
}
</dl>
</div>
<p>
......
......
......@@ -22,10 +22,10 @@
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Character", "Index", "Character")</li>
<li>@Html.ActionLink("House", "Index", "House")</li>
<li>@Html.ActionLink("Fight", "Index", "Fight")</li>
<li>@Html.ActionLink("War", "Index", "War")</li>
<li>@Html.ActionLink("Character", "Index", "Character")</li>
<li>@Html.ActionLink("House", "Index", "House")</li>
<li>@Html.ActionLink("Territory", "Index", "Territory")</li>
</ul>
<!-- Html.Partial("_LoginPartial")-->
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment