@model economy.Models.View<economy.Models.Financial.Exchange.Request, economy.Models.Financial.Exchange.Response>

@{
    ViewData["Title"] = "환율";
}

<div class="container">
    <h3>환율</h3>

    <div class="row mt-3">
        <div class="col align-self-center">
            @(Model?.Response?.Items?.Count().ToString("N0")) 개
        </div>
        <div class="col-auto">
            <input type="date" name="date" id="date" class="form-control" value="@Model.Request.DateFormatted" form="fSearch" />
        </div>
    </div>

    <div class="table-responsive">
        <table id="financialExchange" class="table table-bordered table-hover">
            <caption class="caption-top">
                한국수출입은행이 제공하는 환율정보입니다.
            </caption>
            <colgroup>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
                <col width="10%"/>
            </colgroup>
            <thead>
                <tr>
                    <th>통화 단위</th>
                    <th>국가/통화명</th>
                    <th>매입 환율</th>
                    <th>매도 환율</th>
                    <th>기준 환율</th>
                    <th>은행 판매율</th>
                    <th>년환가료율</th>
                    <th>10일환가료율</th>
                    <th>서울외국환중개 매매기준율</th>
                    <th>서울외국환중개 장부가격</th>
                </tr>
            </thead>
            <tbody>
                @if (Model?.Response?.Items != null && Model?.Response?.Items.Count() > 0)
                {
                    @foreach (var row in Model.Response.Items)
                    {
                        <tr>
                            <td>@row.CurUnit</td>
                            <td>@row.CurNm</td>
                            <td>@row.Ttb</td>
                            <td>@row.Tts</td>
                            <td>@row.DealBasRate</td>
                            <td>@row.BankSellingRate</td>
                            <td>@row.YearlyExchangeFeeRate</td>
                            <td>@row.TenDayExchangeFeeRate</td>
                            <td>@row.KftcBankSellingRate</td>
                            <td>@row.KftcDealBaseRate</td>
                        </tr>
                    }
                }
                else
                {
                    <tr>
                        <td colspan="10">
                            No data.
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>

    <form id="fSearch" method="get" accept-charset="UTF-8" rel="search" autocomplete="off" asp-controller="Financial" asp-action="Exchange"></form>
</div>

@section Scripts {
    <script src="~/js/financial.js" asp-append-version="true"></script>
}
@section Styles {
    <link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
}