parziali bancali e importi

This commit is contained in:
Marco Audiffredi 2024-07-09 12:47:45 +02:00
parent 700dc5317e
commit 0e044a46f6
11 changed files with 55 additions and 112 deletions

View File

@ -145,31 +145,34 @@ namespace SoftwayWeb.Controllers
}
return RedirectToAction("Index", "Giri");
}
[HttpPost]
public IActionResult Create(GiriConsegnaView model)
{
SessionHelper helper = new SessionHelper(this);
ViewBag.Autisti = getAutisti();
apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/addGiro2";
Uri baseAddress = new Uri(urlBase);
client = new HttpClient();
client.BaseAddress = baseAddress;
string data = JsonConvert.SerializeObject(model);
StringContent content = new StringContent(data, Encoding.UTF8, "application/json");
HttpResponseMessage response = client.PostAsync(baseAddress, content).Result;
if (response.IsSuccessStatusCode)
{
return RedirectToAction("Index", "Giri");
}
else
{
errMes = response.Content.ReadAsStringAsync().Result;
helper.SetStringValue("errMsg", errMes);
return RedirectToAction("Error");
}
}
//[HttpPost]
//public IActionResult Create(GiriConsegnaView model)
//{
// SessionHelper helper = new SessionHelper(this);
// ViewBag.Autisti = getAutisti();
// apiUrl = helper.GetStringValue("apiUrl");
// urlBase = apiUrl + "Giri/addGiro2";
// Uri baseAddress = new Uri(urlBase);
// client = new HttpClient();
// client.BaseAddress = baseAddress;
// string data = JsonConvert.SerializeObject(model);
// StringContent content = new StringContent(data, Encoding.UTF8, "application/json");
// HttpResponseMessage response = client.PostAsync(baseAddress, content).Result;
// if (response.IsSuccessStatusCode)
// {
// return RedirectToAction("Index", "Giri");
// }
// else
// {
// errMes = response.Content.ReadAsStringAsync().Result;
// helper.SetStringValue("errMsg", errMes);
// return RedirectToAction("Error");
// }
//}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{

View File

@ -36,5 +36,10 @@ namespace SoftwayWeb.Models
public string? CodMezzo { get; set; }
public string? Automezzo { get; set; }
public int? parzialeBanRec { get; set; }
[System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 5)")]
public decimal? parzialeImpRec { get; set; }
}
}

View File

@ -8,47 +8,7 @@
<div class="agy-project-wrapper agy-project-page-wrapper">
<div class="container">
<div class="row">
@* <div class="row">
<div class="col-md-8">
<form asp-action="Create">
<div class="form-group" style="width: 40%;">
<h5><label asp-for="CodAutista" class="agy-client-quote"></label></h5>
@Html.DropDownListFor(x => x.CodAutista, (IEnumerable<SelectListItem>)ViewBag.Autisti, new { @class = "agy-form-field require" })
<span asp-validation-for="CodAutista" class="text-danger"></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div class="form-group" style="width: 40%;">
<h5><label asp-for="DataGiro" class="agy-client-quote"></label></h5>
@Html.TextBox("DataGiro", null, new { type = "date", @class = "agy-form-field require" })
<span asp-validation-for="DataGiro" class="text-danger"></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div class="form-group" style="width: 40%;">
<h5><label asp-for="ImportoDaRecuperare" class="agy-client-quote"></label></h5>
<input asp-for="ImportoDaRecuperare" class="agy-form-field require" placeholder="Importo Da Recuperare" />
<span asp-validation-for="ImportoDaRecuperare" class="text-danger"></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div class="form-group" style="width: 40%;">
<h5><label asp-for="BancaliCaricati" class="agy-client-quote"></label></h5>
<input asp-for="BancaliCaricati" class="agy-form-field require" placeholder="Bancali Caricati" />
<span asp-validation-for="BancaliCaricati" class="text-danger"></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div class="form-group" style="width: 40%;">
<input type="submit" value="Salva" class="agy-btn submitForm" />
</div>
@Html.HiddenFor(x => x.SerialeGiro)
@Html.HiddenFor(x => x.Autista)
@Html.HiddenFor(x => x.BancaliRecuperati)
@Html.HiddenFor(x => x.ImportoRecuperato)
@Html.HiddenFor(x => x.DataChiusura)
</form>
</div>
</div>*@
<div class="row">
<div class="col-md-8">
@ -61,6 +21,7 @@
<th>Data</th>
<th>Autista</th>
<th>Automezzo</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@ -88,6 +49,9 @@
</td>
@Html.HiddenFor(a=>lst[i].Automezzo)
@Html.HiddenFor(a=>lst[i].Autista)
<td>
<a href="@Url.ActionLink("Index", "Destinazioni", new { id="", codAutista=lst[i].CodAutista, dataGiro=lst[i].DataGiro, codMezzo=lst[i].CodMezzo })" title="Destinazioni" class="links">Destinazioni</a>
</td>
</tr>
}

