InteractionModal umstellen

This commit is contained in:
Andre Beging
2025-03-28 19:22:51 +01:00
parent d754da76cd
commit 91bff3c127
8 changed files with 205 additions and 235 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>