Merge branch 'master' of 10.0.0.83:/usr/local/git/VirtualTask
This commit is contained in:
commit
908d11abc9
@ -29,7 +29,7 @@ namespace VirtualTask.Controllers
|
||||
|
||||
#region INDEX
|
||||
|
||||
public IActionResult Index(int id, int? page = 1)
|
||||
public IActionResult Index(DateTime dataTimb, string commessa, string tecnico, int? page = 1)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
@ -57,15 +57,30 @@ namespace VirtualTask.Controllers
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Timbratura>>(data);
|
||||
|
||||
if (id != 0)
|
||||
if (dataTimb.Date != DateTime.MinValue)
|
||||
{
|
||||
modelList = modelList.Where(s => s.id == id).ToList();
|
||||
ViewData["CurrentFilter"] = id;
|
||||
modelList = modelList.Where(x => x.data_timbratura.GetValueOrDefault().Date == dataTimb).ToList();
|
||||
}
|
||||
else
|
||||
|
||||
if (!string.IsNullOrEmpty(commessa))
|
||||
{
|
||||
ViewData["CurrentFilter"] = null;
|
||||
modelList = modelList.Where(s => s.commessa.ToLower().Contains(commessa.ToLower())).ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(tecnico))
|
||||
{
|
||||
modelList = modelList.Where(s => s.tecnico.ToLower().Contains(tecnico.ToLower())).ToList();
|
||||
|
||||
}
|
||||
//if (id != 0)
|
||||
//{
|
||||
// modelList = modelList.Where(s => s.id == id).ToList();
|
||||
// ViewData["CurrentFilter"] = id;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// ViewData["CurrentFilter"] = null;
|
||||
//}
|
||||
if (page != null && page < 1)
|
||||
{
|
||||
page = 1;
|
||||
@ -133,7 +148,7 @@ namespace VirtualTask.Controllers
|
||||
|
||||
#region metodi interni
|
||||
|
||||
public IActionResult ExportExcel(int id)
|
||||
public IActionResult ExportExcel(DateTime dataTimb, string commessa, string tecnico)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
@ -161,6 +176,22 @@ namespace VirtualTask.Controllers
|
||||
|
||||
modelList = JsonConvert.DeserializeObject<List<Timbratura>>(data);
|
||||
|
||||
if (dataTimb.Date != DateTime.MinValue)
|
||||
{
|
||||
modelList = modelList.Where(x => x.data_timbratura.GetValueOrDefault().Date == dataTimb).ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(commessa))
|
||||
{
|
||||
modelList = modelList.Where(s => s.commessa.Contains(commessa)).ToList();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(tecnico))
|
||||
{
|
||||
modelList = modelList.Where(s => s.tecnico.Contains(tecnico)).ToList();
|
||||
|
||||
}
|
||||
|
||||
var workbook = new XLWorkbook();
|
||||
workbook.AddWorksheet("sheetName");
|
||||
var ws = workbook.Worksheet("sheetName");
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
ViewData["Title"] = "Listino Virtual Task 2024";
|
||||
}
|
||||
<div>
|
||||
<img src="~/assets/images/immagine1Trasp.png" alt="Virtual Task App" style="width:12%; height:12%; margin-left:50%" />
|
||||
<img src="~/assets/images/virtualTaskTS.png" alt="Virtual Task App" style="width:9%;height:9%" />
|
||||
<img src="~/assets/images/immagine1Trasp.png" alt="Virtual Task App" style="width:12%; height:12%; margin-left:25%"/>
|
||||
<img src="~/assets/images/virtualTaskTS.png" alt="Virtual Task App" style="width:9% ;height:9%; margin-left:25%"/>
|
||||
</div>
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container" style="width:100%; text-align:justify">
|
||||
|
||||
@ -14,22 +14,32 @@
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
@using (Html.BeginForm())
|
||||
@using (Html.BeginForm("Index", "Timbrature"))
|
||||
{
|
||||
<div>
|
||||
<div class="row">
|
||||
<div style="float:left;width:40%;padding:0 10px;">
|
||||
@Html.TextBox("id", null, new { placeholder = "Cerca per id", @class = "agy-form-field require" })
|
||||
</div>
|
||||
<div style="float:left;width:40%;padding:0 20px;">
|
||||
<th><b>Data timbratura:</b></th>
|
||||
@* @Html.TextBox("dataTimb", ViewBag.Timbrature, null, new { @class = "agy-form-field require" }) *@
|
||||
@Html.TextBox("dataTimb", null, new { type = "date", @class = "agy-form-field require" })
|
||||
|
||||
@* <div style="float:left;width:40%;padding:0 20px;"> *@
|
||||
<th><b>Commessa:</b></th>
|
||||
@Html.TextBox("commessa", ViewBag.Timbrature, null, new { @class = "agy-form-field require" })
|
||||
@* </div> *@
|
||||
|
||||
@* <div style="float:left;width:40%;padding:0 20px;"> *@
|
||||
<th><b>Tecnico:</b></th>
|
||||
@Html.TextBox("tecnico", ViewBag.Timbrature, null, new { @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:2%;"> </div>
|
||||
<div style="float:left;width:57%;"><input type="submit" value="Cerca" class="agy-btn submitForm" /></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>
|
||||
}
|
||||
|
||||
<br>
|
||||
@ -38,12 +48,16 @@
|
||||
|
||||
@using (Html.BeginForm("ExportExcel", "Timbrature"))
|
||||
{
|
||||
<div style="float:left;width:40%;padding:0 5px;">
|
||||
@Html.Hidden("dataTimb", ViewBag.Timbrature, null)
|
||||
@Html.Hidden("commessa", ViewBag.Timbrature, null)
|
||||
@Html.Hidden("tecnico", ViewBag.Timbrature, null)
|
||||
|
||||
<div style="float:left;width:40%;padding:0 20px;">
|
||||
<input type="submit" value="Esporta excel" name="Esporta excel" class="agy-btn submitForm" />
|
||||
@* <div style="float:left;width:57%;"><input type="submit" value="Esporta excel" class="agy-btn submitForm" /></div> *@
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user