115 lines
3.3 KiB
Plaintext
115 lines
3.3 KiB
Plaintext
@model IEnumerable<StockManMVC.Models.Item>
|
|
|
|
@using GridMvc.Html
|
|
@{
|
|
ViewBag.Title = "Grid";
|
|
}
|
|
@*@{
|
|
Layout = null;
|
|
}*@
|
|
|
|
<h2>Grid</h2>
|
|
|
|
<link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
|
|
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" />
|
|
<script src="@Url.Content("~/Scripts/jquery-3.1.0.min.js")"></script>
|
|
<script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>
|
|
|
|
<div class="code-cut">
|
|
@Html.Grid(Model).Columns(columns =>
|
|
{
|
|
columns.Add()
|
|
.Encoded(false)
|
|
.Sanitized(false)
|
|
.SetWidth(30)
|
|
.RenderValueAs(o => Html.ActionLink("Select", "Details", new { id = o.ID }));
|
|
columns.Add(c => c.Descr).Titled("Descr").Filterable(true);
|
|
columns.Add(c => c.CodInt).Titled("CodInt").Filterable(true);
|
|
columns.Add(c => c.CodExt).Titled("CodExt").Filterable(true);
|
|
columns.Add(c => c.DescrExt).Titled("DescrExt").Filterable(true);
|
|
columns.Add(c => c.QtaMin).Titled("QtaMin").Filterable(true);
|
|
columns.Add(c => c.QtaBatch).Titled("QtaBatch").Filterable(true);
|
|
columns.Add(c => c.CurrValue).Titled("CurrValue").Filterable(true);
|
|
columns.Add(c => c.ItemFamily.Descr).Titled("Family").Filterable(true);
|
|
columns.Add()
|
|
.Encoded(false)
|
|
.Sanitized(false)
|
|
.SetWidth(30)
|
|
.RenderValueAs(o => Html.ActionLink("Edit", "Edit", new { id = o.ID }));
|
|
columns.Add()
|
|
.Encoded(false)
|
|
.Sanitized(false)
|
|
.SetWidth(30)
|
|
.RenderValueAs(o => Html.ActionLink("Delete", "Delete", new { id = o.ID }));
|
|
|
|
}).WithPaging(5).Sortable(true)
|
|
</div>
|
|
|
|
@*<p>
|
|
@Html.ActionLink("Create New", "Create")
|
|
</p>
|
|
<table class="table">
|
|
<tr>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.Descr)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.CodInt)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.CodExt)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.DescrExt)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.QtaMin)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.QtaBatch)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.CurrValue)
|
|
</th>
|
|
<th>
|
|
@Html.DisplayNameFor(model => model.ItemFamily.Descr)
|
|
</th>
|
|
<th></th>
|
|
</tr>
|
|
|
|
@foreach (var item in Model) {
|
|
<tr>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.Descr)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.CodInt)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.CodExt)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.DescrExt)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.QtaMin)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.QtaBatch)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.CurrValue)
|
|
</td>
|
|
<td>
|
|
@Html.DisplayFor(modelItem => item.ItemFamily.Descr)
|
|
</td>
|
|
<td>
|
|
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
|
|
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
|
|
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
|
|
</td>
|
|
</tr>
|
|
}
|
|
|
|
</table>*@
|
|
|