44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
@using FoodsharingSiegen.Contracts.Entity
|
|
@code {
|
|
private Modal ModalReference { get; set; } = null!;
|
|
|
|
private Prospect Prospect { get; set; } = new();
|
|
|
|
[Parameter] public EventCallback<Prospect> OnAdd { get; set; }
|
|
|
|
public async Task Show()
|
|
{
|
|
Prospect = new();
|
|
await ModalReference.Show();
|
|
}
|
|
|
|
private async Task AddProspect()
|
|
{
|
|
await OnAdd.InvokeAsync(Prospect);
|
|
await ModalReference.Hide();
|
|
}
|
|
}
|
|
|
|
|
|
<Modal @ref="@ModalReference">
|
|
<ModalContent Centered Size="ModalSize.Small">
|
|
<ModalHeader>
|
|
<ModalTitle>Neuling hinzufügen</ModalTitle>
|
|
<CloseButton />
|
|
</ModalHeader>
|
|
<ModalBody>
|
|
<Field>
|
|
<FieldLabel>Name</FieldLabel>
|
|
<TextEdit @bind-Text="Prospect.Name" />
|
|
</Field>
|
|
<Field>
|
|
<FieldLabel>Foodsharing-ID</FieldLabel>
|
|
<NumericEdit TValue="int" @bind-Value="Prospect.FsId"></NumericEdit>
|
|
</Field>
|
|
</ModalBody>
|
|
<ModalFooter>
|
|
<Button Color="Color.Primary" Clicked="@AddProspect">Hinzufügen</Button>
|
|
<Button Color="Color.Secondary" Clicked="ModalReference.Hide">Abbrechen</Button>
|
|
</ModalFooter>
|
|
</ModalContent>
|
|
</Modal> |