Files
FoodsharingOnboarding/FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs
Andre Beging bf64239625 Refactor enums and update Interaction entity field
Moved enums to a dedicated namespace and updated references across the codebase. Renamed the `Info` field in the `Interaction` entity to `Info1`, including necessary migrations and UI adjustments. These changes improve the organization and consistency of the codebase.
2025-04-01 10:41:09 +02:00

61 lines
1.7 KiB
C#

using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Contracts.Enums;
using FoodsharingSiegen.Contracts.Model;
using FoodsharingSiegen.Server.Data.Service;
using Microsoft.AspNetCore.Components;
namespace FoodsharingSiegen.Server.Pages
{
/// <summary>
/// The prospects done class (a. beging, 07.02.2023)
/// </summary>
public partial class ProspectsDone
{
#region Dependencies
/// <summary>
/// Gets or sets the value of the prospect service (ab)
/// </summary>
[Inject]
public ProspectService ProspectService { get; set; } = null!;
#endregion
#region Private Properties
private ProspectFilter Filter { get; set; } = new();
/// <summary>
/// Gets or sets the value of the prospect list (ab)
/// </summary>
private List<Prospect>? ProspectList { get; set; }
#endregion
#region Override InitializeDataAsync
/// <inheritdoc />
protected override async Task InitializeDataAsync()
{
await LoadProspects();
}
#endregion
#region Private Method LoadProspects
/// <summary>
/// Loads the prospects (a. beging, 11.04.2022)
/// </summary>
private async Task LoadProspects()
{
var parameter = new GetProspectsParameter { MustHaveInteractions = [InteractionType.Complete] };
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
if (prospectsR.Success) ProspectList = prospectsR.Data;
await InvokeAsync(StateHasChanged);
}
#endregion
}
}