Add index and create
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
@model MileageTraker.Web.Models.City
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Create City";
|
||||
}
|
||||
|
||||
<h2 class="center-content">@ViewBag.Title</h2>
|
||||
|
||||
@using (Html.BeginForm("Create", "City", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
|
||||
{
|
||||
@Html.Partial("_ValidationSummary")
|
||||
<fieldset>
|
||||
<legend></legend>
|
||||
@Html.DisplayFor(m => m.County)
|
||||
@* <div class="control-group">
|
||||
<div class="control-label">
|
||||
@Html.DisplayNameFor(m => m.County)
|
||||
</div>
|
||||
<div class="controls">
|
||||
@Html.DisplayTextFor(m => m.County)
|
||||
</div>
|
||||
</div>*@
|
||||
@Html.HiddenFor(m => m.County)
|
||||
|
||||
@Html.EditorFor(m => m.Name)
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
@model Dictionary<string,List<string>>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Cities by County";
|
||||
}
|
||||
|
||||
@Html.Partial("_StatusMessage")
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<div>
|
||||
@foreach (var countyCities in Model)
|
||||
{
|
||||
<div>
|
||||
<h3>@countyCities.Key</h3>
|
||||
@foreach (var city in countyCities.Value)
|
||||
{
|
||||
<span class="label">
|
||||
@city
|
||||
</span>
|
||||
}
|
||||
@Html.ActionLink("Add New City", "Create", new {County=countyCities.Key}, new { @class = "btn" })
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -36,6 +36,7 @@
|
||||
@Html.ActionLink("Add New Log", "Create", null, new { @class = "btn" })
|
||||
@Html.ActionLink("Export", "Export", new { Model.Year, Model.Month, Model.LogType, Model.MonthRange, Model.VehicleId, Model.EmployeeName }, new { @class = "btn" })
|
||||
@Html.ActionLink("Purposes", "Index", "Purpose", null, new { @class = "btn" })
|
||||
@Html.ActionLink("Cities", "Index", "City", null, new { @class = "btn" })
|
||||
@Html.ActionLink("Import", "ImportUpload", null, new { @class = "btn"})
|
||||
|
||||
<div class="btn-group">
|
||||
|
||||
Reference in New Issue
Block a user