@model DeliveryTerminal.Models.Partner

@{
    ViewData["Title"] = "Детали";
}

<h1>Детали</h1>

<div>
    <h4>Контрагент</h4>
    <hr />
    <dl class="row">
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.Name)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.Name)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.TaxID)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.TaxID)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.RegID)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.RegID)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.IsSupplier)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.IsSupplier)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.IsCustomer)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.IsCustomer)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.Email)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.Email)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.Address)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.Address)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.ContactName)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.ContactName)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.ContactPhone)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.ContactPhone)
        </dd>
        <dt class = "col-sm-2">
            @Html.DisplayNameFor(model => model.NeedExp)
        </dt>
        <dd class = "col-sm-10">
            @Html.DisplayFor(model => model.NeedExp)
        </dd>
        @if(Model.Region != null)
        {
        <dt class="col-sm-2">
            @Html.DisplayNameFor(model => model.RegionId)
        </dt>
        <dd class="col-sm-10">
            @Html.DisplayFor(model => model.Region.Name)
        </dd>
        }
        @if (Model.TransportingCompany != null)
        {
            <dt class="col-sm-2">
                @Html.DisplayNameFor(model => model.TransportingCompany)
            </dt>
            <dd class="col-sm-10">
                @Html.DisplayFor(model => model.TransportingCompany.Name)
            </dd>
        }
    </dl>
</div>
<div>
    <a asp-action="Edit" asp-route-id="@Model?.Id">Редактировать</a> |
    @if(Model.IsCustomer && Model.UserId == null)
    {
        <a asp-controller="UserRoles" asp-action="Create" asp-route-email="@Model.Email">Создать пользователя</a>@: |
    }
    <a asp-action="Index">Назад к списку</a>
</div>
