< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_OneCFresh_Views_Catalog_Counterparties
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/OneCFresh/Views/Catalog/Counterparties.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 96
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 30
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ExecuteAsync()0%812280%
<ExecuteAsync()0%2040%
<ExecuteAsync()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/OneCFresh/Views/Catalog/Counterparties.cshtml

#LineLine coverage
 1@model OzonOrdersWeb.Areas.OneCFresh.ViewModels.CounterpartiesViewModel
 2@{
 03    ViewData["Title"] = "Контрагенты";
 04    var totalPages = Model.TotalCount == 0 ? 1 : (int)Math.Ceiling(Model.TotalCount / (double)Model.PageSize);
 5}
 6
 7<div class="d-flex align-items-center gap-2 mb-3">
 8    <h5 class="mb-0 fw-semibold">
 09        <i class="bi bi-people me-2 text-primary"></i>@ViewData["Title"]
 10    </h5>
 011    <span class="badge bg-secondary">@Model.TotalCount</span>
 12</div>
 13
 014@if (TempData["Error"] is string err)
 15{
 016    <div class="alert alert-danger py-2 small">@err</div>
 17}
 18
 19<form method="get" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Counterparties" class="row g-2 align-items-
 20    <div class="col-12 col-md-5">
 21        <input class="form-control form-control-sm" name="search" value="@Model.Search" placeholder="Поиск по наименован
 22    </div>
 23    <div class="col-auto">
 24        <button type="submit" class="btn btn-primary btn-sm">
 25            <i class="bi bi-search me-1"></i>Найти
 26        </button>
 027        @if (!string.IsNullOrWhiteSpace(Model.Search))
 28        {
 29            <a asp-area="OneCFresh" asp-controller="Catalog" asp-action="Counterparties" class="btn btn-outline-secondar
 30                <i class="bi bi-x"></i>
 31            </a>
 32        }
 33    </div>
 34</form>
 35
 36<div class="table-responsive">
 37    <table class="table table-sm table-hover onec-table border">
 38        <thead class="table-light">
 39            <tr>
 40                <th>Наименование</th>
 41                <th>ИНН</th>
 42                <th>КПП</th>
 43                <th>GUID</th>
 44                <th>Договора</th>
 45                <th>Статус</th>
 46            </tr>
 47        </thead>
 48        <tbody>
 049            @foreach (var item in Model.Items)
 50            {
 51                <tr class="@(item.DeletionMark ? "text-muted" : "")">
 052                    <td class="fw-semibold">@item.Description</td>
 053                    <td class="font-monospace">@item.Inn</td>
 054                    <td class="font-monospace">@item.Kpp</td>
 055                    <td class="font-monospace text-muted" style="font-size:.75rem">@item.RefKey.ToString().ToUpper()</td
 56                    <td>
 57                        <a asp-area="OneCFresh" asp-controller="Catalog" asp-action="Contracts"
 058                           asp-route-counterpartyGuid="@item.RefKey"
 59                           class="btn btn-outline-secondary btn-sm py-0 px-1">
 60                            <i class="bi bi-file-text"></i>
 61                        </a>
 62                    </td>
 63                    <td>
 064                        @if (item.DeletionMark)
 65                        {
 66                            <span class="badge badge-deleted"><i class="bi bi-trash me-1"></i>Удалён</span>
 67                        }
 68                        else
 69                        {
 70                            <span class="badge bg-success"><i class="bi bi-check-circle me-1"></i>Активен</span>
 71                        }
 72                    </td>
 73                </tr>
 074            }
 075            @if (!Model.Items.Any())
 76            {
 77                <tr><td colspan="6" class="text-center text-muted py-3">Записи не найдены</td></tr>
 78            }
 79        </tbody>
 80    </table>
 81</div>
 82
 083@if (totalPages > 1)
 84{
 85    <nav>
 86        <ul class="pagination pagination-sm">
 087            @for (var i = 1; i <= Math.Min(totalPages, 20); i++)
 88            {
 89                <li class="page-item @(i == Model.Page ? "active" : "")">
 90                    <a class="page-link" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Counterparties"
 091                       asp-route-search="@Model.Search" asp-route-page="@i" asp-route-pageSize="@Model.PageSize">@i</a>
 92                </li>
 93            }
 94        </ul>
 95    </nav>
 96}