diff --git a/Controllers/RapportiniController.cs b/Controllers/RapportiniController.cs index 1997484..71b7313 100644 --- a/Controllers/RapportiniController.cs +++ b/Controllers/RapportiniController.cs @@ -137,19 +137,33 @@ namespace VirtualTask.Controllers modelList = JsonConvert.DeserializeObject>(data); - if (impianto != null) + if (string.IsNullOrEmpty(impianto)) { - modelList = modelList.Where(x => x.codice_impianto.Equals(impianto)).ToList(); + impianto = "- Impianto"; } - if (!dataFin.ToString().Substring(0, 10).Equals("01/01/0001")) + if (impianto.Equals("System.Collections.Generic.List`1[Microsoft.AspNetCore.Mvc.Rendering.SelectListItem]") || impianto.Equals("- Impianto")) { - modelList = modelList.Where(x => x.data_rapportino.GetValueOrDefault().Date >= dataIni.Date && x.data_rapportino.GetValueOrDefault().Date <= dataFin.Date).ToList(); + modelList = modelList; } else { - modelList = modelList.Where(x => x.data_rapportino.GetValueOrDefault().Date >= dataIni.Date).ToList(); + if (impianto != null) + { + modelList = modelList.Where(x => x.codice_impianto.Equals(impianto)).ToList(); + } + + 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(); + } } + var workbook = new XLWorkbook(); workbook.AddWorksheet("sheetName"); diff --git a/appsettings.json b/appsettings.json index 479c6ab..731e025 100644 --- a/appsettings.json +++ b/appsettings.json @@ -7,14 +7,14 @@ }, "ApplicationInsights": { //PRODUZIONE - //"rootUrlApi": "https://api.poloinformatico.it:9000/api/Polo/", - //"rootWebLoghi": "C:\\ZAPIPOLO\\api_polo\\wwwroot\\VIRTU\\", - //"rootUrlApi2": "https://api.poloinformatico.it:9000/VIRTU/", + "rootUrlApi": "https://api.poloinformatico.it:9000/api/Polo/", + "rootWebLoghi": "C:\\ZAPIPOLO\\api_polo\\wwwroot\\VIRTU\\", + "rootUrlApi2": "https://api.poloinformatico.it:9000/VIRTU/", //TEST - "rootUrlApi": "http://testapi.poloinformatico.it:9001/api/Polo/", - "rootWebLoghi": "C:\\SORGENTI\\ApiPolo\\ApiPolo\\wwwroot\\VIRTU\\", - "rootUrlApi2": "http://testapi.poloinformatico.it:9001/VIRTU/", + //"rootUrlApi": "http://testapi.poloinformatico.it:9001/api/Polo/", + //"rootWebLoghi": "C:\\SORGENTI\\ApiPolo\\ApiPolo\\wwwroot\\VIRTU\\", + //"rootUrlApi2": "http://testapi.poloinformatico.it:9001/VIRTU/", "mittenteMail": "info@virtualtask.it", "nomeMail": "Supporto Virtual Task",