Compare commits

...

3 Commits

3 changed files with 131 additions and 246 deletions

View File

@ -16,16 +16,26 @@ namespace SoftwayWeb.Controllers
string urlBase = string.Empty; string urlBase = string.Empty;
string token = string.Empty; string token = string.Empty;
string errMes = string.Empty; string errMes = string.Empty;
string messAcc = string.Empty;
string messNew = string.Empty;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
private readonly IConfiguration _mess1;
private readonly IConfiguration _mess2;
HttpClient client; HttpClient client;
SessionHelper helper; SessionHelper helper;
public DestinazioniController(IConfiguration configuration) public DestinazioniController(IConfiguration configuration, IConfiguration mess1, IConfiguration mess2)
{ {
_configuration = configuration; _configuration = configuration;
_mess1 = mess1;
_mess2 = mess2;
client = new HttpClient(); client = new HttpClient();
var key = _configuration["ApplicationInsights:rootUrlApi"]; var key = _configuration["ApplicationInsights:rootUrlApi"];
var messA = _mess1["ApplicationInsights:messDestAccodo"];
var messN = _mess2["ApplicationInsights:messDestNew"];
apiUrl = key; apiUrl = key;
messAcc = messA;
messNew = messN;
} }
public IActionResult Index(string id, string? codAutista, string? nomeAutista, DateTime dataGiro, string? codMezzo, string? desMezzo, int? page = 1) public IActionResult Index(string id, string? codAutista, string? nomeAutista, DateTime dataGiro, string? codMezzo, string? desMezzo, int? page = 1)
@ -367,9 +377,6 @@ namespace SoftwayWeb.Controllers
List<Destinazioni_Out> modelList = new List<Destinazioni_Out>(); List<Destinazioni_Out> modelList = new List<Destinazioni_Out>();
HttpResponseMessage response = client.GetAsync(baseAddress).Result; HttpResponseMessage response = client.GetAsync(baseAddress).Result;
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
{ {
string dato = response.Content.ReadAsStringAsync().Result; string dato = response.Content.ReadAsStringAsync().Result;
@ -380,12 +387,12 @@ namespace SoftwayWeb.Controllers
if (presenti != null && presenti.Count() > 0) if (presenti != null && presenti.Count() > 0)
{ {
//giro già esistente.. accodo //giro già esistente.. accodo
mex = "Accodo"; mex = messAcc;
} }
else else
{ {
// giro non esistente.. ne creo uno nuovo // giro non esistente.. ne creo uno nuovo
mex = "Creo nuovo"; mex = messNew;
} }
ViewBag.Messaggio = mex; ViewBag.Messaggio = mex;
} }
@ -397,11 +404,8 @@ namespace SoftwayWeb.Controllers
} }
return View(model); return View(model);
//apiUrl = helper.GetStringValue("apiUrl"); //apiUrl = helper.GetStringValue("apiUrl");
} }
[HttpPost] [HttpPost]

View File

