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