LocalGovIMS_localgov-ims/src/Admin/Views/MethodOfPayment/List.cshtml
@model IList<Admin.Models.MethodOfPayment.DetailsViewModel>
@{
    ViewBag.Title = "MOPs";
}

@section Header { Methods of Payment }

@section Subheader { Method of payment management }

@section Actions {
    @Html.ActionLink("Create MOP", "Create", new { }, new { @class = "btn btn-secondary" })
}


@if (Model != null)
{
<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover mt-2">
        <thead>
            <tr>
                <th scope="col">
                    @Html.LabelFor(m => Model.FirstOrDefault().Code)
                </th>
                <th scope="col">
                    @Html.LabelFor(m => Model.FirstOrDefault().Name)
                </th>
                <th scope="col">
                    @Html.LabelFor(m => Model.FirstOrDefault().MaximumAmount)
                </th>
                <th scope="col">
                    @Html.LabelFor(m => Model.FirstOrDefault().MinimumAmount)
                </th>
                <th scope="col">
                    @Html.LabelFor(m => Model.FirstOrDefault().IsDisabled)
                </th>
                <th scope="col">
                    <span class="visually-hidden">Actions</span>
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(m => item.Code)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.MaximumAmount)
                    </td>
                    <td>
                        @Html.DisplayFor(m => item.MinimumAmount)
                    </td>
                    <td>
                        @Html.Label(item.IsDisabled ? "Disabled" : "Active")
                    </td>
                    <td class="text-end">
                        @Html.ActionLink("View", "Details", new { id = item.Code }, new { @class = "btn btn-secondary" })
                        @Html.ActionLink("Edit", "Edit", new { id = item.Code }, new { @class = "btn btn-secondary" })
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>

}
else
{
    Html.RenderPartial("_NoResultsMessage", "methods of payment");
}