@ -7,207 +7,40 @@
messaggio = ViewBag.Messaggio; messaggio = ViewBag.Messaggio;
} }
<h1>messaggio di uscita: @messaggio</h1> <h1 style="color:red">@* messaggio di uscita: *@ N.B: @messaggio</h1>
<div> <div class="row">
<h4>Destinazioni_Out</h4> <div class="col-xl">
<hr /> <div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0">Destinazione</h5> <small class="text-muted float-end"></small>
</div>
<div class="card-body">
<form asp-action="ModificaDestinazionePost"> <form asp-action="ModificaDestinazionePost">
<div class="mb-3">
<dl class="row"> <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.DataCarico)</b> </label>
<dt class = "col-sm-2"> <div class="form-text">@Html.DisplayFor(model => model.DataCarico)</div>
@Html.DisplayNameFor(model => model.CodAutomezzo) </div>
</dt> <div class="mb-3">
<dd class = "col-sm-10"> <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Committente)</b> </label>
@Html.DisplayFor(model => model.CodAutomezzo) <div class="form-text">@Html.DisplayFor(model => model.CodCommittente) - @Html.DisplayFor(model => model.Committente)</div>
</dd> </div>
<dt class = "col-sm-2"> <div class="mb-3">
@Html.DisplayNameFor(model => model.DescAutomezzo) <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Sede)</b> </label>
</dt> <div class="form-text">@Html.DisplayFor(model => model.CodSede) - @Html.DisplayFor(model => model.Sede)</div>
<dd class = "col-sm-10"> </div>
@Html.DisplayFor(model => model.DescAutomezzo) <div class="mb-3">
</dd> <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.IndirizzoSede)</b> </label>
<dt class = "col-sm-2"> <div class="form-text">@Html.DisplayFor(model => model.IndirizzoSede)</div>
@Html.DisplayNameFor(model => model.Brserial) </div>
</dt> <div class="mb-3">
<dd class = "col-sm-10"> <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.DescAutomezzo)</b> </label>
@Html.DisplayFor(model => model.Brserial) <div class="form-text">@Html.DisplayFor(model => model.CodAutomezzo) - @Html.DisplayFor(model => model.DescAutomezzo)</div>
</dd> </div>
<dt class = "col-sm-2"> <div class="mb-3">
@Html.DisplayNameFor(model => model.DataCarico) <label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Autista)</b> </label>
</dt> <div class="form-text">@Html.DisplayFor(model => model.CodAutista) - @Html.DisplayFor(model => model.Autista)</div>
<dd class = "col-sm-10"> </div>
@Html.DisplayFor(model => model.DataCarico)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CodCommittente)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CodCommittente)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Committente)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Committente)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CodAutista)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CodAutista)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Autista)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Autista)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CodSede)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CodSede)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Sede)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Sede)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.IndirizzoSede)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.IndirizzoSede)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Cproword)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Cproword)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Cprownum)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Cprownum)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Brmerce)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Brmerce)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Brnote)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Brnote)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.ImportoDaRitirare)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.ImportoDaRitirare)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.ItemList)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.ItemList)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.serialeGiro)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.serialeGiro)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Casse)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Casse)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Trasf)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Trasf)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Colli)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Colli)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.num_cons)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.num_cons)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Uova)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Uova)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Cist)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Cist)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Note)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Note)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Seq)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Seq)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Prog)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Prog)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.Pisergir)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.Pisergir)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CodAutomezzoOld)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CodAutomezzoOld)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.CodAutistaOld)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.CodAutistaOld)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.AutistaOld)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.AutistaOld)
</dd>
<dt class = "col-sm-2">
@Html.DisplayNameFor(model => model.DescAutomezzoOld)
</dt>
<dd class = "col-sm-10">
@Html.DisplayFor(model => model.DescAutomezzoOld)
</dd>
</dl>
@Html.HiddenFor(model => model.DescAutomezzo) @Html.HiddenFor(model => model.DescAutomezzo)
@Html.HiddenFor(model => model.Brserial) @Html.HiddenFor(model => model.Brserial)
@ -241,9 +74,55 @@
@Html.HiddenFor(model => model.AutistaOld) @Html.HiddenFor(model => model.AutistaOld)
@Html.HiddenFor(model => model.DescAutomezzoOld) @Html.HiddenFor(model => model.DescAutomezzoOld)
@Html.HiddenFor(model => model.CodAutista)
@Html.HiddenFor(model => model.CodAutomezzo)
<button type="submit" class="btn btn-primary">Salva</button> <button type="submit" class="btn btn-primary">Salva</button>
</form> </form>
</div> </div>
</div>
</div>
<div class="col-xl">
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0">Dettaglio trasporto</h5> <small class="text-muted float-end"></small>
</div>
<div class="card-body">
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Casse)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Casse)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Trasf)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Trasf)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Colli)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Colli)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.num_cons)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.num_cons)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Uova)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Uova)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Cist)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Cist)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Seq)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Seq)</div>
</div>
<div class="mb-3">
<label class="form-label" for="basic-default-fullname"><b>@Html.DisplayNameFor(model => model.Prog)</b> </label>
<div class="form-text">@Html.DisplayFor(model => model.Prog)</div>
</div>
</div>
</div>
</div>
</div>
<div>
<a asp-action="ModificaDestinazione" asp-controller="Destinazioni" asp-route-serial="@Model.Brserial" class="btn btn-primary">Torna indietro</a>
</div>

View File

@ -6,8 +6,10 @@
} }
}, },
"ApplicationInsights": { "ApplicationInsights": {
"rootUrlApi": "https://api.poloinformatico.it:8000/api/" "rootUrlApi": "https://api.poloinformatico.it:8000/api/",
//"rootUrlApi": "https://localhost:7126/api/" //"rootUrlApi": "https://localhost:7126/api/"
"messDestAccodo": "La seguente destinazione verrà aggiunta ad un giro esistente",
"messDestNew": "Verrà creato un nuovo giro per la seguente destinazione"
}, },