From 4f80f7d09819c6993864dbf084da54366f73cfda Mon Sep 17 00:00:00 2001 From: sboulema Date: Sat, 22 Jun 2024 11:20:53 +0200 Subject: [PATCH] Add isHidden, status, license plates --- src/Models/ViewModels/PersonViewModel.cs | 6 ++++++ src/Services/StreetBookService.cs | 3 ++- src/Views/Shared/_Layout.cshtml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Models/ViewModels/PersonViewModel.cs b/src/Models/ViewModels/PersonViewModel.cs index 21add4a..6f5f598 100644 --- a/src/Models/ViewModels/PersonViewModel.cs +++ b/src/Models/ViewModels/PersonViewModel.cs @@ -18,6 +18,12 @@ public class PersonViewModel public string Name => $"{FirstName}{(!string.IsNullOrEmpty(LastName) ? $" {LastName}" : string.Empty)}"; public bool IsDisabled { get; set; } + + public bool IsHidden { get; set; } + + public string Status { get; set; } = string.Empty; + + public List LicensePlates { get; set; } = []; } [JsonSerializable(typeof(PersonViewModel))] diff --git a/src/Services/StreetBookService.cs b/src/Services/StreetBookService.cs index 54ef6f5..989f063 100644 --- a/src/Services/StreetBookService.cs +++ b/src/Services/StreetBookService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text.Json; using Microsoft.Extensions.Hosting; using StreetBook.Models.ViewModels; @@ -29,7 +30,7 @@ public StreetBookViewModel GetStreetBook() return new() { - Persons = people + Persons = people.Where(people => !people.IsHidden).ToList(), }; } } diff --git a/src/Views/Shared/_Layout.cshtml b/src/Views/Shared/_Layout.cshtml index 60cb5fa..31a8798 100644 --- a/src/Views/Shared/_Layout.cshtml +++ b/src/Views/Shared/_Layout.cshtml @@ -29,7 +29,7 @@
- © 2023 : StreetBook + © 2023 - 2024 : StreetBook