Michele: DropdownList Giri
This commit is contained in:
parent
9cecad4ec2
commit
fb68e2461e
@ -46,11 +46,15 @@ namespace SoftwayWeb.Controllers
|
|||||||
string dato = response.Content.ReadAsStringAsync().Result;
|
string dato = response.Content.ReadAsStringAsync().Result;
|
||||||
modelList = JsonConvert.DeserializeObject<List<GiriConsegnaView>>(dato);
|
modelList = JsonConvert.DeserializeObject<List<GiriConsegnaView>>(dato);
|
||||||
|
|
||||||
|
ViewBag.CodAutista = getAutisti();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(codAutista))
|
if (!string.IsNullOrEmpty(codAutista))
|
||||||
{
|
{
|
||||||
modelList = modelList.Where(x => x.CodAutista.Contains(codAutista)).ToList();
|
modelList = modelList.Where(x => x.CodAutista.Contains(codAutista)).ToList();
|
||||||
|
|
||||||
ViewData["CurrentFilter"] = codAutista;
|
ViewData["CurrentFilter"] = codAutista;
|
||||||
|
|
||||||
|
//ViewBag.Autista = codAutista;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -62,14 +66,6 @@ namespace SoftwayWeb.Controllers
|
|||||||
modelList = modelList.Where(x => x.DataGiro.GetValueOrDefault().Date == data.Date).ToList();
|
modelList = modelList.Where(x => x.DataGiro.GetValueOrDefault().Date == data.Date).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (aperto)
|
|
||||||
//{
|
|
||||||
// modelList = modelList.Where(x => x.DataChiusura == null).ToList();
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// modelList = modelList.Where(x => x.DataChiusura != null).ToList();
|
|
||||||
//}
|
|
||||||
var shortList = modelList.ToPagedList();
|
var shortList = modelList.ToPagedList();
|
||||||
return View(shortList/*modelList*/);
|
return View(shortList/*modelList*/);
|
||||||
}
|
}
|
||||||
@ -120,6 +116,7 @@ namespace SoftwayWeb.Controllers
|
|||||||
string e = helper.GetStringValue("errMsg");
|
string e = helper.GetStringValue("errMsg");
|
||||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e });
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e });
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SelectListItem> getAutisti()
|
private List<SelectListItem> getAutisti()
|
||||||
{
|
{
|
||||||
SessionHelper helper = new SessionHelper(this);
|
SessionHelper helper = new SessionHelper(this);
|
||||||
|
|||||||
@ -26,7 +26,9 @@
|
|||||||
|
|
||||||
@using (Html.BeginForm())
|
@using (Html.BeginForm())
|
||||||
{
|
{
|
||||||
<div>@Html.TextBox("codAutista", null, new { placeholder = "Codice autista", @class = "agy-form-field require" })</div>
|
@* <div>@Html.TextBox("codAutista", null, new { placeholder = "Codice autista", @class = "agy-form-field require" })</div> *@
|
||||||
|
<div>@Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })</div>
|
||||||
|
@* <div>@Html.DropDownListFor(x => x., (IEnumerable<SelectListItem>)ViewBag.Autisti, new { @class = "agy-form-field require" })</div> *@
|
||||||
<br />
|
<br />
|
||||||
<div>@Html.TextBox("data", null, new { type = "date", @class = "agy-form-field require" })</div>
|
<div>@Html.TextBox("data", null, new { type = "date", @class = "agy-form-field require" })</div>
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user