Michele: addDestinazione - modificata view con data autista e mezzo che prende valori dai giri.
Modifcato controller Index giri - aggiunti parametri a a bottone aggiungi nuova destinazione
This commit is contained in:
parent
2467c7b3bd
commit
43b8cf0ae5
@ -27,9 +27,8 @@ namespace SoftwayWeb.Controllers
|
||||
apiUrl = key;
|
||||
}
|
||||
|
||||
public IActionResult AddDestinazione(string serialeGiro)
|
||||
public IActionResult AddDestinazione(string serialeGiro, string? codAutista, string? nomeAutista, string? codMezzo, string? desMezzo, DateTime dataGiro)
|
||||
{
|
||||
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
token = helper.GetStringValue("tok");
|
||||
@ -43,13 +42,19 @@ namespace SoftwayWeb.Controllers
|
||||
ViewBag.serialeGiro = serialeGiro;
|
||||
model.Pisergir = serialeGiro;
|
||||
ViewBag.Commit = getCommittenti();
|
||||
ViewBag.CodAutista = getAutisti();
|
||||
ViewBag.Mezzi = getMezzi();
|
||||
ViewBag.CodAutista = codAutista;
|
||||
model.Piautist = codAutista;
|
||||
ViewBag.Autista = nomeAutista;
|
||||
ViewBag.CodMezzo = codMezzo;
|
||||
model.Pitarga = codMezzo;
|
||||
ViewBag.Automezzo = desMezzo;
|
||||
ViewBag.dataGiro = dataGiro.ToString("dd/MM/yyyy");
|
||||
model.Pidata = dataGiro;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
public IActionResult NewDestinazione(Modgir modgir, string? autista, string? mezzo, string id)
|
||||
public IActionResult NewDestinazione(Modgir modgir /*,string? codAutista, string? codMezzo, DateTime dataGiro, string serGiro*/)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
@ -63,16 +68,15 @@ namespace SoftwayWeb.Controllers
|
||||
//qui metodo post per scrivere su pimodgir
|
||||
Modgir mg = new Modgir();
|
||||
|
||||
//mg.Piprogre = modgir.Piprogre;
|
||||
mg.Piserial = string.Empty;
|
||||
mg.Pidata = modgir.Pidata;
|
||||
mg.Picommit = modgir.Picommit;
|
||||
mg.Pidesdiv = modgir.Pidesdiv;
|
||||
mg.Pitarga = mezzo.TrimEnd();
|
||||
mg.Piautist = autista.TrimEnd();
|
||||
mg.Pitarga = modgir.Pitarga;
|
||||
mg.Piautist = modgir.Piautist.TrimEnd();
|
||||
mg.Pitiprec = "A";
|
||||
mg.Pirigele = string.Empty;
|
||||
mg.Pisergir = id;
|
||||
mg.Pisergir = modgir.Pisergir;
|
||||
mg.Picasse = modgir.Picasse;
|
||||
mg.Pitrasf = modgir.Pitrasf;
|
||||
mg.Picolli = modgir.Picolli;
|
||||
@ -102,7 +106,6 @@ namespace SoftwayWeb.Controllers
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
//return View();
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
@ -249,7 +252,7 @@ namespace SoftwayWeb.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Cascading(string Picommit/*ancodice*/)
|
||||
public IActionResult Cascading(string Picommit)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
Cascading model = new Cascading();
|
||||
@ -289,11 +292,9 @@ namespace SoftwayWeb.Controllers
|
||||
listItem.Value = sede.Pccodsed;
|
||||
listItem.Text = s;
|
||||
selectItems.Add(listItem);
|
||||
//model.SediCons.Add(listItem);
|
||||
model.SediCons.Add(listItem);
|
||||
}
|
||||
//model.SediCons.AddRange(selectItems);
|
||||
// ViewBag.SediCons = sediCons;
|
||||
|
||||
}
|
||||
}
|
||||
return Json(new SelectList(selectItems, "Value", "Text"));
|
||||
|
||||
@ -13,6 +13,14 @@
|
||||
|
||||
<h1>Aggiungi una nuova destinazione</h1>
|
||||
|
||||
<p>
|
||||
<b>Data giro: @ViewBag.dataGiro</b>
|
||||
|
||||
<br />
|
||||
<b>Autista: @ViewBag.CodAutista - @ViewBag.Autista</b>
|
||||
<br />
|
||||
<b>Automezzo: @ViewBag.CodMezzo - @ViewBag.Automezzo</b>
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl">
|
||||
@ -38,25 +46,6 @@
|
||||
@Html.DropDownListFor(x => x.Pidesdiv, new List<SelectListItem>(), "- Seleziona sede", new { @id = "ddlSediCons", @class = "agy-form-field require" })
|
||||
</div>
|
||||
<span asp-validation-for="Pidesdiv" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<b><label asp-for="Pidata" class="control-label"></label></b>
|
||||
<input asp-for="Pidata" class="form-control" />
|
||||
<span asp-validation-for="Pidata" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<b><label asp-for="Piautist" class="control-label"></label></b>
|
||||
<div>
|
||||
@Html.DropDownList("autista",ViewBag.CodAutista, null, new { @class = "agy-form-field require" })
|
||||
</div>
|
||||
<span asp-validation-for="Piautist" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<b><label asp-for="Pitarga" class="control-label"></label></b>
|
||||
<div>
|
||||
@Html.DropDownList("mezzo",ViewBag.Mezzi, null, new { @class = "agy-form-field require" })
|
||||
</div>
|
||||
<span asp-validation-for="Pitarga" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<b><label asp-for="Picasse" class="control-label"></label></b>
|
||||
@ -94,13 +83,22 @@
|
||||
<span asp-validation-for="Piseq" class="text-danger"></span>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@Html.HiddenFor(x => x.Pidata)
|
||||
@Html.HiddenFor(x=> x.Piautist)
|
||||
@Html.HiddenFor(x => x.Pitarga)
|
||||
@Html.HiddenFor(x => x.Piprogre)
|
||||
@Html.HiddenFor(x => x.Piserial)
|
||||
@Html.HiddenFor(x => x.Pitiprec)
|
||||
@Html.HiddenFor(x => x.Pisergir)
|
||||
|
||||
<input type="submit" asp-action="NewDestinazione" asp-controller="AddDestinazione" asp-route-id="@Model.Pisergir" value="Salva modifiche" class="btn btn-primary" />
|
||||
@* <input type="submit" asp-action="NewDestinazione" asp-controller="AddDestinazione"
|
||||
asp-route-serGiro="@Model.Pisergir"
|
||||
asp-route-codMezzo="@Model.Pitarga"
|
||||
asp-route-codAutista="@Model.Piautist"
|
||||
asp-route-dataGiro="@Model.Pidata"
|
||||
value="Salva modifiche" class="btn btn-primary" /> *@
|
||||
|
||||
<input type="submit" asp-action="NewDestinazione" asp-controller="AddDestinazione" value="Salva modifiche" class="btn btn-primary" />
|
||||
<a asp-action="Index" asp-controller="Giri" value="Torna alla lista" class="btn btn-primary">Torna alla lista</a>
|
||||
</div>
|
||||
|
||||
|
||||
@ -126,7 +126,12 @@
|
||||
nomeMezzo = item.Automezzo,
|
||||
dataGiroCons = item.DataGiro@* id=item.SerialeGiro,nbanc=item.parzialeBanRec,imp=item.parzialeImpRec *@ })" title="Modifica tutte le destinazioni" class="links"><img alt="Modifica Tutte" src="@Url.Content("~/images/system.png")" style="width:24px;height:24px;">
|
||||
</a>
|
||||
<a href="@Url.ActionLink("AddDestinazione", "AddDestinazione", new{serialeGiro = item.SerialeGiro})" title="Aggiungi nuova destinazione" class="links"><img alt="Aggiungi nuova destinazione" src="@Url.Content("~/images/addBtn.png")" style="width:25px;height:25px;"></a>
|
||||
<a href="@Url.ActionLink("AddDestinazione", "AddDestinazione", new{serialeGiro = item.SerialeGiro,
|
||||
codAutista=item.CodAutista,
|
||||
nomeAutista=item.Autista,
|
||||
dataGiro=item.DataGiro,
|
||||
codMezzo=item.CodMezzo,
|
||||
desMezzo=item.Automezzo})" title="Aggiungi nuova destinazione" class="links"><img alt="Aggiungi nuova destinazione" src="@Url.Content("~/images/addBtn.png")" style="width:25px;height:25px;"></a>
|
||||
@if (item.BancaliCaricati == null)
|
||||
{
|
||||
<img alt="noBancali" src="@Url.Content("~/images/alert.png")" style="width:23px;height:23px;">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user