View File

@ -43,45 +43,16 @@
<table class="table">
<thead>
<tr>
@* <th>Seriale giro</th> *@
<th>Data</th>
@*<th>Cod. Autista</th>*@
<th>Autista</th>
<th>Automezzo</th>
<th>Bancali caricati</th>
<th>Bancali recuperati</th>
<th>Importo da recuperare</th>
<th>Importo recuperato</th>
@* <th>Data chiusura</th> *@
@* <th hidden>
@Html.DisplayNameFor(model => model.SerialeGiro)
</th>
<th>
@Html.DisplayNameFor(model => model.DataGiro)
</th>
<th>
@Html.DisplayNameFor(model => model.CodAutista)
</th>
<th>
@Html.DisplayNameFor(model => model.Autista)
</th>
<th>
@Html.DisplayNameFor(model => model.BancaliCaricati)
</th>
<th>
@Html.DisplayNameFor(model => model.BancaliRecuperati)
</th>
<th>
@Html.DisplayNameFor(model => model.ImportoDaRecuperare)
</th>
<th>
@Html.DisplayNameFor(model => model.ImportoRecuperato)
</th>
<th>
@Html.DisplayNameFor(model => model.DataChiusura)
</th>
<th></th> *@
<th><img alt="nocons" src="@Url.Content("~/images/pallet.png")" style="width:31px;height:31px;">Par</th>
<th>€ Par</th>
<th><img alt="nocons" src="@Url.Content("~/images/pallet.png")" style="width:31px;height:31px;">Rit</th>
<th>€ Rit</th>
<th><img alt="nocons" src="@Url.Content("~/images/pallet.png")" style="width:31px;height:31px;">Temp</th>
<th>€ Temp</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
@ -101,26 +72,26 @@
@Html.DisplayFor(modelItem => item.BancaliCaricati)
</td>
<td>
@Html.DisplayFor(modelItem => item.BancaliRecuperati)
@Html.DisplayFor(modelItem => item.ImportoDaRecuperare)
</td>
<td>
@Html.DisplayFor(modelItem => item.ImportoDaRecuperare)
@Html.DisplayFor(modelItem => item.BancaliRecuperati)
</td>
<td>
@Html.DisplayFor(modelItem => item.ImportoRecuperato)
</td>
<td hidden>
@Html.HiddenFor(modelItem => item.DataChiusura)
</td>
<td hidden>
@Html.HiddenFor(modelItem => item.SerialeGiro)
<td>
@Html.DisplayFor(modelItem => item.parzialeBanRec)
</td>
<td>
<a href="@Url.ActionLink("Index", "Destinazioni", new { id=item.SerialeGiro, codAutista=item.CodAutista, dataGiro=item.DataGiro, codMezzo=item.CodMezzo })" title="Destinazioni" class="links">Destinazioni</a>
<a href="@Url.ActionLink("Bancali", "GiriChiudi", new { id=item.SerialeGiro })" title="Bancali" class="links">Modifica bancali</a>
<a href="@Url.ActionLink("Chiudi", "GiriChiudi", new { id=item.SerialeGiro })" title="Chiudi" class="links">Chiudi</a>
<a href="@Url.ActionLink("Riapri", "GiriChiudi", new { id=item.SerialeGiro })" title="Riapri" class="links">Riapri</a>
<a href="@Url.ActionLink("Elimina", "GiriElimina", new { id=item.SerialeGiro })" title="Elimina" class="links">Elimina</a>
@Html.DisplayFor(modelItem => item.parzialeImpRec)
</td>
<td>
<a href="@Url.ActionLink("Index", "Destinazioni", new { id=item.SerialeGiro, codAutista=item.CodAutista, dataGiro=item.DataGiro, codMezzo=item.CodMezzo })" title="Destinazioni" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-oggetti-puntiforme-30.png")" style="width:24px;height:24px;"></a>
<a href="@Url.ActionLink("Bancali", "GiriChiudi", new { id=item.SerialeGiro })" title="Bancali" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bancale-24.png")" style="width:24px;height:24px;"></a>
<a href="@Url.ActionLink("Chiudi", "GiriChiudi", new { id=item.SerialeGiro })" title="Chiudi" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bandiera-a-scacchi-64.png")" style="width:24px;height:24px;"></a>
<a href="@Url.ActionLink("Riapri", "GiriChiudi", new { id=item.SerialeGiro })" title="Riapri" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-riduzione-32.png")" style="width:24px;height:24px;"></a>
<a href="@Url.ActionLink("Elimina", "GiriElimina", new { id=item.SerialeGiro })" title="Elimina" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-rimuovere-24.png")" style="width:24px;height:24px;"></a>
</td>
</tr>
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
wwwroot/images/pallet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB