@model IEnumerable<DataLayer.Page>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.ImageName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PageGroup.GroupTitle)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.visit)
        </th>

        <th>
            @Html.DisplayNameFor(model => model.ShowInSlider)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.CreatDate)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
<tr>

    <td>
        <img src="~/PageImages/@item.ImageName" class="thumbnail" style="max-width:120px" />
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.PageGroup.GroupTitle)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Title)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.visit)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.ShowInSlider)
    </td>
    <td>
        @item.CreatDate.ToShamsi()
    </td>
    <td>
        @Html.ActionLink("Edit", "Edit", new { id = item.PageID }) |
        @Html.ActionLink("Details", "Details", new { id = item.PageID }) |
        @Html.ActionLink("Delete", "Delete", new { id = item.PageID })
    </td>
</tr>
}

</table>
