hallo
This commit is contained in:
30
Desktop/hallo/LEA/ViewModels/ApplicationListViewModel.cs
Normal file
30
Desktop/hallo/LEA/ViewModels/ApplicationListViewModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using LEA.Models;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
namespace LEA.ViewModels;
|
||||
|
||||
public class ApplicationListViewModel
|
||||
{
|
||||
public IEnumerable<Application> Applications { get; set; } = new List<Application>();
|
||||
|
||||
public string? SearchTerm { get; set; }
|
||||
|
||||
public ApplicationStatus? StatusFilter { get; set; }
|
||||
|
||||
public IEnumerable<SelectListItem> StatusOptions { get; set; } = new List<SelectListItem>();
|
||||
|
||||
public IDictionary<ApplicationStatus, int> StatusCounts { get; set; } = new Dictionary<ApplicationStatus, int>();
|
||||
|
||||
public int TotalApplications { get; set; }
|
||||
|
||||
public int AppliedCount => GetCount(ApplicationStatus.Applied);
|
||||
|
||||
public int InterviewCount => GetCount(ApplicationStatus.Interview);
|
||||
|
||||
public int OfferCount => GetCount(ApplicationStatus.Offer);
|
||||
|
||||
public int RejectedCount => GetCount(ApplicationStatus.Rejected);
|
||||
|
||||
private int GetCount(ApplicationStatus status)
|
||||
=> StatusCounts.TryGetValue(status, out var count) ? count : 0;
|
||||
}
|
Reference in New Issue
Block a user