hallo
This commit is contained in:
52
Desktop/hallo/LEA/ViewModels/ApplicationFormViewModel.cs
Normal file
52
Desktop/hallo/LEA/ViewModels/ApplicationFormViewModel.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using LEA.Models;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
namespace LEA.ViewModels;
|
||||
|
||||
public class ApplicationFormViewModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "Bitte geben Sie eine Rolle oder Position an.")]
|
||||
[StringLength(150, ErrorMessage = "Der Titel darf maximal {1} Zeichen lang sein.")]
|
||||
[Display(Name = "Rolle / Position")]
|
||||
public string Role { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Bitte geben Sie ein Unternehmen an.")]
|
||||
[StringLength(150, ErrorMessage = "Der Firmenname darf maximal {1} Zeichen lang sein.")]
|
||||
[Display(Name = "Unternehmen")]
|
||||
public string Company { get; set; } = string.Empty;
|
||||
|
||||
[StringLength(200, ErrorMessage = "Die Quelle darf maximal {1} Zeichen lang sein.")]
|
||||
[Display(Name = "Quelle")]
|
||||
public string? Source { get; set; }
|
||||
|
||||
[Display(Name = "Status")]
|
||||
public ApplicationStatus Status { get; set; } = ApplicationStatus.Applied;
|
||||
|
||||
[DataType(DataType.Date)]
|
||||
[Display(Name = "Beworben am")]
|
||||
public DateTime AppliedOn { get; set; } = DateTime.Today;
|
||||
|
||||
[Display(Name = "Notizen")]
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string? Notes { get; set; }
|
||||
|
||||
[Display(Name = "Name")]
|
||||
public string? ContactName { get; set; }
|
||||
|
||||
[EmailAddress(ErrorMessage = "Bitte eine gültige E-Mail-Adresse eingeben.")]
|
||||
[Display(Name = "E-Mail")]
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
[Phone(ErrorMessage = "Bitte eine gültige Telefonnummer eingeben.")]
|
||||
[Display(Name = "Telefon")]
|
||||
public string? ContactPhone { get; set; }
|
||||
|
||||
public IEnumerable<SelectListItem> StatusOptions { get; set; } = Enumerable.Empty<SelectListItem>();
|
||||
|
||||
public string Heading { get; set; } = string.Empty;
|
||||
|
||||
public string SubmitText { get; set; } = string.Empty;
|
||||
}
|
||||
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;
|
||||
}
|
||||
27
Desktop/hallo/LEA/ViewModels/DashboardViewModel.cs
Normal file
27
Desktop/hallo/LEA/ViewModels/DashboardViewModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
using LEA.Models;
|
||||
|
||||
namespace LEA.ViewModels;
|
||||
|
||||
public class DashboardViewModel
|
||||
{
|
||||
public bool IsAuthenticated { get; set; }
|
||||
|
||||
public string? FullName { get; set; }
|
||||
|
||||
public int TotalApplications { get; set; }
|
||||
|
||||
public int AppliedCount { get; set; }
|
||||
|
||||
public int InterviewCount { get; set; }
|
||||
|
||||
public int OfferCount { get; set; }
|
||||
|
||||
public int RejectedCount { get; set; }
|
||||
|
||||
public IEnumerable<Application> RecentApplications { get; set; } = new List<Application>();
|
||||
|
||||
public IList<MonthlyApplicationStat> MonthlyApplications { get; set; } = new List<MonthlyApplicationStat>();
|
||||
}
|
||||
|
||||
public record MonthlyApplicationStat(string Label, int Count);
|
||||
24
Desktop/hallo/LEA/ViewModels/LoginViewModel.cs
Normal file
24
Desktop/hallo/LEA/ViewModels/LoginViewModel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LEA.ViewModels;
|
||||
|
||||
public class LoginViewModel
|
||||
{
|
||||
[Required(ErrorMessage = "Bitte geben Sie eine E-Mail-Adresse ein.")]
|
||||
[EmailAddress(ErrorMessage = "Bitte eine gültige E-Mail-Adresse eingeben.")]
|
||||
[DataType(DataType.EmailAddress)]
|
||||
[Display(Name = "E-Mail-Adresse")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Bitte geben Sie ein Passwort ein.")]
|
||||
[DataType(DataType.Password)]
|
||||
[Display(Name = "Passwort")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[Display(Name = "Angemeldet bleiben")]
|
||||
public bool RememberMe { get; set; }
|
||||
|
||||
[HiddenInput]
|
||||
public string? ReturnUrl { get; set; }
|
||||
}
|
||||
29
Desktop/hallo/LEA/ViewModels/RegisterViewModel.cs
Normal file
29
Desktop/hallo/LEA/ViewModels/RegisterViewModel.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LEA.ViewModels;
|
||||
|
||||
public class RegisterViewModel
|
||||
{
|
||||
[Required(ErrorMessage = "Bitte geben Sie Ihren vollständigen Namen an.")]
|
||||
[StringLength(100, ErrorMessage = "Der Name darf maximal {1} Zeichen lang sein.")]
|
||||
[Display(Name = "Vollständiger Name")]
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Bitte geben Sie eine E-Mail-Adresse ein.")]
|
||||
[EmailAddress(ErrorMessage = "Bitte eine gültige E-Mail-Adresse eingeben.")]
|
||||
[DataType(DataType.EmailAddress)]
|
||||
[Display(Name = "E-Mail-Adresse")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Bitte geben Sie ein Passwort ein.")]
|
||||
[DataType(DataType.Password)]
|
||||
[StringLength(100, ErrorMessage = "Das Passwort muss mindestens {2} Zeichen enthalten.", MinimumLength = 6)]
|
||||
[Display(Name = "Passwort")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Bitte wiederholen Sie das Passwort.")]
|
||||
[DataType(DataType.Password)]
|
||||
[Compare(nameof(Password), ErrorMessage = "Die Passwörter stimmen nicht überein.")]
|
||||
[Display(Name = "Passwort bestätigen")]
|
||||
public string ConfirmPassword { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user