@page "/admin/clients/{id:int}/edit"
@model TaxBaik.Web.Pages.Admin.Clients.EditModel
@{
    ViewData["Title"] = "고객 수정";
}

<section class="admin-page-shell">
    @await Html.PartialAsync("_AdminPageHeader", new TaxBaik.Web.Models.AdminPageHeaderModel("고객 관리", "고객 수정", "기존 고객 정보를 불러와 Tabler 표준 폼으로 수정합니다.", null, null))

    <div class="card mb-3">
        <div class="card-body">
            <div class="text-muted small text-uppercase mb-1">불러온 원본</div>
            <div class="fw-semibold">@Model.Input.Name</div>
            <div class="text-muted small">@Model.Input.CompanyName / @Model.Input.Phone</div>
        </div>
    </div>

    <form method="post" class="card">
        <div class="card-body">
            @await Html.PartialAsync("_ValidationSummary")
            <div class="row g-3">
                <div class="col-md-6">
                    <label asp-for="Input.Name" class="form-label"></label>
                    <input asp-for="Input.Name" class="form-control" />
                    <span asp-validation-for="Input.Name" class="text-danger small"></span>
                </div>
                <div class="col-md-6">
                    <label asp-for="Input.CompanyName" class="form-label"></label>
                    <input asp-for="Input.CompanyName" class="form-control" />
                </div>
                <div class="col-md-6">
                    <label asp-for="Input.Phone" class="form-label"></label>
                    <input asp-for="Input.Phone" class="form-control" />
                </div>
                <div class="col-md-6">
                    <label asp-for="Input.Email" class="form-label"></label>
                    <input asp-for="Input.Email" class="form-control" />
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.Status" class="form-label"></label>
                    <input asp-for="Input.Status" class="form-control" />
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.ServiceType" class="form-label"></label>
                    <input asp-for="Input.ServiceType" class="form-control" />
                </div>
                <div class="col-md-4">
                    <label asp-for="Input.TaxType" class="form-label"></label>
                    <input asp-for="Input.TaxType" class="form-control" />
                </div>
                <div class="col-12">
                    <label asp-for="Input.Source" class="form-label"></label>
                    <input asp-for="Input.Source" class="form-control" />
                </div>
                <div class="col-12">
                    <label asp-for="Input.Memo" class="form-label"></label>
                    <textarea asp-for="Input.Memo" class="form-control" rows="5"></textarea>
                </div>
            </div>
        </div>
        <div class="card-footer d-flex justify-content-end gap-2">
            <a class="btn btn-outline-secondary" href="/admin/clients/@Model.Id">취소</a>
            <button class="btn btn-primary" type="submit">저장</button>
        </div>
    </form>
</section>

<div class="card mt-3">
    <div class="card-body d-flex justify-content-between align-items-center gap-3">
        <div>
            <div class="text-muted small text-uppercase">위험 작업</div>
            <div class="fw-semibold">고객을 삭제합니다.</div>
        </div>
        <form method="post" asp-page-handler="Delete" onsubmit="return confirm('정말 삭제하시겠습니까?');">
            <button class="btn btn-outline-danger" type="submit">삭제</button>
        </form>
    </div>
</div>









