Michele: modifica ricerca estrazione rapportini + Template
This commit is contained in:
parent
baebbfb634
commit
84beb51404
@ -36,7 +36,7 @@ namespace VirtualTask.Controllers
|
|||||||
|
|
||||||
#region INDEX
|
#region INDEX
|
||||||
|
|
||||||
public IActionResult Index(string impianto, int? page = 1)
|
public IActionResult Index(string impianto, DateTime dataIni, DateTime dataFin, int? page = 1)
|
||||||
{
|
{
|
||||||
SessionHelper helper = new SessionHelper(this);
|
SessionHelper helper = new SessionHelper(this);
|
||||||
token = helper.GetStringValue("tok");
|
token = helper.GetStringValue("tok");
|
||||||
@ -75,6 +75,15 @@ namespace VirtualTask.Controllers
|
|||||||
else
|
else
|
||||||
ViewData["CurrentFilter"] = null;
|
ViewData["CurrentFilter"] = null;
|
||||||
|
|
||||||
|
if (!dataFin.ToString().Substring(0, 10).Equals("01/01/0001"))
|
||||||
|
{
|
||||||
|
modelList = modelList.Where(x => x.data_rapportino.GetValueOrDefault().Date >= dataIni.Date && x.data_rapportino.GetValueOrDefault().Date <= dataFin.Date).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
modelList = modelList.Where(x => x.data_rapportino.GetValueOrDefault().Date >= dataIni.Date).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
if (page != null && page < 1)
|
if (page != null && page < 1)
|
||||||
{
|
{
|
||||||
page = 1;
|
page = 1;
|
||||||
@ -128,9 +137,7 @@ namespace VirtualTask.Controllers
|
|||||||
|
|
||||||
modelList = JsonConvert.DeserializeObject<List<Rapportini>>(data);
|
modelList = JsonConvert.DeserializeObject<List<Rapportini>>(data);
|
||||||
|
|
||||||
ViewData["CurrentFilter"] = impianto;
|
if (impianto != null)
|
||||||
|
|
||||||
if (!impianto.Equals("System.Collections.Generic.List`1[Microsoft.AspNetCore.Mvc.Rendering.SelectListItem]")/* || impianto != null*/)
|
|
||||||
{
|
{
|
||||||
modelList = modelList.Where(x => x.codice_impianto.Equals(impianto)).ToList();
|
modelList = modelList.Where(x => x.codice_impianto.Equals(impianto)).ToList();
|
||||||
}
|
}
|
||||||
@ -148,7 +155,6 @@ namespace VirtualTask.Controllers
|
|||||||
workbook.AddWorksheet("sheetName");
|
workbook.AddWorksheet("sheetName");
|
||||||
var ws = workbook.Worksheet("sheetName");
|
var ws = workbook.Worksheet("sheetName");
|
||||||
|
|
||||||
|
|
||||||
int col = 1;
|
int col = 1;
|
||||||
|
|
||||||
//Scrivo intestazioni colonne
|
//Scrivo intestazioni colonne
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -20,11 +19,24 @@
|
|||||||
<div style="float:left;width:40%;padding:0 20px;">
|
<div style="float:left;width:40%;padding:0 20px;">
|
||||||
<th><b>Impianto:</b></th>
|
<th><b>Impianto:</b></th>
|
||||||
@Html.DropDownList("impianto", ViewBag.Rapportini, null, new { @class = "agy-form-field require" })
|
@Html.DropDownList("impianto", ViewBag.Rapportini, null, new { @class = "agy-form-field require" })
|
||||||
|
|
||||||
|
@* <div style="float:left;width:40%;padding:0 20px;"> *@
|
||||||
|
<th><b>Data da:</b></th>
|
||||||
|
@Html.TextBox("dataIni", null, new { type = "date", @class = "agy-form-field require" })
|
||||||
|
@* </div> *@
|
||||||
|
|
||||||
|
@* <div style="float:left;width:40%;padding:0 20px;"> *@
|
||||||
|
<th><b>Data a:</b></th>
|
||||||
|
@Html.TextBox("dataFin", null, new { type = "date", @class = "agy-form-field require" })
|
||||||
|
@* </div> *@
|
||||||
|
|
||||||
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
|
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="float:left;width:2%;"> </div>
|
<div style="float:left;width:2%;"> </div>
|
||||||
<div style="float:left;width:2%;"> </div>
|
<div style="float:left;width:2%;"> </div>
|
||||||
<div style="float:left;width:2%;"> </div>
|
<div style="float:left;width:2%;"> </div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,20 +46,10 @@
|
|||||||
|
|
||||||
@using (Html.BeginForm("ExportDataToExcel", "Rapportini"))
|
@using (Html.BeginForm("ExportDataToExcel", "Rapportini"))
|
||||||
{
|
{
|
||||||
<div style="float:left;width:40%;padding:0 20px;">
|
@Html.Hidden("dataIni", ViewBag.Rapportini, null)
|
||||||
<th><b>Data da:</b></th>
|
@Html.Hidden("dataFin", ViewBag.Rapportini, null)
|
||||||
@Html.TextBox("dataIni", null, new { type = "date", @class = "agy-form-field require" })
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="float:left;width:40%;padding:0 20px;">
|
|
||||||
<th><b>Data a:</b></th>
|
|
||||||
@Html.TextBox("dataFin", null, new { type = "date", @class = "agy-form-field require" })
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@Html.Hidden("impianto", ViewBag.Rapportini, null)
|
@Html.Hidden("impianto", ViewBag.Rapportini, null)
|
||||||
|
|
||||||
@* @Html.Hiddenfor(x => x.codice) *@
|
|
||||||
|
|
||||||
<div style="float:left;width:40%;padding:0 20px;">
|
<div style="float:left;width:40%;padding:0 20px;">
|
||||||
<input type="submit" value="Esporta excel" name="Esporta excel" class="agy-btn submitForm" />
|
<input type="submit" value="Esporta excel" name="Esporta excel" class="agy-btn submitForm" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -174,7 +174,7 @@ Purchase:
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="agy-search-wrapper menu-btn-wrap">
|
@* <div class="agy-search-wrapper menu-btn-wrap">
|
||||||
<ul class="display-flex">
|
<ul class="display-flex">
|
||||||
<li><a href="javascript:void(0);" class="agy-search-btn searchBtn"><i class="fa-solid fa-magnifying-glass"></i></a></li>
|
<li><a href="javascript:void(0);" class="agy-search-btn searchBtn"><i class="fa-solid fa-magnifying-glass"></i></a></li>
|
||||||
<li><a href="contact.html" class="agy-btn white">Get A Quote</a></li>
|
<li><a href="contact.html" class="agy-btn white">Get A Quote</a></li>
|
||||||
@ -186,7 +186,7 @@ Purchase:
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div> *@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -150,7 +150,7 @@ Purchase:
|
|||||||
<li><a href="@Url.Action("Login2", "Login")">Accedi</a></li>
|
<li><a href="@Url.Action("Login2", "Login")">Accedi</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="agy-search-wrapper menu-btn-wrap">
|
@* <div class="agy-search-wrapper menu-btn-wrap">
|
||||||
<ul class="display-flex">
|
<ul class="display-flex">
|
||||||
<li><a href="javascript:void(0);" class="agy-search-btn searchBtn"><i class="fa-solid fa-magnifying-glass"></i></a></li>
|
<li><a href="javascript:void(0);" class="agy-search-btn searchBtn"><i class="fa-solid fa-magnifying-glass"></i></a></li>
|
||||||
<li><a href="contact.html" class="agy-btn white">Get A Quote</a></li>
|
<li><a href="contact.html" class="agy-btn white">Get A Quote</a></li>
|
||||||
@ -162,7 +162,7 @@ Purchase:
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div> *@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user