From 461d23d67d5531c024710f03e64f2095904aec1e Mon Sep 17 00:00:00 2001
From: Marco Audiffredi >(dato);
+ modelList = modelList.Where(x => x.serialeGiro == id).OrderBy(x => x.Seq).ThenBy(x => x.Committente).ToList();
+
+ if (page != null && page < 1)
+ {
+ page = 1;
+ }
+
+ var pageSize = 10;
+
+ var shortList = modelList.ToPagedList(page ?? 1, pageSize);
+
+ return View(shortList);
+ }
+ else
+ {
+ errMes = response.Content.ReadAsStringAsync().Result;
+ helper.SetStringValue("errMsg", errMes);
+ return RedirectToAction("Error");
+ }
+
}
public IActionResult EliminaDestinazione(string serial)
diff --git a/Controllers/GiriDaValidareController.cs b/Controllers/GiriDaValidareController.cs
index cabe568..139e559 100644
--- a/Controllers/GiriDaValidareController.cs
+++ b/Controllers/GiriDaValidareController.cs
@@ -57,19 +57,19 @@ namespace SoftwayWeb.Controllers
string _filtro= helper.GetStringValue("filterData");
- if (data == DateTime.MinValue && string.IsNullOrEmpty(_filtro))
+ if (data == DateTime.MinValue && string.IsNullOrEmpty(_filtro) && modelList.Count()>0)
{
var last = modelList.OrderByDescending(t => t.DataGiro).Take(1).First();
modelList = modelList.Where(x => x.DataGiro == last.DataGiro).ToList();
}
- if (data == DateTime.MinValue && !string.IsNullOrEmpty(_filtro))
+ if (data == DateTime.MinValue && !string.IsNullOrEmpty(_filtro) && modelList.Count() > 0)
{
DateTime dataFiltro=Convert.ToDateTime(_filtro);
ViewBag.Filtro = Convert.ToString(_filtro);
modelList = modelList.Where(x => x.DataGiro == dataFiltro).ToList();
}
- if (data != DateTime.MinValue )
+ if (data != DateTime.MinValue && modelList.Count() > 0)
{
helper.SetStringValue("filterData", Convert.ToString( data));
ViewBag.Filtro = data.ToString("dd/MM/yyyy");
diff --git a/Views/Destinazioni/Index.cshtml b/Views/Destinazioni/Index.cshtml
index 45b901e..ecefe8c 100644
--- a/Views/Destinazioni/Index.cshtml
+++ b/Views/Destinazioni/Index.cshtml
@@ -19,7 +19,7 @@
Automezzo: @ViewBag.CodMezzo - @ViewBag.Automezzo
+ Data giro: @ViewBag.dataGiro
+
+ Autista: @ViewBag.CodAutista - @ViewBag.Autista
+
+ Automezzo: @ViewBag.CodMezzo - @ViewBag.Automezzo
+
| *@ + | S. | +Committente | +Sede | +Indirizzo sede | +Ca. | +Tr. | +Co. | +Nr.Co. | +Uo | +Ci. | +Note | +Bc - Bs | ++ | + |
+ | *@
+ }
+
+ |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
+ @Html.HiddenFor(modelItem => item.ConsFatta.consFattaFlagCons)
+
+ @if (item.ConsFatta.consFattaFlagCons!=null && item.ConsFatta.consFattaFlagCons.Contains("S"))
+ {
+ |
+ }
+ else
+ {
+
+ |
+ }*@
+
+
+ @Html.DisplayFor(modelItem => item.Seq) | +@Html.DisplayFor(modelItem => item.Committente) | +@*@Html.DisplayFor(modelItem => item.CodSede) - *@@Html.DisplayFor(modelItem => item.Sede) | +@Html.DisplayFor(modelItem => item.IndirizzoSede) | + @if (item.Casse != null && item.Casse > 0) + { + int icasse = 0; + icasse = Convert.ToInt32(item.Casse); ++ @icasse + | + } + else + { ++ } + @if (item.Trasf != null && item.Trasf > 0) + { + | + @Html.DisplayFor(modelItem => item.Trasf) + | + } + else + { ++ } + @if (item.Colli != null && item.Colli > 0) + { + int icolli = 0; + icolli = Convert.ToInt32(item.Colli); + | + @icolli + | + } + else + { ++ } + @if (item.num_cons != null && item.num_cons > 0) + { + | + @Html.DisplayFor(modelItem => item.num_cons) + | + } + else + { ++ } + @if (item.Uova != null && item.Uova > 0) + { + | + @Html.DisplayFor(modelItem => item.Uova) + | + } + else + { ++ } + @if (item.Cist != null && item.Cist > 0) + { + | + @Html.DisplayFor(modelItem => item.Cist) + | + } + else + { ++ } + + | + @Html.DisplayFor(modelItem => item.Note) + | + + @if (item.ConsFatta != null && item.ConsFatta.consFattaBanCar != null && item.ConsFatta.consFattaBanSca!=null) + { + diffBancali = item.ConsFatta.consFattaBanCar.Value - item.ConsFatta.consFattaBanSca.Value; + ++ @diffBancali + | + } + else + { ++ } + @if (item.ConsFatta == null) + { + |
+ @if (!string.IsNullOrEmpty(item.Prog))
+ {
+ |
+
+ |
+ }
+ else
+ {
+ + | + } + + |