From cf4fc2c05b0c99db098761f987920f4b3b7eb242 Mon Sep 17 00:00:00 2001 From: michele Date: Tue, 25 Jun 2024 09:05:26 +0200 Subject: [PATCH] filtro data --- Controllers/GiriController.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Controllers/GiriController.cs b/Controllers/GiriController.cs index b342eaa..beda4a5 100644 --- a/Controllers/GiriController.cs +++ b/Controllers/GiriController.cs @@ -23,7 +23,7 @@ namespace SoftwayWeb.Controllers apiUrl = key; } - public IActionResult Index(string? codAutista, DateTime? data, bool aperto = true) + public IActionResult Index(string? codAutista, DateTime data, bool aperto = true) { helper = new SessionHelper(this); token = helper.GetStringValue("tok"); @@ -51,6 +51,11 @@ namespace SoftwayWeb.Controllers { ViewData["CurrentFilter"] = null; } + + if (data.Date != DateTime.MinValue) + { + modelList = modelList.Where(x => x.DataGiro.GetValueOrDefault().Date == data.Date).ToList(); + } //var shortList = modelList.ToPagedList(); return View(modelList); }