Jonathan Jenne 7b7147eeee 07-12-2022
2022-12-07 16:45:31 +01:00

29 lines
623 B
Plaintext

@page "/jobs/new"
@using ECM.JobRunner.Common.JobRunnerReference;
@using ECM.JobRunner.Web.Data;
@using ECM.JobRunner.Web.Components.Job;
@inject NavigationManager Navigation;
@inject JobService Jobs;
<PageTitle>Job erstellen</PageTitle>
<h3>Job erstellen</h3>
<JobForm JobId="JobId" OnValidSubmit="OnFormSubmit" />
@code {
public int JobId = -1;
private async void OnFormSubmit(EditContext ctx)
{
JobDefinition job = (JobDefinition)ctx.Model;
bool result = await Jobs.CreateJob(job);
if (result == true)
{
Navigation.NavigateTo("/jobs");
}
}
}