filtro data

This commit is contained in:
michele 2024-06-25 09:05:26 +02:00
parent 1219ed236c
commit cf4fc2c05b

View File

@ -23,7 +23,7 @@ namespace SoftwayWeb.Controllers
apiUrl = key; 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); helper = new SessionHelper(this);
token = helper.GetStringValue("tok"); token = helper.GetStringValue("tok");
@ -51,6 +51,11 @@ namespace SoftwayWeb.Controllers
{ {
ViewData["CurrentFilter"] = null; ViewData["CurrentFilter"] = null;
} }
if (data.Date != DateTime.MinValue)
{
modelList = modelList.Where(x => x.DataGiro.GetValueOrDefault().Date == data.Date).ToList();
}
//var shortList = modelList.ToPagedList(); //var shortList = modelList.ToPagedList();
return View(modelList); return View(modelList);
} }