filtri chiamate

This commit is contained in:
Marco Audiffredi 2024-09-24 11:51:21 +02:00
parent a5ad8321e3
commit 1eaab73937
3 changed files with 30 additions and 24 deletions

View File

@ -89,7 +89,7 @@ namespace VirtualTask.Controllers
if (!string.IsNullOrEmpty(tecnico))
{
modelList = modelList.Where(s => s.chtchiam.Contains(tecnico)).ToList();
modelList = modelList.Where(s => s.chtchiam !=null && s.chtchiam.Contains(tecnico)).ToList();
ViewData["CurrentFilter"] = tecnico;

View File

@ -68,7 +68,7 @@ namespace VirtualTask.Controllers
if (!string.IsNullOrEmpty(searchString))
{
modelList = modelList.Where(s => s.andescri.ToUpper().Contains(searchString.ToUpper())).ToList();
modelList = modelList.Where(s => s.andescri!=null && s.andescri.ToUpper().Contains(searchString.ToUpper())).ToList();
ViewData["CurrentFilter"] = searchString;
}

View File

@ -18,32 +18,38 @@
@using (Html.BeginForm("Index","Chiamate"))
{
<div>
<div style="float:left;width:40%;padding:0 20px;">
<th><b>Tecnico:</b></th>
<div style="width:100%">
<div style="float:left;width:33%;padding:0 20px;">
<b>Tecnico:</b>
@Html.DropDownList("tecnico", ViewBag.Tecnici, null, new { @class = "agy-form-field require" })
<th><b>Impianto:</b></th>
</div>
<div style="float:left;width:33%;padding:0 20px;">
<b>Impianto:</b>
@Html.DropDownList("impianto", ViewBag.Impianti, null, new { @class = "agy-form-field require" })
<th><b>Data da:</b></th>
@Html.TextBox("dataIni", null, new { type = "date", @class = "agy-form-field require" })
<th><b>Data a:</b></th>
@Html.TextBox("dataFin", null, new { type = "date", @class = "agy-form-field require" })
<th><b>Stato chiamata:</b></th>
@Html.DropDownList("stato", ViewBag.StatiChiamata, null, new { @class = "agy-form-field require" })
<th><b>Indirizzo:</b></th>
<div>
@Html.TextBox("indirizzo", null, new { placeholder = "Cerca per indirizzo", @class = "agy-form-field require" })
</div>
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
</div>
<div style="float:left;width:33%;padding:0 20px;">
<b>Indirizzo:</b>
<div>
@Html.TextBox("indirizzo", null, new { placeholder = "Cerca per indirizzo impianto", @class = "agy-form-field require" })
</div>
</div>
<div style="float:left;width:25%;padding:0 20px;">
<b>Data da:</b>
@Html.TextBox("dataIni", null, new { type = "date", @class = "agy-form-field require" })
</div>
<div style="float:left;width:25%;padding:0 20px;">
<b>Data a:</b>
@Html.TextBox("dataFin", null, new { type = "date", @class = "agy-form-field require" })
</div>
<div style="float:left;width:25%;padding:0 20px;">
<b>Stato chiamata:</b>
@Html.DropDownList("stato", ViewBag.StatiChiamata, null, new { @class = "agy-form-field require" })
</div>
<div style="float:left;width:24%;padding:18px 0px;">
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
</div>
<div style="float:left;width:2%;">&nbsp;</div>
<div style="float:left;width:2%;">&nbsp;</div>
<div style="float:left;width:2%;">&nbsp;</div>