From 47851907a7ac88eb25dc138ef55bcbb489bda3aa Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Tue, 14 Jan 2025 16:38:45 +0100 Subject: [PATCH] Varie --- Controllers/AddDestinazioneController.cs | 88 +++++- Controllers/DestinazioniController.cs | 169 +++++++--- Controllers/GiriController.cs | 288 ++++++------------ Controllers/GiriDaValidareController.cs | 7 +- Models/Destinazioni_Out.cs | 1 + Models/ErrorViewModel.cs | 15 + Models/Modgir.cs | 10 +- Models/Pigircon.cs | 21 ++ Models/Sbr_ord.cs | 37 +++ Views/AddDestinazione/AddDestinazione.cshtml | 57 ++-- .../NewDestinazioneStep1.cshtml | 208 +++++++++++++ .../Destinazioni/ModificaDestinazione.cshtml | 29 +- .../ModificaDestinazioneStep1.cshtml | 6 +- Views/Giri/ModificaTutteDestinazioni.cshtml | 75 ++--- .../ModificaTutteDestinazioniStep1.cshtml | 21 +- Views/GiriDaValidare/Index.cshtml | 4 +- Views/Shared/Alert.cshtml | 40 +++ Views/Shared/Error.cshtml | 4 +- appsettings.json | 2 +- wwwroot/images/right-arrow-icon-5.png | Bin 0 -> 3007 bytes 20 files changed, 759 insertions(+), 323 deletions(-) create mode 100644 Models/Pigircon.cs create mode 100644 Models/Sbr_ord.cs create mode 100644 Views/AddDestinazione/NewDestinazioneStep1.cshtml create mode 100644 Views/Shared/Alert.cshtml create mode 100644 wwwroot/images/right-arrow-icon-5.png diff --git a/Controllers/AddDestinazioneController.cs b/Controllers/AddDestinazioneController.cs index 8e7404b..6c3744a 100644 --- a/Controllers/AddDestinazioneController.cs +++ b/Controllers/AddDestinazioneController.cs @@ -27,6 +27,7 @@ namespace SoftwayWeb.Controllers apiUrl = key; } + public IActionResult AddDestinazione(string serialeGiro, string? codAutista, string? nomeAutista, string? codMezzo, string? desMezzo, DateTime dataGiro) { SessionHelper helper = new SessionHelper(this); @@ -43,19 +44,86 @@ namespace SoftwayWeb.Controllers model.Pisergir = serialeGiro; ViewBag.Commit = getCommittenti(); ViewBag.Mezzi=getMezzi(); - ViewBag.CodAutista=getAutisti(); - //ViewBag.CodAutista = codAutista; + string autista = string.Empty; + autista = codAutista + " - " + nomeAutista; + ViewBag.CodAutista=autista; + + string mezzo = string.Empty; + mezzo = codMezzo + " - " + desMezzo; + ViewBag.Mezzi = mezzo; + + model.Piautist = codAutista; ViewBag.Autista = nomeAutista; ViewBag.CodMezzo = codMezzo; model.Pitarga = codMezzo; ViewBag.Automezzo = desMezzo; ViewBag.dataGiro = dataGiro.ToString("dd/MM/yyyy"); + ViewBag.dateTimeGiro = dataGiro; model.Pidata = dataGiro; return View(model); } + [HttpPost] + public IActionResult NewDestinazioneStep1(Modgir modgir, string nomeAutista, string automezzo, DateTime dataGiro) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + if (string.IsNullOrEmpty(token)) + { + return RedirectToAction("Login", "Login"); + } + ViewBag.Automezzo = automezzo; + ViewBag.Autista = nomeAutista; + ViewBag.datetimeGiro = modgir.Pidata; + + apiUrl = helper.GetStringValue("apiUrl"); + + urlBase = apiUrl + "Giri/brogliaccio"; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + + List modelList = new List(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + ViewBag.controllo = string.Empty; + StringBuilder stringBuilder = new StringBuilder(); + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + var filtro = modelList.Where(t => t.Brdatcar == modgir.Pidata && t.Brcodcom!=null && t.Brcodcom.Equals(modgir.Picommit) && t.Brcodsed != null && t.Brcodsed.Equals(modgir.Pidesdiv)); + if(filtro!=null && filtro.Count()>0) + { + stringBuilder.AppendLine( "Sede di consegna già prevista."); + foreach(Sbr_ord s in filtro) + { + stringBuilder.AppendLine("Autista: " +s.Catnome); + stringBuilder.AppendLine("Mezzo: " + s.Caudesc); + } + stringBuilder.AppendLine("Impossibile aggiungere la consegna."); + ViewBag.controllo = stringBuilder.ToString(); + + } + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + + + + return View(modgir); + } + + [HttpPost] public IActionResult NewDestinazione(Modgir modgir /*,string? codAutista, string? codMezzo, DateTime dataGiro, string serGiro*/) { SessionHelper helper = new SessionHelper(this); @@ -77,8 +145,9 @@ namespace SoftwayWeb.Controllers mg.Pitarga = modgir.Pitarga; mg.Piautist = modgir.Piautist.TrimEnd(); mg.Pitiprec = "A"; - mg.Pirigele = string.Empty; + //mg.Pirigele = string.Empty; mg.Pisergir = modgir.Pisergir; + mg.Picasse = modgir.Picasse; mg.Pitrasf = modgir.Pitrasf; mg.Picolli = modgir.Picolli; @@ -87,6 +156,14 @@ namespace SoftwayWeb.Controllers mg.Picist = modgir.Picist; mg.Piseq = modgir.Piseq; mg.Pinote = modgir.Pinote; + //per vederla una delle voci DEVE essere diversa da 0. + //se nessuna lo è imposto num cons a UNO + if(mg.Picasse==0 && mg.Pitrasf==0 && mg.Picolli == 0 && mg.Pinumcons == 0 && mg.Piuova == 0 && mg.Picist == 0 && mg.Piseq == 0 && string.IsNullOrEmpty(mg.Pinote)) + { + mg.Pinumcons = 1; + } + + apiUrl = helper.GetStringValue("apiUrl"); @@ -149,7 +226,8 @@ namespace SoftwayWeb.Controllers { SelectListItem listItem = new SelectListItem(); - string s = item.Ancodice + " - " + item.Andescri; + string s = item.Andescri + " - " + item.Ancodice; + //string s = item.Andescri; listItem.Value = item.Ancodice; listItem.Text = s; selectItems.Add(listItem); @@ -291,7 +369,7 @@ namespace SoftwayWeb.Controllers { SelectListItem listItem = new SelectListItem(); - string s = sede.Pccodsed + " - " + sede.Pcdescri; + string s = sede.Pcdescri + " - " + sede.Pccodsed; listItem.Value = sede.Pccodsed; listItem.Text = s; selectItems.Add(listItem); diff --git a/Controllers/DestinazioniController.cs b/Controllers/DestinazioniController.cs index 3ff213c..4de6614 100644 --- a/Controllers/DestinazioniController.cs +++ b/Controllers/DestinazioniController.cs @@ -256,38 +256,54 @@ namespace SoftwayWeb.Controllers HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { + Modgir mg = new Modgir(); string dato = response.Content.ReadAsStringAsync().Result; model = JsonConvert.DeserializeObject(dato); - - //qui metodo post per scrivere su pimodgir - Modgir mg=new Modgir(); - mg.Piserial = model.Brserial; - mg.Pidata = model.DataCarico; - mg.Picommit = model.CodCommittente; - mg.Pidesdiv = model.CodSede; - mg.Pitarga = model.CodAutomezzo; - mg.Piautist = model.CodAutista; - mg.Pitiprec = "D"; - mg.Pisergir = model.serialeGiro; - - urlBase = apiUrl + "ModificaGiro/addModgir"; - baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; - - string data = JsonConvert.SerializeObject(mg); - StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - HttpResponseMessage response2 = client.PostAsync(baseAddress, content).Result; - if (response2.IsSuccessStatusCode) + if (!string.IsNullOrEmpty(model.Brserial)) { + //qui metodo post per scrivere su pimodgir + mg.Piserial = model.Brserial; + mg.Pidata = model.DataCarico; + mg.Picommit = model.CodCommittente; + mg.Pidesdiv = model.CodSede; + mg.Pitarga = model.CodAutomezzo; + mg.Piautist = model.CodAutista; + mg.Pitiprec = "D"; + mg.Pisergir = model.serialeGiro; + + urlBase = apiUrl + "ModificaGiro/addModgir"; + baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + string data = JsonConvert.SerializeObject(mg); + StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + HttpResponseMessage response2 = client.PostAsync(baseAddress, content).Result; + if (response2.IsSuccessStatusCode) + { + + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } } else { - errMes = response.Content.ReadAsStringAsync().Result; + string referer = Request.Headers["Referer"].ToString(); + StringBuilder sb = new StringBuilder(); + sb.AppendLine("Impossibile eliminare la destinazione. Giro non inizializzato (inserire i bancali)"); + errMes = sb.ToString(); helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); + helper.SetStringValue("field1", serial); + helper.SetStringValue("backPage", referer); + sb = null; + return RedirectToAction("Alert"); } + } else { @@ -311,6 +327,8 @@ namespace SoftwayWeb.Controllers public IActionResult ModificaDestinazione(string serial) { SessionHelper helper = new SessionHelper(this); + + var requestUrl = $"{Request.Scheme}://{Request.Host.Value}/"; apiUrl = helper.GetStringValue("apiUrl"); @@ -327,27 +345,45 @@ namespace SoftwayWeb.Controllers { string dato = response.Content.ReadAsStringAsync().Result; model = JsonConvert.DeserializeObject(dato); + if(!string.IsNullOrEmpty( model.Brserial)) + { + List autisti = new List(); + autisti = getAutisti(); + autisti.Find(c => c.Value.Trim().Equals(model.CodAutista)).Selected = true; + ViewBag.Autisti = autisti; - List < SelectListItem > autisti = new List < SelectListItem>(); - autisti = getAutisti(); - autisti.Find(c => c.Value.Trim().Equals(model.CodAutista)).Selected = true; - ViewBag.Autisti = autisti; + List mezzi = new List(); + mezzi = getMezzi(); + mezzi.Find(c => c.Value.Equals(model.CodAutomezzo)).Selected = true; + ViewBag.CodMezzo = mezzi; - List mezzi = new List(); - mezzi = getMezzi(); - mezzi.Find(c => c.Value.Equals(model.CodAutomezzo)).Selected = true; - ViewBag.CodMezzo = mezzi; + model.CodAutistaOld = model.CodAutista; + model.CodAutomezzoOld = model.CodAutomezzo; + model.AutistaOld = model.Autista; + model.DescAutomezzoOld = model.DescAutomezzo; + return View(model); + } + else + { + string referer = Request.Headers["Referer"].ToString(); - model.CodAutistaOld = model.CodAutista; - model.CodAutomezzoOld = model.CodAutomezzo; - model.AutistaOld = model.Autista; - model.DescAutomezzoOld = model.DescAutomezzo; - return View(model); + StringBuilder sb = new StringBuilder(); + sb.AppendLine("Impossibile modificare la destinazione. Giro non inizializzato (inserire i bancali)"); + errMes = sb.ToString(); + helper.SetStringValue("errMsg", errMes); + helper.SetStringValue("field1", serial); + helper.SetStringValue("field2", ""); + helper.SetStringValue("field3", ""); + helper.SetStringValue("backPage", referer); + sb = null; + return RedirectToAction("Alert"); + } } else { errMes = response.Content.ReadAsStringAsync().Result; + errMes = errMes + "seriale: " + serial; helper.SetStringValue("errMsg", errMes); return RedirectToAction("Error"); } @@ -368,23 +404,25 @@ namespace SoftwayWeb.Controllers //prima controllo se è un giro nuovo o devo accodare le destinazioni ad un altro utente string dataGi = string.Empty; dataGi = model.DataCarico.Value.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); - urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; + //urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; + urlBase = apiUrl + "Giri/listaGiriTestataByAutistaDataMezzo"; urlBase = urlBase + "?autista=" + model.CodAutista + "&dataGiro=" + dataGi + "&mezzo=" + model.CodAutomezzo; Uri baseAddress = new Uri(urlBase); client = new HttpClient(); client.BaseAddress = baseAddress; List modelList = new List(); + List modelList2 = new List(); HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { string dato = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject>(dato); - var presenti = modelList.OrderByDescending(t => t.Prog); + modelList2 = JsonConvert.DeserializeObject>(dato); + //var presenti = modelList2.OrderByDescending(t => t.); string mex = string.Empty; - if (presenti != null && presenti.Count() > 0) + if (modelList2 != null && modelList2.Count() > 0) { //giro già esistente.. accodo mex = messAcc; @@ -395,6 +433,31 @@ namespace SoftwayWeb.Controllers mex = messNew; } ViewBag.Messaggio = mex; + + + + //devo trovare la descrizione del nuovo autista e quella del nuovo automezzo + string nomeAutista=string.Empty; + List list = new List(); + list = getAutisti(); + foreach(SelectListItem i in list) + { + if(i.Value.Equals(model.CodAutista)) + { + nomeAutista = i.Text; + } + } + model.Autista=nomeAutista; + string nomeMezzo = string.Empty; + list = getMezzi(); + foreach (SelectListItem i in list) + { + if (i.Value.Equals(model.CodAutomezzo)) + { + nomeMezzo = i.Text; + } + } + model.DescAutomezzo = nomeMezzo; } else { @@ -404,7 +467,6 @@ namespace SoftwayWeb.Controllers } return View(model); - //apiUrl = helper.GetStringValue("apiUrl"); } @@ -421,7 +483,7 @@ namespace SoftwayWeb.Controllers } //prima controllo se è un giro nuovo o devo accodare le destinazioni ad un altro utente string dataGi = string.Empty; - dataGi = model.DataCarico.Value.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); + dataGi = model.DataCarico !=null ? model.DataCarico.Value.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"):string.Empty; urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; urlBase = urlBase + "?autista=" + model.CodAutista + "&dataGiro=" + dataGi + "&mezzo=" + model.CodAutomezzo; Uri baseAddress = new Uri(urlBase); @@ -461,7 +523,7 @@ namespace SoftwayWeb.Controllers { // giro non esistente.. ne creo uno nuovo mg.Pitiprec = "N"; - mg.Pisergir = model.serialeGiro; + mg.Pisergirold = model.serialeGiro; } } @@ -608,5 +670,26 @@ namespace SoftwayWeb.Controllers string e = helper.GetStringValue("errMsg"); return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e }); } + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Alert() + { + SessionHelper helper = new SessionHelper(this); + string e = helper.GetStringValue("errMsg"); + string referer= helper.GetStringValue("backPage"); + string _field1= helper.GetStringValue("field1"); + string _field2 = helper.GetStringValue("field2"); + string _field3 = helper.GetStringValue("field3"); + return View(new ErrorViewModel { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, + ErrMsg = e, + BackPage= referer, + Field1=_field1, + Field1_lbl = "Serial", + Field2 =_field2, + Field2_lbl = "Back Page", + Field3 = null, + Field3_lbl = null, + }); + } } } diff --git a/Controllers/GiriController.cs b/Controllers/GiriController.cs index 8add4dd..adb33f7 100644 --- a/Controllers/GiriController.cs +++ b/Controllers/GiriController.cs @@ -270,7 +270,7 @@ namespace SoftwayWeb.Controllers } [HttpGet] - public IActionResult ModificaTutteDestinazioni(string id, string? codAutista, string? nomeAutista, string? codMezzo, string? nomeMezzo, DateTime dataGiroCons, int? page = 1) + public IActionResult ModificaTutteDestinazioni(string id, string? codAutista, string? nomeAutista, string? codMezzo, string? nomeMezzo, DateTime dataGiroCons/*, int? page = 1*/) { helper = new SessionHelper(this); @@ -282,10 +282,12 @@ namespace SoftwayWeb.Controllers } ViewBag.CodAutista = codAutista; - ViewBag.Autista = nomeAutista; + ViewBag.NomeAutista = nomeAutista; ViewBag.CodMezzo = codMezzo; - ViewBag.Mezzo = nomeMezzo; + ViewBag.NomeMezzo = nomeMezzo; ViewBag.DataGiroCons = dataGiroCons; + ViewBag.SerialeGiro = id; + string dataGiroString = dataGiroCons.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); @@ -311,19 +313,9 @@ namespace SoftwayWeb.Controllers { string dato = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(dato); - modelList = modelList.Where(x => x.serialeGiro.Equals(id.TrimEnd())).OrderBy(x => x.Seq).ThenBy(x => x.Committente).ToList(); + modelList = modelList.Where(x => x.serialeGiro!=null && x.serialeGiro.Equals(id.TrimEnd())).OrderBy(x => x.Seq).ThenBy(x => x.Committente).ToList(); - //if (page != null && page < 1) - //{ - // page = 1; - //} - - //var pageSize = 10; - - //var shortList = modelList.ToPagedList(page ?? 1, pageSize); - - return View(modelList); - //return View(shortList); + return View(modelList); } else { @@ -334,11 +326,8 @@ namespace SoftwayWeb.Controllers } [HttpPost] - public IActionResult ModificaTutteDestinazioniStep1(List modelList, string? autisti, string? nomeAutista, string? mezzi, string? nomeMezzo) + public IActionResult ModificaTutteDestinazioniStep1(string SerialeGiro, string? CodAutista, string? NomeAutista, string? CodMezzo, string? NomeMezzo, DateTime DataGiroCons,string CodAutistaOld,string CodMezzoOld) { - ViewBag.CodMezzo = mezzi; - ViewBag.CodAutista = autisti; - SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); @@ -347,47 +336,71 @@ namespace SoftwayWeb.Controllers { return RedirectToAction("Login", "Login"); } + ViewBag.CodAutista = CodAutista; + ViewBag.NomeAutista = NomeAutista; + ViewBag.CodMezzo = CodMezzo; + ViewBag.NomeMezzo = NomeMezzo; + ViewBag.DataGiroCons = DataGiroCons; + ViewBag.SerialeGiro = SerialeGiro; - foreach (var item in modelList) + ViewBag.CodAutistaOld = CodAutistaOld; + ViewBag.CodMezzoOld = CodMezzoOld; + + + + string dataGi = string.Empty; + dataGi = DataGiroCons.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); + //urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; + urlBase = apiUrl + "Giri/listaGiriTestataByAutistaDataMezzo"; + urlBase = urlBase + "?autista=" + CodAutista + "&dataGiro=" + dataGi + "&mezzo=" + CodMezzo; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + List modelList1 = new List(); + List modelList2 = new List(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + if (response.IsSuccessStatusCode) { - string dataGi = string.Empty; - dataGi = item.DataCarico.Value.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); + string dato = response.Content.ReadAsStringAsync().Result; + modelList2 = JsonConvert.DeserializeObject>(dato); + var presenti = modelList2.OrderByDescending(t => t.Pisergir); + + string mex = string.Empty; + //var nomeA = item.Autista; + //var nomeM = item.DescAutomezzo; + + if (presenti != null && presenti.Count() > 0) + { + //giro già esistente.. accodo + mex = messAcc; + ViewBag.TipoOperazione = "M"; + string serialeGiroDestinazione = string.Empty; + foreach(Pigircon dd in presenti) + { + serialeGiroDestinazione = dd.Pisergir; + } + ViewBag.SerialeGiroDestinazione = serialeGiroDestinazione; + } + else + { + // giro non esistente.. ne creo uno nuovo + mex = messNew; + ViewBag.TipoOperazione = "N"; + } + ViewBag.Messaggio = mex; + + //qui devo ricaricare la lista delle destinazioni che sto cambiando passando + //mezzo e autista OLD urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; - //urlBase = urlBase + "?autista=" + item.CodAutista + "&dataGiro=" + dataGi + "&mezzo=" + item.CodAutomezzo; - urlBase = urlBase + "?autista=" + autisti + "&dataGiro=" + dataGi + "&mezzo=" + mezzi; - Uri baseAddress = new Uri(urlBase); + urlBase = urlBase + "?autista=" + CodAutistaOld + "&dataGiro=" + dataGi + "&mezzo=" + CodMezzoOld; + baseAddress = new Uri(urlBase); client = new HttpClient(); client.BaseAddress = baseAddress; - - List modelList2 = new List(); - HttpResponseMessage response = client.GetAsync(baseAddress).Result; + response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { - string dato = response.Content.ReadAsStringAsync().Result; - modelList2 = JsonConvert.DeserializeObject>(dato); - var presenti = modelList2.OrderByDescending(t => t.Prog); - - string mex = string.Empty; - //var nomeA = item.Autista; - //var nomeM = item.DescAutomezzo; - - if (presenti != null && presenti.Count() > 0) - { - //giro già esistente.. accodo - mex = messAcc; - } - else - { - // giro non esistente.. ne creo uno nuovo - mex = messNew; - } - - item.CodAutistaOld = item.CodAutista; - item.AutistaOld = item.Autista; - item.CodAutomezzoOld = item.CodAutomezzo; - item.DescAutomezzoOld = item.DescAutomezzoOld; - - ViewBag.Messaggio = mex; + string dato2 = response.Content.ReadAsStringAsync().Result; + modelList1 = JsonConvert.DeserializeObject>(dato2); } else { @@ -396,12 +409,17 @@ namespace SoftwayWeb.Controllers return RedirectToAction("Error"); } } - - return View(modelList); + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + return View(modelList1); } [HttpPost] - public IActionResult ModificaTutteDestinazioniPost(List modelList, string? CodAutista, string? CodMezzo/*, string? autisti,*/ /*string? nomeAutista,*/ /*string? mezzi*/) + public IActionResult ModificaTutteDestinazioniPost(List modelList, string? CodAutista, string? CodMezzo, DateTime DataGiroCons,string SerialeGiro,string TipoOperazione,string SerialeGiroDestinazione) { SessionHelper helper = new SessionHelper(this); @@ -412,61 +430,33 @@ namespace SoftwayWeb.Controllers return RedirectToAction("Login", "Login"); } + string dataGi = string.Empty; + dataGi = DataGiroCons.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); foreach (var model in modelList) { - string dataGi = string.Empty; - dataGi = model.DataCarico.Value.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'"); - urlBase = apiUrl + "Giri/listaDestinazioniByAutistaDataMezzoWeb"; - urlBase = urlBase + "?autista=" + model.CodAutista + "&dataGiro=" + dataGi + "&mezzo=" + model.CodAutomezzo; - Uri baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; - - List modelList2 = new List(); - HttpResponseMessage response = client.GetAsync(baseAddress).Result; - Modgir mg = new Modgir(); mg.Piserial = model.Brserial; - mg.Pidata = model.DataCarico; + mg.Pidata = DataGiroCons; mg.Picommit = model.CodCommittente; mg.Pidesdiv = model.CodSede; - mg.Pitarga = CodAutista; - mg.Piautist = CodMezzo; - - if (response.IsSuccessStatusCode) - { - string dato = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject>(dato); - var presenti = modelList.OrderByDescending(t => t.Prog); - - if (presenti != null && presenti.Count() > 0) - { - //giro già esistente.. accodo - mg.Pitiprec = "M"; - mg.Pisergirold = model.serialeGiro; - foreach (Destinazioni_Out d in presenti) - { - mg.Pisergir = d.serialeGiro; - } - } - else - { - // giro non esistente.. ne creo uno nuovo - mg.Pitiprec = "N"; - mg.Pisergir = model.serialeGiro; - } + mg.Pitarga = CodMezzo; + mg.Piautist = CodAutista; + mg.Pitiprec = TipoOperazione; + if (!string.IsNullOrEmpty(TipoOperazione) && TipoOperazione.Equals("M")) + { + mg.Pisergirold = SerialeGiro; + mg.Pisergir = SerialeGiroDestinazione; } else { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); + mg.Pisergirold = SerialeGiro; } - apiUrl = helper.GetStringValue("apiUrl"); + apiUrl = helper.GetStringValue("apiUrl"); urlBase = apiUrl + "ModificaGiro/addModgir"; + Uri baseAddress = new Uri(urlBase); baseAddress = new Uri(urlBase); client = new HttpClient(); client.BaseAddress = baseAddress; @@ -475,19 +465,7 @@ namespace SoftwayWeb.Controllers StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); HttpResponseMessage response2 = client.PostAsync(baseAddress, content).Result; - if (response2.IsSuccessStatusCode) - { - return RedirectToAction("IndexValidate", "Destinazioni", new - { - id = model.serialeGiro, - codAutista = model.CodAutistaOld, - nomeAutista = model.AutistaOld, - dataGiro = model.DataCarico, - codMezzo = model.CodAutomezzoOld, - desMezzo = model.DescAutomezzoOld - }); - } - else + if (!response2.IsSuccessStatusCode) { errMes = response2.Content.ReadAsStringAsync().Result; helper.SetStringValue("errMsg", errMes); @@ -495,92 +473,20 @@ namespace SoftwayWeb.Controllers } } + //return RedirectToAction("IndexValidate", "Destinazioni", new + //{ + // id = model.serialeGiro, + // codAutista = model.CodAutistaOld, + // nomeAutista = model.AutistaOld, + // dataGiro = model.DataCarico, + // codMezzo = model.CodAutomezzoOld, + // desMezzo = model.DescAutomezzoOld + //}); return RedirectToAction("Index", "Giri"); } - //[HttpPost] - //public IActionResult ModificaTutteDestinazioniPost(List modelList, string? autisti, /*string? nomeAutista,*/ string? mezzi) - //{ - // SessionHelper helper = new SessionHelper(this); - // token = helper.GetStringValue("tok"); - - // if (string.IsNullOrEmpty(token)) - // { - // return RedirectToAction("Login", "Login"); - // } - - // foreach (var destinazione in modelList) - // { - // Modgir mg = new Modgir(); - - // mg.Piserial = destinazione.Brserial; - // mg.Pidata = destinazione.DataCarico; - // mg.Picommit = destinazione.CodCommittente; - // mg.Pidesdiv = destinazione.CodSede; - // mg.Pitarga = mezzi.TrimEnd(); - // mg.Piautist = autisti.TrimEnd(); - // mg.Pitiprec = "M"; - // mg.Pisergir = destinazione.serialeGiro; - - // apiUrl = helper.GetStringValue("apiUrl"); - - // urlBase = apiUrl + "ModificaGiro/addModgir"; - - // Uri baseAddress = new Uri(urlBase); - // client = new HttpClient(); - // client.BaseAddress = baseAddress; - - // string data = JsonConvert.SerializeObject(mg); - // StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - - // HttpResponseMessage response2 = client.PostAsync(baseAddress, content).Result; - - // //if (response2.IsSuccessStatusCode) - // //{ - // // //Destinazioni_Out destMod = new Destinazioni_Out(); - // // //destMod.serialeGiro = destinazione.Brserial; - // // //destMod.CodAutista = destinazione.CodAutista; - // // //destMod.CodAutomezzo = destinazione.CodAutomezzo; - // // //new - // // //{ - // // // id = destinazione.serialeGiro, - // // // codAutista = destinazione.CodAutista, - // // // dataGiro = destinazione.DataCarico, - // // // codMezzo = destinazione.CodAutomezzo - // // //},; - // //} - // } - - // 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"); - // } - //} [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() diff --git a/Controllers/GiriDaValidareController.cs b/Controllers/GiriDaValidareController.cs index 139e559..ec46905 100644 --- a/Controllers/GiriDaValidareController.cs +++ b/Controllers/GiriDaValidareController.cs @@ -85,7 +85,7 @@ namespace SoftwayWeb.Controllers } [HttpPost] - public IActionResult PostIndex(IList lst) + public IActionResult PostIndex(IList lst, string valida, string valida0) { SessionHelper helper = new SessionHelper(this); @@ -109,6 +109,11 @@ namespace SoftwayWeb.Controllers gcv.DataGiro = g.DataGiro; gcv.CodMezzo = g.CodMezzo; gcv.DataChiusura = DateTime.MinValue; + if(!string.IsNullOrEmpty(valida0)) + { + gcv.BancaliCaricati = 0; + } + Uri baseAddress = new Uri(urlBase); client = new HttpClient(); diff --git a/Models/Destinazioni_Out.cs b/Models/Destinazioni_Out.cs index 6de2d47..eff2abe 100644 --- a/Models/Destinazioni_Out.cs +++ b/Models/Destinazioni_Out.cs @@ -48,6 +48,7 @@ namespace SoftwayWeb.Models [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 4)")] public decimal? Trasf { get; set; } + [Display(Name = "Bancali")] [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 4)")] public decimal? Colli { get; set; } public int? num_cons { get; set; } diff --git a/Models/ErrorViewModel.cs b/Models/ErrorViewModel.cs index e94776f..170b01c 100644 --- a/Models/ErrorViewModel.cs +++ b/Models/ErrorViewModel.cs @@ -7,5 +7,20 @@ namespace SoftwayWeb.Models public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); public string? ErrMsg { get; set; } + + public string? BackPage { get; set; } + + public string? Field1 { get; set; } + + public string? Field2 { get; set; } + + public string? Field3 { get; set; } + + public string? Field1_lbl { get; set; } + + public string? Field2_lbl { get; set; } + + public string? Field3_lbl { get; set; } + } } \ No newline at end of file diff --git a/Models/Modgir.cs b/Models/Modgir.cs index 7705540..3c1b750 100644 --- a/Models/Modgir.cs +++ b/Models/Modgir.cs @@ -6,14 +6,20 @@ namespace SoftwayWeb.Models { [Display(Name = "Progressivo")] public string? Piprogre { get; set; } + [Display(Name = "Seriale destinazione")] public string? Piserial { get; set; } + [Display(Name = "Data")] public DateTime? Pidata { get; set; } - [Display(Name = "Committente")] + + + [Display(Name = "Committente"), Required(ErrorMessage = "Committente obbligatorio")] public string? Picommit { get; set; } - [Display(Name = "Sede")] + + [Display(Name = "Sede"), Required(ErrorMessage = "Sede obbligatoria")] public string? Pidesdiv { get; set; } + [Display(Name = "Cod. Automezzo")] public string? Pitarga { get; set; } [Display(Name = "Autitsta")] diff --git a/Models/Pigircon.cs b/Models/Pigircon.cs new file mode 100644 index 0000000..8adb71d --- /dev/null +++ b/Models/Pigircon.cs @@ -0,0 +1,21 @@ +namespace SoftwayWeb.Models +{ + public class Pigircon + { + public string? Pisergir { get; set; } + public DateTime? Pidata { get; set; } + public string? Piautist { get; set; } + public int? Pitbancar { get; set; } + public int? Pitbanrec { get; set; } + + [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 5)")] + public decimal? Pidarecu { get; set; } + + [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 5)")] + public decimal? Pirecupe { get; set; } + + public DateTime? Pidatchi { get; set; } + public string? Pinote { get; set; } + public string? Pimezzo { get; set; } + } +} diff --git a/Models/Sbr_ord.cs b/Models/Sbr_ord.cs new file mode 100644 index 0000000..ffd559e --- /dev/null +++ b/Models/Sbr_ord.cs @@ -0,0 +1,37 @@ +namespace SoftwayWeb.Models +{ + public class Sbr_ord + { + public string? Brserial { get; set; } + public string? Brcodcom { get; set; } + public string? Brclifat { get; set; } + public int? Brnumseq { get; set; } + public string? Brcodsed { get; set; } + public DateTime? Brdatcar { get; set; } + + + [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 4)")] + public decimal? Brqtacol { get; set; } + + [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 4)")] + public decimal? Brqtavol { get; set; } + + [System.ComponentModel.DataAnnotations.Schema.Column(TypeName = "decimal(18, 4)")] + public decimal? Brcolprev { get; set; } + public int? Brconspr { get; set; } + public int? Bruovapr { get; set; } + public int? Brcistpr { get; set; } + public string? Brnote { get; set; } + + //BRTARTRA,BRAUTIST, CATNOME, CAUDESC + public string? Brtartra { get; set; } + public string? Brautist { get; set; } + //Autista + public string? Catnome { get; set; } + //Mezzo + public string? Caudesc { get; set; } + + //non usata + public string? Pisergir { get; set; } + } +} diff --git a/Views/AddDestinazione/AddDestinazione.cshtml b/Views/AddDestinazione/AddDestinazione.cshtml index d2d6fe8..78d7d57 100644 --- a/Views/AddDestinazione/AddDestinazione.cshtml +++ b/Views/AddDestinazione/AddDestinazione.cshtml @@ -7,13 +7,17 @@ listItems = ViewBag.Commit; List listItems2 = new List(); listItems2 = ViewBag.SediCons; - - + string dataStr = string.Empty; + if (Model.Pidata.HasValue) + { + dataStr = Model.Pidata.Value.ToString("dd/MM/yyyy"); + } + string pnomeAutista = ViewBag.Autista; + string pautimezzo = ViewBag.Automezzo; + DateTime dateTimeGiro = ViewBag.dateTimeGiro; }

Aggiungi una nuova destinazione

- -
@@ -28,23 +32,11 @@
-
- -
- @Html.DropDownListFor(x => x.Picommit, (IEnumerable)ViewBag.Commit, new { @id = "ddlCommittenti", @class = "agy-form-field require" }) -
-
-
- -
- @Html.DropDownListFor(x => x.Pidesdiv, new List(), "- Seleziona sede", new { @id = "ddlSediCons", @class = "agy-form-field require" }) -
- -
- @Html.DropDownList("Piautist",ViewBag.CodAutista, null, new { @class = "agy-form-field require" }) +
@ViewBag.CodAutista
+ @Html.HiddenFor(x => x.Piautist)
@@ -52,7 +44,8 @@
- @Html.DropDownList("Pitarga",ViewBag.Mezzi, null, new { @class = "agy-form-field require" }) +
@ViewBag.Mezzi
+ @Html.HiddenFor(x => x.Pitarga)
@@ -60,10 +53,26 @@
- - +
@dataStr
+ @Html.HiddenFor(x => x.Pidata)
 
+ + +
+ +
+ @Html.DropDownListFor(x => x.Picommit, (IEnumerable)ViewBag.Commit, new { @id = "ddlCommittenti", @class = "agy-form-field require" }) +
+
+
+ +
+ @Html.DropDownListFor(x => x.Pidesdiv, new List(), "- Seleziona sede", new { @id = "ddlSediCons", @class = "agy-form-field require" }) +
+ +
+
@@ -113,7 +122,11 @@
 
- +
 
diff --git a/Views/AddDestinazione/NewDestinazioneStep1.cshtml b/Views/AddDestinazione/NewDestinazioneStep1.cshtml new file mode 100644 index 0000000..560e634 --- /dev/null +++ b/Views/AddDestinazione/NewDestinazioneStep1.cshtml @@ -0,0 +1,208 @@ +@model SoftwayWeb.Models.Modgir + +@{ + ViewData["Title"] = "NewDestinazioneStep1"; + string dataStr = string.Empty; + bool btnVisible = false; + if (Model.Pidata.HasValue) + { + dataStr = Model.Pidata.Value.ToString("dd/MM/yyyy"); + } + string mex = ViewBag.controllo; + if(string.IsNullOrEmpty(mex)) + { + btnVisible = true; + } + string pserialeGiro = Model.Pisergir; + string pcodAutista = Model.Piautist; + string pnomeAutista = ViewBag.Autista; + string pautomezzo = ViewBag.Automezzo; + string pcodmezzo = Model.Pitarga; + DateTime datagiro = ViewBag.datetimeGiro; +} + +

Aggiungi una nuova destinazione

+
+
+
+
+
+
Nuova destinazione
+
+ + +
+ +
+ + +
+ +
+
@Html.DisplayFor(model => model.Piautist)
+ @Html.HiddenFor(x => x.Piautist) +
+ +
+
 
+
+ +
+
@Html.DisplayFor(model => model.Pitarga)
+ @Html.HiddenFor(x => x.Pitarga) +
+ +
+
 
+ +
+ +
@dataStr
+ @Html.HiddenFor(x => x.Pidata) +
+
 
+ + +
+ +
+ @Html.DisplayFor(model => model.Picommit) +
+ + @Html.HiddenFor(x => x.Picommit) +
+
+ +
+ @Html.DisplayFor(model => model.Pidesdiv) +
+ + @Html.HiddenFor(x => x.Pidesdiv) +
+ +
+ +
+ @Html.DisplayFor(model => model.Picasse) + + @Html.HiddenFor(x => x.Picasse) +
+ +
+
 
+
+ +
+ @Html.DisplayFor(model => model.Pitrasf) + + @Html.HiddenFor(x => x.Pitrasf) +
+ +
+
 
+
+ +
+ @Html.DisplayFor(model => model.Picolli) + + @Html.HiddenFor(x => x.Picolli) +
+ +
+
 
+
+ +
+ @Html.DisplayFor(model => model.Pinumcons) + + @Html.HiddenFor(x => x.Pinumcons) +
+ +
+
 
+
+ +
+ @Html.DisplayFor(model => model.Piuova) + + @Html.HiddenFor(x => x.Piuova) +
+
+
 
+
+ +
+ @Html.DisplayFor(model => model.Picist) + + @Html.HiddenFor(x => x.Picist) +
+
+
 
+
+ +
+ @Html.DisplayFor(model => model.Piseq) + + @Html.HiddenFor(x => x.Piseq) +
+
+
 
+
+ +
+ @Html.DisplayFor(model => model.Pinote) + + @Html.HiddenFor(x => x.Pinote) +
+ +
+
 
+
+ @if(btnVisible) + { + + } + +
+
 
+
+@* Indietro*@ + + + + Indietro + + +
+
 
+ @Html.HiddenFor(x => x.Piprogre) + @Html.HiddenFor(x => x.Piserial) + @Html.HiddenFor(x => x.Pitiprec) + @Html.HiddenFor(x => x.Pisergir) + +
+ +
+ +
+
+ +

@mex

+ + + diff --git a/Views/Destinazioni/ModificaDestinazione.cshtml b/Views/Destinazioni/ModificaDestinazione.cshtml index bb673ac..f1c03b8 100644 --- a/Views/Destinazioni/ModificaDestinazione.cshtml +++ b/Views/Destinazioni/ModificaDestinazione.cshtml @@ -33,21 +33,37 @@
@Html.DisplayFor(model => model.IndirizzoSede)
- - @Html.DropDownList("CodAutomezzo", ViewBag.CodMezzo, null, new { @class = "agy-form-field require" }) + +
@Html.DisplayFor(model => model.CodAutomezzoOld) - @Html.DisplayFor(model => model.DescAutomezzoOld)
- + + @Html.DropDownList("CodAutomezzo", ViewBag.CodMezzo, null, new { @class = "agy-form-field require" }) +
+ +
+ +
@Html.DisplayFor(model => model.CodAutistaOld) - @Html.DisplayFor(model => model.AutistaOld)
+
+
+ @Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })
@Html.HiddenFor(model => model.DescAutomezzo) + @Html.HiddenFor(model => model.Autista) + @Html.HiddenFor(model => model.CodAutistaOld) + @Html.HiddenFor(model => model.CodAutomezzoOld) + @Html.HiddenFor(model => model.AutistaOld) + @Html.HiddenFor(model => model.DescAutomezzoOld) + + @Html.HiddenFor(model => model.Brserial) @Html.HiddenFor(model => model.DataCarico) @Html.HiddenFor(model => model.CodCommittente) @Html.HiddenFor(model => model.Committente) - @Html.HiddenFor(model => model.Autista) + @Html.HiddenFor(model => model.CodSede) @Html.HiddenFor(model => model.Sede) @@ -69,10 +85,7 @@ @Html.HiddenFor(model => model.Seq) @Html.HiddenFor(model => model.Prog) - @Html.HiddenFor(model => model.CodAutistaOld) - @Html.HiddenFor(model => model.CodAutomezzoOld) - @Html.HiddenFor(model => model.AutistaOld) - @Html.HiddenFor(model => model.DescAutomezzoOld) + @* *@ diff --git a/Views/Destinazioni/ModificaDestinazioneStep1.cshtml b/Views/Destinazioni/ModificaDestinazioneStep1.cshtml index 7ef8f9d..e864112 100644 --- a/Views/Destinazioni/ModificaDestinazioneStep1.cshtml +++ b/Views/Destinazioni/ModificaDestinazioneStep1.cshtml @@ -35,11 +35,13 @@
-
@Html.DisplayFor(model => model.CodAutomezzo) - @Html.DisplayFor(model => model.DescAutomezzo)
+
@Html.DisplayFor(model => model.CodAutomezzoOld) - @Html.DisplayFor(model => model.DescAutomezzoOld) @Html.DisplayFor(model => model.DescAutomezzo)
+ @Html.HiddenFor(model => model.CodAutomezzo)
-
@Html.DisplayFor(model => model.CodAutista) - @Html.DisplayFor(model => model.Autista)
+
@Html.DisplayFor(model => model.CodAutistaOld) - @Html.DisplayFor(model => model.AutistaOld) @Html.DisplayFor(model => model.Autista)
+ @Html.HiddenFor(model => model.CodAutista)
@Html.HiddenFor(model => model.DescAutomezzo) diff --git a/Views/Giri/ModificaTutteDestinazioni.cshtml b/Views/Giri/ModificaTutteDestinazioni.cshtml index c21d3ec..bfbbe90 100644 --- a/Views/Giri/ModificaTutteDestinazioni.cshtml +++ b/Views/Giri/ModificaTutteDestinazioni.cshtml @@ -18,57 +18,60 @@
- Autista da sostituire: @ViewBag.CodAutista - @ViewBag.Autista + Autista da sostituire: @ViewBag.CodAutista - @ViewBag.NomeAutista
- Automezzo da sostituire: @ViewBag.CodMezzo - @ViewBag.Mezzo + Automezzo da sostituire: @ViewBag.CodMezzo - @ViewBag.nomeMezzo
- @using (Html.BeginForm(@* "ModificaTutteDestinazioniPost" *@"ModificaTutteDestinazioniStep1", "Giri", FormMethod.Post)) + @using (Html.BeginForm("ModificaTutteDestinazioniStep1", "Giri", FormMethod.Post)) { + + + + + + + + +
- Seleziona il nuovo autista: @Html.DropDownList("autisti", ViewBag.Autisti, null, new { @class = "agy-form-field require" }) + Seleziona il nuovo autista: @Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })
- Seleziona il nuovo Automezzo: @Html.DropDownList("mezzi", ViewBag.Mezzi, null, new { @class = "agy-form-field require" }) + Seleziona il nuovo Automezzo: @Html.DropDownList("codMezzo", ViewBag.Mezzi, null, new { @class = "agy-form-field require" })
@* *@ - @* avanti *@ +@* Avanti2 + + + Avanti3 + *@ + + Torna alla lista
- @for (var i = 0; i < modelList.Count(); i++) - { - @Html.HiddenFor(modelItem => modelList[i].CodAutomezzo); - @Html.HiddenFor(modelItem => modelList[i].DescAutomezzo) - @Html.HiddenFor(modelItem => modelList[i].Brserial) - @Html.HiddenFor(modelItem => modelList[i].DataCarico) - @Html.HiddenFor(modelItem => modelList[i].CodCommittente) - @Html.HiddenFor(modelItem => modelList[i].Committente) - @Html.HiddenFor(modelItem => modelList[i].CodAutista) - @Html.HiddenFor(modelItem => modelList[i].Autista) - @Html.HiddenFor(modelItem => modelList[i].CodSede) - @Html.HiddenFor(modelItem => modelList[i].Sede) - @Html.HiddenFor(modelItem => modelList[i].IndirizzoSede) - @Html.HiddenFor(modelItem => modelList[i].Cproword) - @Html.HiddenFor(modelItem => modelList[i].Cprownum) - @Html.HiddenFor(modelItem => modelList[i].Brmerce) - @Html.HiddenFor(modelItem => modelList[i].Brnote) - @Html.HiddenFor(modelItem => modelList[i].ImportoDaRitirare) - @Html.HiddenFor(modelItem => modelList[i].ItemList) - @Html.HiddenFor(modelItem => modelList[i].serialeGiro) - @Html.HiddenFor(modelItem => modelList[i].Casse) - @Html.HiddenFor(modelItem => modelList[i].Trasf) - @Html.HiddenFor(modelItem => modelList[i].Colli) - @Html.HiddenFor(modelItem => modelList[i].num_cons) - @Html.HiddenFor(modelItem => modelList[i].Uova) - @Html.HiddenFor(modelItem => modelList[i].Cist) - @Html.HiddenFor(modelItem => modelList[i].Note) - @Html.HiddenFor(modelItem => modelList[i].Seq) - @Html.HiddenFor(modelItem => modelList[i].Prog) - } }
diff --git a/Views/Giri/ModificaTutteDestinazioniStep1.cshtml b/Views/Giri/ModificaTutteDestinazioniStep1.cshtml index cc619a3..170323e 100644 --- a/Views/Giri/ModificaTutteDestinazioniStep1.cshtml +++ b/Views/Giri/ModificaTutteDestinazioniStep1.cshtml @@ -18,25 +18,30 @@
Modifica Tutte Destinazioni
- @*
- Autista da sostituire: @ViewBag.CodAutista - @ViewBag.Autista -
-
- Automezzo da sostituire: @ViewBag.CodMezzo - @ViewBag.Mezzo -
*@ + @using (Html.BeginForm("ModificaTutteDestinazioniPost", "Giri", FormMethod.Post)) { + + + + + + + + +
- Nuovo autista: @ViewBag.CodAutista - @ViewBag.Autista @* @Html.DropDownList("autisti", ViewBag.Autisti, null, new { @class = "agy-form-field require" }) *@ + Nuovo autista: @ViewBag.CodAutista - @ViewBag.NomeAutista
- Nuovo automezzo: @ViewBag.CodMezzo - @ViewBag.Mezzo @* @Html.DropDownList("mezzi", ViewBag.Mezzi, null, new { @class = "agy-form-field require" }) *@ + Nuovo automezzo: @ViewBag.CodMezzo - @ViewBag.NomeMezzo
+ @for (var i = 0; i < modelList.Count(); i++) { diff --git a/Views/GiriDaValidare/Index.cshtml b/Views/GiriDaValidare/Index.cshtml index e35f283..8005a4b 100644 --- a/Views/GiriDaValidare/Index.cshtml +++ b/Views/GiriDaValidare/Index.cshtml @@ -79,14 +79,14 @@ @Html.HiddenFor(a=>lst[i].CodMezzo) - nocons } - + + @Html.ActionLink("Seleziona tutti", "Index", "GiriDaValidare",new { sel = true }, new { @class = "btn btn-primary" }) @Html.ActionLink("Deleziona tutti", "Index", "GiriDaValidare",new { sel = false },new { @class = "btn btn-primary" }) diff --git a/Views/Shared/Alert.cshtml b/Views/Shared/Alert.cshtml new file mode 100644 index 0000000..1084b51 --- /dev/null +++ b/Views/Shared/Alert.cshtml @@ -0,0 +1,40 @@ +@model ErrorViewModel +@{ + ViewData["Title"] = "Alert"; +} +

Alert

+

@Model.ErrMsg

+ + +@if (!string.IsNullOrEmpty(Model.Field1)) +{ +

+ @Model.Field1_lbl: @Model.Field1 +

+} +@if (!string.IsNullOrEmpty(Model.Field2)) +{ +

+ @Model.Field2_lbl: @Model.Field2 +

+} +@if (!string.IsNullOrEmpty(Model.Field3)) +{ +

+ @Model.Field3_lbl: @Model.Field3 +

+} + +@if (!string.IsNullOrEmpty(Model.BackPage)) +{ +

+ Back url: @Model.BackPage +

+
+ Indietro +} +else +{ +
+ +} diff --git a/Views/Shared/Error.cshtml b/Views/Shared/Error.cshtml index f929d94..f6dc28e 100644 --- a/Views/Shared/Error.cshtml +++ b/Views/Shared/Error.cshtml @@ -16,7 +16,7 @@

} -

