Michele: Edit numero bancali
This commit is contained in:
parent
873a3c2530
commit
bca6fc6522
@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SoftwayWeb.Models;
|
using SoftwayWeb.Models;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.Intrinsics.Arm;
|
using System.Runtime.Intrinsics.Arm;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -146,6 +147,63 @@ namespace SoftwayWeb.Controllers
|
|||||||
return RedirectToAction("Index", "Giri");
|
return RedirectToAction("Index", "Giri");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult Bancali(string id, bool aperto = true)
|
||||||
|
{
|
||||||
|
SessionHelper helper = new SessionHelper(this);
|
||||||
|
|
||||||
|
apiUrl = helper.GetStringValue("apiUrl");
|
||||||
|
urlBase = apiUrl + "Giri/listaGiri?aperto=" + aperto;
|
||||||
|
Uri baseAddress = new Uri(urlBase);
|
||||||
|
client = new HttpClient();
|
||||||
|
client.BaseAddress = baseAddress;
|
||||||
|
|
||||||
|
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||||
|
List<GiriConsegnaView> modelList = new List<GiriConsegnaView>();
|
||||||
|
GiriConsegnaView model = new GiriConsegnaView();
|
||||||
|
|
||||||
|
if (response.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
string data = response.Content.ReadAsStringAsync().Result;
|
||||||
|
modelList = JsonConvert.DeserializeObject<List<GiriConsegnaView>>(data);
|
||||||
|
model = modelList.Where(x => x.SerialeGiro.Equals(id)).First();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errMes = response.Content.ReadAsStringAsync().Result;
|
||||||
|
helper.SetStringValue("errMsg", errMes);
|
||||||
|
return RedirectToAction("Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
return View(model);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public IActionResult Bancali(GiriConsegnaView model)
|
||||||
|
{
|
||||||
|
SessionHelper helper = new SessionHelper(this);
|
||||||
|
apiUrl = helper.GetStringValue("apiUrl");
|
||||||
|
urlBase = apiUrl + "Giri/modGiro";
|
||||||
|
|
||||||
|
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]
|
//[HttpPost]
|
||||||
//public IActionResult Create(GiriConsegnaView model)
|
//public IActionResult Create(GiriConsegnaView model)
|
||||||
//{
|
//{
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.17" />
|
||||||
<PackageReference Include="X.PagedList.Mvc.Core" Version="9.1.2" />
|
<PackageReference Include="X.PagedList.Mvc.Core" Version="9.1.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
111
Views/Giri/Bancali.cshtml
Normal file
111
Views/Giri/Bancali.cshtml
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
@model SoftwayWeb.Models.GiriConsegnaView
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Bancali";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1>Modifica numero Bancali</h1>
|
||||||
|
|
||||||
|
@* <h4>GiriConsegnaView</h4> *@
|
||||||
|
<hr />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<form asp-action="Bancali">
|
||||||
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="SerialeGiro" class="control-label"></label>
|
||||||
|
<input asp-for="SerialeGiro" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.SerialeGiro)
|
||||||
|
<span asp-validation-for="SerialeGiro" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="DataGiro" class="control-label"></label>
|
||||||
|
<input asp-for="DataGiro" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.DataGiro)
|
||||||
|
<span asp-validation-for="DataGiro" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="CodAutista" class="control-label"></label>
|
||||||
|
<input asp-for="CodAutista" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.CodAutista)
|
||||||
|
<span asp-validation-for="CodAutista" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="Autista" class="control-label"></label>
|
||||||
|
<input asp-for="Autista" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.Autista)
|
||||||
|
<span asp-validation-for="Autista" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="BancaliCaricati" class="control-label"></label>
|
||||||
|
<input asp-for="BancaliCaricati" class="form-control" />
|
||||||
|
<span asp-validation-for="BancaliCaricati" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="BancaliRecuperati" class="control-label"></label>
|
||||||
|
<input asp-for="BancaliRecuperati" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.BancaliRecuperati)
|
||||||
|
@Html.DisplayFor(x => x.BancaliRecuperati)
|
||||||
|
<span asp-validation-for="BancaliRecuperati" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="ImportoDaRecuperare" class="control-label"></label>
|
||||||
|
<input asp-for="ImportoDaRecuperare" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.ImportoDaRecuperare)
|
||||||
|
<span asp-validation-for="ImportoDaRecuperare" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="ImportoRecuperato" class="control-label"></label>
|
||||||
|
<input asp-for="ImportoRecuperato" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.ImportoRecuperato)
|
||||||
|
<span asp-validation-for="ImportoRecuperato" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="DataChiusura" class="control-label"></label>
|
||||||
|
<input asp-for="DataChiusura" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.DataChiusura)
|
||||||
|
<span asp-validation-for="DataChiusura" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="CodMezzo" class="control-label"></label>
|
||||||
|
<input asp-for="CodMezzo" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.CodMezzo)
|
||||||
|
<span asp-validation-for="CodMezzo" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="Automezzo" class="control-label"></label>
|
||||||
|
<input asp-for="Automezzo" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.Automezzo)
|
||||||
|
<span asp-validation-for="Automezzo" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="parzialeBanRec" class="control-label"></label>
|
||||||
|
<input asp-for="parzialeBanRec" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.parzialeBanRec)
|
||||||
|
<span asp-validation-for="parzialeBanRec" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="parzialeImpRec" class="control-label"></label>
|
||||||
|
<input asp-for="parzialeImpRec" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.parzialeImpRec)
|
||||||
|
<span asp-validation-for="parzialeImpRec" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
@* <label asp-for="NoteChiusura" class="control-label"></label>
|
||||||
|
<input asp-for="NoteChiusura" class="form-control" /> *@
|
||||||
|
@Html.HiddenFor(x => x.NoteChiusura)
|
||||||
|
<span asp-validation-for="NoteChiusura" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input type="submit" value="Salva" class="agy-btn submitForm" />
|
||||||
|
<a asp-action="Index" value="Torna alla lista" class="agy-btn submitForm">Torna alla lista</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
@* <a asp-action="Index">Back to List</a> *@
|
||||||
|
</div>
|
||||||
|
|
||||||
@ -96,7 +96,7 @@
|
|||||||
|
|
||||||
<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("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("Bancali", "Giri", 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,nbanc=item.parzialeBanRec,imp=item.parzialeImpRec })" 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("Chiudi", "GiriChiudi", new { id=item.SerialeGiro,nbanc=item.parzialeBanRec,imp=item.parzialeImpRec })" title="Chiudi" class="links"><img alt="nocons" src="@Url.Content("~/images/icons8-bandiera-a-scacchi-64.png")" style="width:24px;height:24px;"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user