From 63c7f162b8c9240bb764c850ee43efb25fd04044 Mon Sep 17 00:00:00 2001 From: michele Date: Fri, 26 Jul 2024 12:25:27 +0200 Subject: [PATCH] Michele: aggiunto dettaglio consegna fatta (controller + view) --- Controllers/ConsegneController.cs | 56 +- Models/Destinazioni_Out.cs | 2 +- Views/Consegne/Index.cshtml | 1948 +---------------------------- Views/Destinazioni/Index.cshtml | 18 +- 4 files changed, 78 insertions(+), 1946 deletions(-) diff --git a/Controllers/ConsegneController.cs b/Controllers/ConsegneController.cs index 26e2983..7441874 100644 --- a/Controllers/ConsegneController.cs +++ b/Controllers/ConsegneController.cs @@ -23,37 +23,39 @@ namespace SoftwayWeb.Controllers apiUrl = key; } - public IActionResult Index(string id/*, string? codAutista, DateTime dataGiro, string? codMezzo*/) + public IActionResult Index(string id, string? codAutista, DateTime dataGiro, string? codMezzo) { - //helper = new SessionHelper(this); - //token = helper.GetStringValue("tok"); - //urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo"; - ////dataGiro = dataGiro.ToUniversalTime(); - ////urlBase = urlBase + "autista=" + giro.CodAutista + "datGiro=" + giro.DataGiro; - //urlBase = urlBase + "?autista=" + codAutista.Trim() + "&dataGiro=2023-05-30T00%3A00%3A00.000Z" + "&mezzo=" + codMezzo /*+ dataGiro*/; - //Uri baseAddress = new Uri(urlBase); - //client = new HttpClient(); - //client.BaseAddress = baseAddress; + helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzo"; + var dataGiroFormattata = dataGiro.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); + urlBase = urlBase + "?autista=" + codAutista + "&dataGiro="+ dataGiroFormattata + "&mezzo=" + codMezzo; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; - //List modelList = new List(); - //HttpResponseMessage response = client.GetAsync(baseAddress).Result; + List modelList = new List(); + Destinazioni_Out model = new Destinazioni_Out(); + Destinazioni_Out.ConsegnaFatta modelCons = new Destinazioni_Out.ConsegnaFatta(); - //if (response.IsSuccessStatusCode) - //{ - // string dato = response.Content.ReadAsStringAsync().Result; - // modelList = JsonConvert.DeserializeObject>(dato); - // modelList = modelList.Where(x => x.consFattaSerial == id).ToList(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; - // var shortList = modelList.ToPagedList(); - // return View(modelList/*shortList*/); - //} - //else - //{ - // errMes = response.Content.ReadAsStringAsync().Result; - // helper.SetStringValue("errMsg", errMes); - // return RedirectToAction("Error"); - //} - return View(); + if (response.IsSuccessStatusCode) + { + string dato = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(dato); + model = modelList.Where(x => x.Brserial == id).First(); + modelCons = model.ConsFatta; + + return View(modelCons); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } } } diff --git a/Models/Destinazioni_Out.cs b/Models/Destinazioni_Out.cs index fcd2d96..e5af4ec 100644 --- a/Models/Destinazioni_Out.cs +++ b/Models/Destinazioni_Out.cs @@ -71,7 +71,7 @@ namespace SoftwayWeb.Models public string? consFattaMezzo { get; set; } [Display(Name = "Autista")] public string? consFattaAut { get; set; } - [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 5)")] + [Display(Name = "Importo"), System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 5)")] public decimal? consFattaImpor { get; set; } [Display(Name = "Note 1")] public string? consFattaNotImp { get; set; } diff --git a/Views/Consegne/Index.cshtml b/Views/Consegne/Index.cshtml index 2153afa..8834259 100644 --- a/Views/Consegne/Index.cshtml +++ b/Views/Consegne/Index.cshtml @@ -1,1951 +1,65 @@ -@model IEnumerable - +@* @model IEnumerable *@ + @model SoftwayWeb.Models.Destinazioni_Out.ConsegnaFatta @{ ViewData["Title"] = "Index"; + Layout = "~/Views/Shared/_LayoutAreaRis.cshtml"; } - - - - - -

- Tables / Basic Tables -

- - +@* Torna alla lista *@ +
+
-
Table Basic
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Table Dark
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Dark Table head
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Light Table head
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Table Header & Footer
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
ProjectClientUsersStatusActions
-
-
- - -
- - -
-
Table Caption
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
List of Projects
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Striped rows
+
Dettaglio consegna
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - -
-
Bordered Table
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
-
- - -
- - -
-
Borderless Table
-
- - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + +
ProjectClientUsersStatusActionsSeriale consegnaRigaBancali caricatiBancali scaricatiAutomezzoAutistaImportoNote 1Note 2Consegato
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
+ @Html.DisplayFor(modelItem => modelItem.consFattaSerial)
Active - + @Html.DisplayFor(modelItem => modelItem.consFattaRow)
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
+ @Html.DisplayFor(modelItem => modelItem.consFattaBanCar)
Completed - + @Html.DisplayFor(modelItem => modelItem.consFattaBanSca)
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
+ @Html.DisplayFor(modelItem => modelItem.consFattaMezzo)
Scheduled - + @Html.DisplayFor(modelItem => modelItem.consFattaAut)
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
+ @Html.DisplayFor(modelItem => modelItem.consFattaImpor)
Pending - + @Html.DisplayFor(modelItem => modelItem.consFattaNotImp) + + @Html.DisplayFor(modelItem => modelItem.consFattaNotBan) + + @Html.DisplayFor(modelItem => modelItem.consFattaFlagCons)
- -
- - -
-
Hoverable rows
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - - -
-
Small Table
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
-
- - -
- - - -
-
Contextual Classes
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Sketch ProjectRonnie Shane -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
Sketch ProjectSarah Banks -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React CustomTed Richer -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Latest BootstrapPerry Parker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
Angular UIAna Bell -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
Bootstrap UIJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
-
-
- - -
- - -
Table without Card
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ProjectClientUsersStatusActions
Angular ProjectAlbert Cook -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Active - -
React ProjectBarry Hunter -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Completed - -
VueJs ProjectTrevor Baker -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Scheduled - -
Bootstrap ProjectJerry Milton -
    -
  • - Avatar -
  • -
  • - Avatar -
  • -
  • - Avatar -
  • -
-
Pending - -
-
- - -
- - -
-
Responsive Table
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Table headingTable headingTable headingTable headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cellTable cellTable cellTable cell
-
-
diff --git a/Views/Destinazioni/Index.cshtml b/Views/Destinazioni/Index.cshtml index 9b1c589..8153c46 100644 --- a/Views/Destinazioni/Index.cshtml +++ b/Views/Destinazioni/Index.cshtml @@ -41,13 +41,14 @@ Uo Ci. Note + Bc - Bs     @foreach (var item in Model) { - + int diffBancali = 0; string cl = string.Empty; @if (item.ConsFatta != null) { @@ -171,6 +172,21 @@ @Html.DisplayFor(modelItem => item.Note) + @if (item.ConsFatta != null) + { + diffBancali = item.ConsFatta.consFattaBanCar.Value - item.ConsFatta.consFattaBanSca.Value; + + + @diffBancali + + } + else + { +   + } @if (item.ConsFatta == null) {