Development Mode

+@*

Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

@@ -25,4 +25,4 @@ It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app. -

+

*@ diff --git a/appsettings.json b/appsettings.json index 788e49f..1d73093 100644 --- a/appsettings.json +++ b/appsettings.json @@ -7,7 +7,7 @@ }, "ApplicationInsights": { "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", "messDestiAccodo": "Le seguenti destinazioni verranno aggiunte ad un giro esistente", diff --git a/wwwroot/images/right-arrow-icon-5.png b/wwwroot/images/right-arrow-icon-5.png new file mode 100644 index 0000000000000000000000000000000000000000..f93c4308193e3f98be1fc9efe45c6d7caf55ecc3 GIT binary patch literal 3007 zcmb_e`#;nBAAfHer@1A{{c;GQBF>a!MsiDvsOVzISZ>KU4I6fH>YO5LE?u@Tit!B* z5|%~9+(ypA-1}O1xQ&r(^!@bx56f-vxtB-C6c6a_<#YK)^#j8|lE3^9NZ1dib%uLS9whzP(3c?JdG;-XrE&;UpW zoNzdHHg;fkIAI|uT2pF4LV^eI~yIpZUdqVcz>d`G> z*^7UvviDI_Z2raI`~cda$lzz={PaJs^lfjDv%~JXhKXud6FI95SPPLL=|&PqG!o6* z%pvh?Mn$hHDk^rQ7WT#Mw1WX8@BkDzPy$Q<5MV#}7pQ+MW9N6!X9Kj{Q^%WpT6B7O z9yiP#pncIB*Q?Z%cb@;Nc-AL;K=Z&S6a5L<5r&{}B->^lxaz1EoECN$&$q>6uQp3A25b~-Wlkoc@{?96^j z`nU|GugXf-&`BAXT&<9wOm{sWtkd2(lSbP5vE{o zAna6ERNjiv#^MX6Z^A$sOs2PoMzT(lYhvlK>LtfyD2+am6se>eZ4{mzc?X409wv5g z;xQ8aBZVGdd2~=(<#^)jsV97NGzHG2J}|~&E}Ur!hEh oA5 z656{zc0{FiA1Znm6HHaKNNadCm@K~eWlcI0Ny#H7<&D!-YIR@Moq7hQvInKL29Y#X z+PQE8gk9v&?zob%#nQdCXjHU9KDa7Sq=g~1$Ln<;IzFhZRRVL?CMda*bdG&N!C zN%6j?is6zf-KcTcvyzLK#VA|#1bcz1Nda$iHq1m-^qF=% z;?=_?8&Fq`3vHls0`$i_Q>bn;eWsO1i{L7Vc89VwxBuYSBo=14bHP!^=~&_wvr*Fb zI4I6SR&=G(2n;M;$F*}`7^}>{vn?p@`@z*N2^zJ4fZx4ATz}p)8Poh6F!k4E{0Wn( z%$O91Lw}K7V0NVWyWxA*0}+9cjGsmv2Tob(xEs!(U%2J^FfwRjr=x)pBt-RE3g6Dy zllq&0yQ&vv3^8A6ntEMl&3eChS!{l^RsvOqT|JdyLTxDK3pb0F^?zol9*;YX2=sm9 z1y|eyowkYJVQ6-~(Wh@Vv-c$u3}mqOGCW&-Mj7-t`3Gk~cMkew*QAMRSYlgLJT3|W z=BzBmSk zE#bD;?Ju{qdsTnmJ6*L5Pb)RHAl?sHJM+@mBN*pn&@}eN9t4s}L@dzw z2kZmph_0F1#F0bh$6-}|z{DZgX(ZJ4sec@@N>-Osk_STT9B-s1=OTqOo`$`I@J|HE z@-xEQ!W_(3ZpyQc>yq7RTbkd_PEgcV1Zq5R{;utO8oLqW=oswWduM#+8XgP__>Jzj z#1Ye{T(xnshy|_9-C6N9@TrmM6+Po>Is_ax6|yd#hQ&ml`2ieYZ>Q9}z%Xeb(V-y6 z69Vrcpmhce*Y`nS9vWhV*yelI?5E88s;@H=?z9OLR{lgXN%E}Vgt(&CbJ+>ru&OaW z->r5BiYpJ#zWmNE%!tD9s(gj!>$uCshsjEmhPala)jb-D#Fm@NhLw+swHk@4uO0_z1;RIQH1O@VngB!ax|ghd`%7cZz1fHK566_NY#xv&~HB65}T|t7D>dNlv^?&i9HY>WcuIpu{r8>8LCEQc2TfAv#h88zZ`(Io8k3 zbZw@$#5I?*7m$==*5-uk`hhkF%p)FQ$%wZ)2|p8Jq5iMp>VQG;E?(ijSX0R=FTG-7 zMlttsZqn2t3Vh5q!C2f0iR8`>9_gHv;UMi`3xs+n-s#Q=PEU3&9q&FtI)p?p!P-MI z!*mp*?$_vJnlk&Sj-5Rl<$u*}p1ss}eZgs^|V{ z@!b=c*|cRExh6f?*7jqK?((nMjsB1h}fJ;*En zzMGw#^a-&`5s01P&tJJciH~i{sS;4!zEngRt@pv`$9sgcPZ)N}vRWFC8Tu!&M@i ze?5Yt>bTeZpxWh^pQsD+(-*aNS+zih8)MqFFCjRzEWdB;J~!ltCu_0_C(a1eggc$7 zm90?9SPR98T$?xUaTP2D&n>jUlJO|!dC=ih^ypZFzRdeff26-k$?jUzr;2NShlH*gz@uZQHH1 znIpwt-CdFCSzzfB5PL)eLI{JMQ|TsnugY%4D) zfvrWBeKRd`@r&vDPX(pskdg_8VT0&8u1A_T#7>lG8yb0{WO~m0sd>AzXymh zao4+p1+Lw>0S>{r8Qy=!O*p z%QaT(wL2Tc$bECxB{~KFw*AD$)if0jE=&CLijo3f*!?e8qCcuyit?5h1qK8|2j$?C SlA2IO4o*0pb||y=zxh8D1Vr2b literal 0 HcmV?d00001