cs11dotnet7/vscode/PracticalApps/Northwind.BlazorWasm/Client/Shared/CustomerDetail.razor

57 lines
1.4 KiB
Plaintext
Raw Normal View History

2022-03-13 17:17:01 +01:00
<EditForm Model="@Customer" OnValidSubmit="@OnValidSubmit">
<DataAnnotationsValidator />
<div class="form-group">
<div>
<label>Customer Id</label>
<div>
<InputText @bind-Value="@Customer.CustomerId" />
<ValidationMessage For="@(() => Customer.CustomerId)" />
</div>
</div>
</div>
<div class="form-group ">
<div>
<label>Company Name</label>
<div>
<InputText @bind-Value="@Customer.CompanyName" />
<ValidationMessage For="@(() => Customer.CompanyName)" />
</div>
</div>
</div>
<div class="form-group ">
<div>
<label>Address</label>
<div>
<InputText @bind-Value="@Customer.Address" />
<ValidationMessage For="@(() => Customer.Address)" />
</div>
</div>
</div>
<div class="form-group ">
<div>
<label>Country</label>
<div>
<InputText @bind-Value="@Customer.Country" />
<ValidationMessage For="@(() => Customer.Country)" />
</div>
</div>
</div>
<button type="submit" class="btn btn-@ButtonStyle">
@ButtonText
</button>
</EditForm>
@code {
[Parameter]
public Customer Customer { get; set; } = null!;
[Parameter]
public string ButtonText { get; set; } = "Save Changes";
[Parameter]
public string ButtonStyle { get; set; } = "info";
[Parameter]
public EventCallback OnValidSubmit { get; set; }
}