InteractionModal umstellen
This commit is contained in:
@@ -24,9 +24,6 @@
|
||||
<hr />
|
||||
<ProspectGrid
|
||||
Prospects="filterList"
|
||||
OnRemoveInteraction="RemoveInteractionAsync"
|
||||
StateFilter="ProspectStateFilter.OnBoarding"
|
||||
InteractionModal="InteractionModal">
|
||||
</ProspectGrid>
|
||||
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
OnDataChanged="@LoadProspects"
|
||||
StateFilter="ProspectStateFilter.OnBoarding">
|
||||
</ProspectGrid>
|
||||
@@ -97,49 +97,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method OnAddInteraction
|
||||
|
||||
/// <summary>
|
||||
/// Ons the add interaction using the specified arg (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task OnAddInteraction(Interaction arg)
|
||||
{
|
||||
arg.UserID = CurrentUser.Id;
|
||||
await ProspectService.AddInteraction(arg);
|
||||
await LoadProspects();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method OnAddProspect
|
||||
|
||||
/// <summary>
|
||||
/// Ons the add prospect using the specified arg (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task OnAddProspect(Prospect arg)
|
||||
{
|
||||
var addProspectR = await ProspectService.AddProspectAsync(arg);
|
||||
if (addProspectR.Success) await LoadProspects();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method OnUpdateProspect
|
||||
|
||||
/// <summary>
|
||||
/// Ons the update prospect using the specified prospect (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="prospect">The prospect</param>
|
||||
private async Task OnUpdateProspect(Prospect prospect)
|
||||
{
|
||||
var updateProspectR = await ProspectService.UpdateAsync(prospect);
|
||||
if (updateProspectR.Success) await LoadProspects();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method RemoveInteractionAsync
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -14,14 +14,8 @@
|
||||
<hr/>
|
||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||
<hr />
|
||||
<h5>@(filterList.Count) Einträge</h5>
|
||||
@if (filterList.Any())
|
||||
{
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@filterList">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.Verification"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
<ProspectGrid
|
||||
Prospects="filterList"
|
||||
OnDataChanged="@LoadProspects"
|
||||
StateFilter="ProspectStateFilter.Verification">
|
||||
</ProspectGrid>
|
||||
@@ -31,11 +31,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
private ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the interaction modal (ab)
|
||||
/// </summary>
|
||||
private AddInteractionModal? InteractionModal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect list (ab)
|
||||
/// </summary>
|
||||
@@ -84,21 +79,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method OnAddInteraction
|
||||
|
||||
/// <summary>
|
||||
/// Ons the add interaction using the specified arg (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task OnAddInteraction(Interaction arg)
|
||||
{
|
||||
arg.UserID = CurrentUser.Id;
|
||||
await ProspectService.AddInteraction(arg);
|
||||
await LoadProspects();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method OnUpdateProspect
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user