Merge branch 'master' of 10.0.0.83:/usr/local/git/SoftwayWeb

This commit is contained in:
Marco Audiffredi 2024-07-16 10:47:28 +02:00
commit c11b665501
5 changed files with 99 additions and 7 deletions

View File

@ -29,8 +29,14 @@ namespace SoftwayWeb.Controllers
public IActionResult Index(string id, string? codAutista, DateTime dataGiro, string? codMezzo, int? page = 1) public IActionResult Index(string id, string? codAutista, DateTime dataGiro, string? codMezzo, int? page = 1)
{ {
helper = new SessionHelper(this); helper = new SessionHelper(this);
token = helper.GetStringValue("tok"); token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
string autista = string.Empty; string autista = string.Empty;
string dataGi = string.Empty; string dataGi = string.Empty;
string mezzo = string.Empty; string mezzo = string.Empty;
@ -103,6 +109,13 @@ namespace SoftwayWeb.Controllers
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/listaDestinazioneBySerial"; urlBase = apiUrl + "Giri/listaDestinazioneBySerial";
urlBase = urlBase + "?seriale=" + serial; urlBase = urlBase + "?seriale=" + serial;

View File

@ -12,6 +12,7 @@ namespace SoftwayWeb.Controllers
string apiUrl = string.Empty; string apiUrl = string.Empty;
string urlBase = string.Empty; string urlBase = string.Empty;
string errMes = string.Empty; string errMes = string.Empty;
string token = string.Empty;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
HttpClient client; HttpClient client;
public GiriChiudiController(IConfiguration configuration) public GiriChiudiController(IConfiguration configuration)
@ -25,12 +26,28 @@ namespace SoftwayWeb.Controllers
// GET: GiriChiudiController // GET: GiriChiudiController
public ActionResult Index() public ActionResult Index()
{ {
SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
// return View(); // return View();
return RedirectToAction("index", "giri"); return RedirectToAction("index", "giri");
} }
public ActionResult Chiudi(string id, int nbanc,decimal imp) public ActionResult Chiudi(string id, int nbanc,decimal imp)
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
GiriConsegnaView model = new GiriConsegnaView(); GiriConsegnaView model = new GiriConsegnaView();
List<GiriConsegnaView> lst=new List<GiriConsegnaView>(); List<GiriConsegnaView> lst=new List<GiriConsegnaView>();
@ -67,6 +84,14 @@ namespace SoftwayWeb.Controllers
{ {
//https://api.poloinformatico.it:8000/api/Giri/closeGiro?serialeGiro=0000000002&bancaliRecuperati=11&importoRecuperato=100 //https://api.poloinformatico.it:8000/api/Giri/closeGiro?serialeGiro=0000000002&bancaliRecuperati=11&importoRecuperato=100
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/closeGiro?serialeGiro="; urlBase = apiUrl + "Giri/closeGiro?serialeGiro=";
urlBase = urlBase + model.SerialeGiro; urlBase = urlBase + model.SerialeGiro;

View File

@ -34,6 +34,12 @@ namespace SoftwayWeb.Controllers
{ {
helper = new SessionHelper(this); helper = new SessionHelper(this);
token = helper.GetStringValue("tok"); token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
urlBase = apiUrl + "Giri/listaGiri?aperto="+ aperto; urlBase = apiUrl + "Giri/listaGiri?aperto="+ aperto;
//string url = apiUrl + "Giri/listaGiri"; //string url = apiUrl + "Giri/listaGiri";
//urlBase = url + "?token=" + token; //urlBase = url + "?token=" + token;
@ -104,6 +110,14 @@ namespace SoftwayWeb.Controllers
public IActionResult Create(bool sel) public IActionResult Create(bool sel)
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
List<GiriConsegnaDaCreare> modelList = new List<GiriConsegnaDaCreare>(); List<GiriConsegnaDaCreare> modelList = new List<GiriConsegnaDaCreare>();
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/listaGiriDaCreare"; urlBase = apiUrl + "Giri/listaGiriDaCreare";
@ -131,7 +145,15 @@ namespace SoftwayWeb.Controllers
public IActionResult PostIndex(IList<GiriConsegnaDaCreare> lst) public IActionResult PostIndex(IList<GiriConsegnaDaCreare> lst)
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
foreach(GiriConsegnaDaCreare g in lst)
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
foreach (GiriConsegnaDaCreare g in lst)
{ {
if(g.IsSelected==true) if(g.IsSelected==true)
{ {
@ -164,6 +186,13 @@ namespace SoftwayWeb.Controllers
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/listaGiri?aperto=" + aperto; urlBase = apiUrl + "Giri/listaGiri?aperto=" + aperto;
Uri baseAddress = new Uri(urlBase); Uri baseAddress = new Uri(urlBase);
@ -194,6 +223,13 @@ namespace SoftwayWeb.Controllers
public IActionResult Bancali(GiriConsegnaView model) public IActionResult Bancali(GiriConsegnaView model)
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/modGiro"; urlBase = apiUrl + "Giri/modGiro";
@ -265,6 +301,7 @@ namespace SoftwayWeb.Controllers
List<SelectListItem> selectItems = new List<SelectListItem>(); List<SelectListItem> selectItems = new List<SelectListItem>();
List<Personale> modelList = new List<Personale>(); List<Personale> modelList = new List<Personale>();
HttpResponseMessage response = client.GetAsync(baseAddress).Result; HttpResponseMessage response = client.GetAsync(baseAddress).Result;
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
{ {
string data = response.Content.ReadAsStringAsync().Result; string data = response.Content.ReadAsStringAsync().Result;
@ -286,6 +323,7 @@ namespace SoftwayWeb.Controllers
selectItems.Add(listItem); selectItems.Add(listItem);
} }
} }
return selectItems; return selectItems;
} }

View File

@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json; using Newtonsoft.Json;
using NuGet.Common;
using SoftwayWeb.Models; using SoftwayWeb.Models;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
@ -13,6 +14,7 @@ namespace SoftwayWeb.Controllers
string apiUrl = string.Empty; string apiUrl = string.Empty;
string urlBase = string.Empty; string urlBase = string.Empty;
string errMes = string.Empty; string errMes = string.Empty;
string token = string.Empty;
private readonly IConfiguration _configuration; private readonly IConfiguration _configuration;
HttpClient client; HttpClient client;
@ -32,6 +34,13 @@ namespace SoftwayWeb.Controllers
public IActionResult Elimina(string id) public IActionResult Elimina(string id)
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
GiriConsegnaView model = new GiriConsegnaView(); GiriConsegnaView model = new GiriConsegnaView();
List<GiriConsegnaView> modelList = new List<GiriConsegnaView>(); List<GiriConsegnaView> modelList = new List<GiriConsegnaView>();
@ -66,6 +75,13 @@ namespace SoftwayWeb.Controllers
{ {
SessionHelper helper = new SessionHelper(this); SessionHelper helper = new SessionHelper(this);
token = helper.GetStringValue("tok");
if (string.IsNullOrEmpty(token))
{
return RedirectToAction("Login", "Login");
}
apiUrl = helper.GetStringValue("apiUrl"); apiUrl = helper.GetStringValue("apiUrl");
urlBase = apiUrl + "Giri/delGiro?serialeGiro="; urlBase = apiUrl + "Giri/delGiro?serialeGiro=";
urlBase = urlBase + model.SerialeGiro.TrimEnd(); urlBase = urlBase + model.SerialeGiro.TrimEnd();

View File

@ -26,13 +26,13 @@
@using (Html.BeginForm()) @using (Html.BeginForm())
{ {
@* <div>@Html.TextBox("codAutista", null, new { placeholder = "Codice autista", @class = "agy-form-field require" })</div> *@
<div>@Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })</div>
<br />
<div>@Html.DropDownList("codMezzo", ViewBag.CodMezzo, null, new { @class = "agy-form-field require" })</div>
<br />
<div>@Html.TextBox("data", null, new { type = "date", @class = "agy-form-field require" })</div> <div>@Html.TextBox("data", null, new { type = "date", @class = "agy-form-field require" })</div>
<br /> <div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div>@Html.DropDownList("codAutista", ViewBag.Autisti, null, new { @class = "agy-form-field require" })</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div>@Html.DropDownList("codMezzo", ViewBag.CodMezzo, null, new { @class = "agy-form-field require" })</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-12">&nbsp;</div>
<div> <div>
@Html.CheckBox("aperto", new { placeholder ="aperto", @checked = true, }) @Html.CheckBox("aperto", new { placeholder ="aperto", @checked = true, })
@Html.Label("aperto", "aperto") @Html.Label("aperto", "aperto")