mh_custom/wtmProject.Shared/Pages/_Admin/FrameworkPost/Create.razor
2024-05-17 13:43:36 +08:00

41 lines
1.2 KiB
Plaintext

@page "/_Admin/FrameworkPost/Create"
@using wtmProject.ViewModel._Admin.FrameworkPostVMs;
@inherits BasePage
<ValidateForm @ref="vform" Model="@Model" OnValidSubmit="@Submit">
<Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">
<BootstrapInput @bind-Value="@Model.Entity.PostCode" />
<BootstrapInput @bind-Value="@Model.Entity.PostName" />
</Row>
<div class="modal-footer table-modal-footer">
<Button Color="Color.Secondary" Icon="fa fa-close" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />
<Button Color="Color.Primary" ButtonType="ButtonType.Submit" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Create"]" IsAsync="true" />
</div>
</ValidateForm>
@code {
private FrameworkPostVM Model = new FrameworkPostVM();
private ValidateForm vform { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
}
private async Task Submit(EditContext context)
{
await PostsForm(vform, "/api/FrameworkPost/add", (s) => "Sys.OprationSuccess");
}
public void OnClose()
{
CloseDialog();
}
}