29 lines
624 B
Plaintext
29 lines
624 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");
|
|
}
|
|
}
|
|
}
|