< Summary

Information
Class: AspNetCoreGeneratedDocument.Areas_OneCFresh_Views_Catalog_Contracts
Assembly: OzonOrdersWeb
File(s): /home/runner/work/Studio2Prod/Studio2Prod/OzonOrdersWeb/Areas/OneCFresh/Views/Catalog/Contracts.cshtml
Line coverage
0%
Covered lines: 0
Uncovered lines: 25
Coverable lines: 25
Total lines: 111
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 48
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%1190340%
<ExecuteAsync()0%272160%
<ExecuteAsync()100%210%
<ExecuteAsync()100%210%

File(s)

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

#LineLine coverage
 1@model OzonOrdersWeb.Areas.OneCFresh.ViewModels.ContractsViewModel
 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-file-text me-2 text-primary"></i>@ViewData["Title"]
 10    </h5>
 011    <span class="badge bg-secondary">@Model.TotalCount</span>
 012    @if (Model.CounterpartyGuid.HasValue && Model.CounterpartyNames.TryGetValue(Model.CounterpartyGuid.Value, out var ct
 13    {
 014        <span class="badge bg-info text-dark">@ctName</span>
 15    }
 16</div>
 17
 018@if (TempData["Error"] is string err)
 19{
 020    <div class="alert alert-danger py-2 small">@err</div>
 21}
 22
 23<form method="get" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Contracts" class="row g-2 align-items-end m
 24    <div class="col-12 col-md-4">
 25        <label class="form-label form-label-sm mb-1 text-muted">Контрагент</label>
 26        <select name="counterpartyGuid" class="form-select form-select-sm" id="counterpartyFilter">
 27            <option value="">— Все контрагенты —</option>
 028            @foreach (var cp in Model.AllCounterparties)
 29            {
 030                <option value="@cp.RefKey" selected="@(Model.CounterpartyGuid == cp.RefKey ? "selected" : null)">@cp.Des
 31            }
 32        </select>
 33    </div>
 34    <div class="col-12 col-md-4">
 35        <label class="form-label form-label-sm mb-1 text-muted">Договор</label>
 36        <input class="form-control form-control-sm" name="search" value="@Model.Search" placeholder="Поиск по наименован
 37    </div>
 38    <div class="col-auto align-self-end">
 39        <button type="submit" class="btn btn-primary btn-sm"><i class="bi bi-search me-1"></i>Найти</button>
 040        @if (Model.CounterpartyGuid.HasValue || !string.IsNullOrWhiteSpace(Model.Search))
 41        {
 42            <a asp-area="OneCFresh" asp-controller="Catalog" asp-action="Contracts" class="btn btn-outline-secondary btn
 43                <i class="bi bi-x-lg"></i> Сбросить
 44            </a>
 45        }
 46    </div>
 47</form>
 48
 49<div class="table-responsive">
 50    <table class="table table-sm table-hover onec-table border">
 51        <thead class="table-light">
 52            <tr>
 53                <th>Номер / Наименование</th>
 54                <th>Контрагент</th>
 55                <th>GUID</th>
 56                <th>Статус</th>
 57            </tr>
 58        </thead>
 59        <tbody>
 060            @foreach (var item in Model.Items)
 61            {
 62                <tr class="@(item.DeletionMark ? "text-muted" : "")">
 063                    <td class="fw-semibold">@item.Description</td>
 64                    <td>
 065                        @if (Model.CounterpartyNames.TryGetValue(item.Owner, out var name))
 66                        {
 067                            <a asp-area="OneCFresh" asp-controller="Catalog" asp-action="Counterparties" asp-route-searc
 068                                @name
 69                            </a>
 70                        }
 71                        else
 72                        {
 073                            <span class="font-monospace text-muted" style="font-size:.75rem">@item.Owner.ToString().ToUp
 74                        }
 75                    </td>
 076                    <td class="font-monospace text-muted" style="font-size:.75rem">@item.RefKey.ToString().ToUpper()</td
 77                    <td>
 078                        @if (item.DeletionMark)
 79                        {
 80                            <span class="badge badge-deleted">Удалён</span>
 81                        }
 82                        else
 83                        {
 84                            <span class="badge bg-success">Активен</span>
 85                        }
 86                    </td>
 87                </tr>
 088            }
 089            @if (!Model.Items.Any())
 90            {
 91                <tr><td colspan="4" class="text-center text-muted py-3">Договора не найдены</td></tr>
 92            }
 93        </tbody>
 94    </table>
 95</div>
 96
 097@if (totalPages > 1)
 98{
 99    <nav>
 100        <ul class="pagination pagination-sm">
 0101            @for (var i = 1; i <= Math.Min(totalPages, 20); i++)
 102            {
 103                <li class="page-item @(i == Model.Page ? "active" : "")">
 104                    <a class="page-link" asp-area="OneCFresh" asp-controller="Catalog" asp-action="Contracts"
 0105                       asp-route-search="@Model.Search" asp-route-counterpartyGuid="@Model.CounterpartyGuid"
 0106                       asp-route-page="@i" asp-route-pageSize="@Model.PageSize">@i</a>
 107                </li>
 108            }
 109        </ul>
 110    </nav>
 111}