44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
@page "/_Admin/WTM_AREA/Edit/{id}"
|
|
@using wtmProject.ViewModel._Admin.WTM_AREAVMs;
|
|
@inherits BasePage
|
|
|
|
<ValidateForm @ref="vform" Model="@Model" OnValidSubmit="@Submit">
|
|
<Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">
|
|
|
|
<BootstrapInput @bind-Value="@Model.Entity.AreaCode" />
|
|
<BootstrapInput @bind-Value="@Model.Entity.AreaName" />
|
|
</Row>
|
|
<div class="modal-footer table-modal-footer">
|
|
@*<Button Color="Color.Primary" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />*@
|
|
<Button Color="Color.Primary" ButtonType="ButtonType.Submit" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Edit"]" IsAsync="true" />
|
|
</div>
|
|
</ValidateForm>
|
|
|
|
@code {
|
|
|
|
private WTM_AREAVM Model = null;
|
|
private ValidateForm vform { get; set; }
|
|
[Parameter]
|
|
public string id { get; set; }
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
|
|
var rv = await WtmBlazor.Api.CallAPI<WTM_AREAVM>($"/api/WTM_AREA/{id}");
|
|
Model = rv.Data;
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
private async Task Submit(EditContext context)
|
|
{
|
|
await PostsForm(vform, $"/api/WTM_AREA/edit", (s) => "Sys.OprationSuccess", method: HttpMethodEnum.PUT);
|
|
}
|
|
|
|
public void OnClose()
|
|
{
|
|
CloseDialog();
|
|
}
|
|
|
|
}
|