AddInteractionModal, AddProspectModal
This commit is contained in:
44
FoodsharingSiegen.Server/Dialogs/AddProspectModal.razor
Normal file
44
FoodsharingSiegen.Server/Dialogs/AddProspectModal.razor
Normal file
@@ -0,0 +1,44 @@
|
||||
@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>
|
||||
Reference in New Issue
Block a user