diff --git a/Controllers/ImpiantiController.cs b/Controllers/ImpiantiController.cs index ab9d096..c1e7725 100644 --- a/Controllers/ImpiantiController.cs +++ b/Controllers/ImpiantiController.cs @@ -320,22 +320,29 @@ namespace VirtualTask.Controllers { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); + + SelectListItem listItemFirst = new SelectListItem(); + + listItemFirst.Value = string.Empty; + listItemFirst.Text = ""; + selectItems.Add(listItemFirst); + foreach (var role in modelList) { SelectListItem listItem = new SelectListItem(); - if (role == modelList.First()) - { - listItem.Value = string.Empty; - listItem.Text = ""; - selectItems.Add(listItem); - } - else - { + //if (role == modelList.First()) + //{ + // listItem.Value = string.Empty; + // listItem.Text = ""; + // selectItems.Add(listItem); + //} + //else + //{ listItem.Value = role.ancodice; listItem.Text = role.andescri; selectItems.Add(listItem); - } + //} } } return selectItems; diff --git a/Controllers/ProgressiviController.cs b/Controllers/ProgressiviController.cs index 61aaec1..827e1a3 100644 --- a/Controllers/ProgressiviController.cs +++ b/Controllers/ProgressiviController.cs @@ -79,7 +79,7 @@ namespace VirtualTask.Controllers #endregion INDEX - #region EDTI + #region EDIT public IActionResult Edit(string id) { diff --git a/Controllers/Rapp_NewController.cs b/Controllers/Rapp_NewController.cs index ea619cd..9c7784a 100644 --- a/Controllers/Rapp_NewController.cs +++ b/Controllers/Rapp_NewController.cs @@ -79,44 +79,45 @@ namespace VirtualTask.Controllers #endregion INDEX #region CREATE + // 08/11/2023 TOLTI METODI CREATE/EDIT/DELETE PERCHE' IL RAPPORTINO VIENE TUTTO GESTITO DALL'APP. - public IActionResult Create() - { - ViewBag.Tecnici = GetTecnici(); - ViewBag.Chiusure = GetCodChiusura(); - return View(); - } + //public IActionResult Create() + //{ + // ViewBag.Tecnici = GetTecnici(); + // ViewBag.Chiusure = GetCodChiusura(); + // return View(); + //} - [HttpPost] - public IActionResult Create(Rapp_New model) - { - SessionHelper helper = new SessionHelper(this); - token = helper.GetStringValue("tok"); - if (string.IsNullOrEmpty(token)) - return RedirectToAction("Index", "Login"); + //[HttpPost] + //public IActionResult Create(Rapp_New model) + //{ + // SessionHelper helper = new SessionHelper(this); + // token = helper.GetStringValue("tok"); + // if (string.IsNullOrEmpty(token)) + // return RedirectToAction("Index", "Login"); - apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rappnew/add"; - urlBase = urlBase + "?token=" + token; - Uri baseAddress = new Uri(urlBase); - client.BaseAddress = baseAddress; + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rappnew/add"; + // urlBase = urlBase + "?token=" + token; + // Uri baseAddress = new Uri(urlBase); + // 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"); - } - else - { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); - } + // 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"); + // } + // else + // { + // errMes = response.Content.ReadAsStringAsync().Result; + // helper.SetStringValue("errMsg", errMes); + // return RedirectToAction("Error"); + // } - return View(); - } + // return View(); + //} #endregion CREATE @@ -161,150 +162,153 @@ namespace VirtualTask.Controllers #region EDIT - public IActionResult Edit(string id) - { - SessionHelper helper = new SessionHelper(this); + // 08/11/2023 TOLTI METODI CREATE/EDIT/DELETE PERCHE' IL RAPPORTINO VIENE TUTTO GESTITO DALL'APP. - token = helper.GetStringValue("tok"); + //public IActionResult Edit(string id) + //{ + // SessionHelper helper = new SessionHelper(this); - apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rappnewList"; - urlBase = urlBase + "?token=" + token; - Uri baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; + // token = helper.GetStringValue("tok"); - Rapp_New rapp = new Rapp_New(); + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rappnewList"; + // urlBase = urlBase + "?token=" + token; + // Uri baseAddress = new Uri(urlBase); + // client = new HttpClient(); + // client.BaseAddress = baseAddress; - List modelList = new List(); + // Rapp_New rapp = new Rapp_New(); - HttpResponseMessage response = client.GetAsync(baseAddress).Result; + // List modelList = new List(); - if (response.IsSuccessStatusCode) - { - string data = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject>(data); - rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); - } - else - { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); - } + // HttpResponseMessage response = client.GetAsync(baseAddress).Result; - ViewBag.Chiusure = GetCodChiusura(); - return View(rapp); - } + // if (response.IsSuccessStatusCode) + // { + // string data = response.Content.ReadAsStringAsync().Result; + // modelList = JsonConvert.DeserializeObject>(data); + // rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); + // } + // else + // { + // errMes = response.Content.ReadAsStringAsync().Result; + // helper.SetStringValue("errMsg", errMes); + // return RedirectToAction("Error"); + // } - [HttpPost] - public IActionResult Edit(Rapp_New rapp) - { - SessionHelper helper = new SessionHelper(this); + // ViewBag.Chiusure = GetCodChiusura(); + // return View(rapp); + //} - token = helper.GetStringValue("tok"); + //[HttpPost] + //public IActionResult Edit(Rapp_New rapp) + //{ + // SessionHelper helper = new SessionHelper(this); - apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rappnew/mod"; - urlBase = urlBase + "?token=" + token; - Uri baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; + // token = helper.GetStringValue("tok"); - string data = JsonConvert.SerializeObject(rapp); + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rappnew/mod"; + // urlBase = urlBase + "?token=" + token; + // Uri baseAddress = new Uri(urlBase); + // client = new HttpClient(); + // client.BaseAddress = baseAddress; - StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + // string data = JsonConvert.SerializeObject(rapp); - HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + // StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - if (response.IsSuccessStatusCode) - { - return RedirectToAction("Index"); - } - else - { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); - } + // HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + // if (response.IsSuccessStatusCode) + // { + // return RedirectToAction("Index"); + // } + // else + // { + // errMes = response.Content.ReadAsStringAsync().Result; + // helper.SetStringValue("errMsg", errMes); + // return RedirectToAction("Error"); + // } - return View(rapp); - } + // return View(rapp); + //} #endregion EDIT #region DELETE - [HttpGet] - public IActionResult Delete(string id) - { - SessionHelper helper = new SessionHelper(this); + // 08/11/2023 TOLTI METODI CREATE/EDIT/DELETE PERCHE' IL RAPPORTINO VIENE TUTTO GESTITO DALL'APP. - token = helper.GetStringValue("tok"); + //[HttpGet] + //public IActionResult Delete(string id) + //{ + // SessionHelper helper = new SessionHelper(this); - apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rappnewList"; - urlBase = urlBase + "?token=" + token; - Uri baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; + // token = helper.GetStringValue("tok"); - Rapp_New rapp = new Rapp_New(); + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rappnewList"; + // urlBase = urlBase + "?token=" + token; + // Uri baseAddress = new Uri(urlBase); + // client = new HttpClient(); + // client.BaseAddress = baseAddress; - List modelList = new List(); + // Rapp_New rapp = new Rapp_New(); - HttpResponseMessage response = client.GetAsync(baseAddress).Result; + // List modelList = new List(); - if (response.IsSuccessStatusCode) - { - string data = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject>(data); - rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); - } - else - { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); - } + // HttpResponseMessage response = client.GetAsync(baseAddress).Result; - return View(rapp); - } + // if (response.IsSuccessStatusCode) + // { + // string data = response.Content.ReadAsStringAsync().Result; + // modelList = JsonConvert.DeserializeObject>(data); + // rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); + // } + // else + // { + // errMes = response.Content.ReadAsStringAsync().Result; + // helper.SetStringValue("errMsg", errMes); + // return RedirectToAction("Error"); + // } - [HttpPost, ActionName("DeleteConfirmed")] - public IActionResult DeleteConfirmed(string id) - { - SessionHelper helper = new SessionHelper(this); + // return View(rapp); + //} - token = helper.GetStringValue("tok"); + //[HttpPost, ActionName("DeleteConfirmed")] + //public IActionResult DeleteConfirmed(string id) + //{ + // SessionHelper helper = new SessionHelper(this); - apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rappnew/del?" + "serialeRapportino=" + id + "&"; - urlBase = urlBase + "token=" + token; - Uri baseAddress = new Uri(urlBase); - client = new HttpClient(); - client.BaseAddress = baseAddress; + // token = helper.GetStringValue("tok"); - string data = JsonConvert.SerializeObject(id); + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rappnew/del?" + "serialeRapportino=" + id + "&"; + // urlBase = urlBase + "token=" + token; + // Uri baseAddress = new Uri(urlBase); + // client = new HttpClient(); + // client.BaseAddress = baseAddress; - StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + // string data = JsonConvert.SerializeObject(id); - HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + // StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - if (response.IsSuccessStatusCode) - { - return RedirectToAction("Index"); - } - else - { - errMes = response.Content.ReadAsStringAsync().Result; - helper.SetStringValue("errMsg", errMes); - return RedirectToAction("Error"); - } + // HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; - return View(); - } + // if (response.IsSuccessStatusCode) + // { + // return RedirectToAction("Index"); + // } + // else + // { + // errMes = response.Content.ReadAsStringAsync().Result; + // helper.SetStringValue("errMsg", errMes); + // return RedirectToAction("Error"); + // } + + // return View(); + //} #endregion DELETE diff --git a/Controllers/RegistrazioniController.cs b/Controllers/RegistrazioniController.cs index eb89bb4..071d035 100644 --- a/Controllers/RegistrazioniController.cs +++ b/Controllers/RegistrazioniController.cs @@ -313,7 +313,7 @@ namespace VirtualTask.Controllers //token = helper.GetStringValue("tok"); //apiUrl = helper.GetStringValue("apiUrl"); - urlBase = /*apiUrl + */"http://10.0.0.187:8000/api/Polo/Registrazioni/del?" + "codice=" + id /*+ "&"*/; + urlBase = /*apiUrl + */"http://10.0.0.187:8000/api/Polo/Registrazioni/del?" + "id=" + id /*+ "&"*/; //urlBase = urlBase + "token=" + token; Uri baseAddress = new Uri(urlBase); client = new HttpClient(); diff --git a/Views/Anag/Edit.cshtml b/Views/Anag/Edit.cshtml index 1b8c295..d3aa8df 100644 --- a/Views/Anag/Edit.cshtml +++ b/Views/Anag/Edit.cshtml @@ -15,7 +15,7 @@ @Html.HiddenFor(x => x.antipcon) @Html.HiddenFor(x => x.andtobso) @Html.HiddenFor(x => x.annumlis) - +
 
@**@ @@ -23,50 +23,52 @@ @Html.DisplayFor(model => model.ancodice)
+
 
- - + @* *@ +
+
 
- - + @* *@ +
- +
 
- - + @* *@ +
+
 
- - - -
-
- + @* *@
+
 
- - + @* *@ +
+
 
- - + @* *@ +
+
 
- - + @* *@ +
+
 
- - + @* *@ +
 
diff --git a/Views/Chiamate/Edit.cshtml b/Views/Chiamate/Edit.cshtml index 8496bac..9007faa 100644 --- a/Views/Chiamate/Edit.cshtml +++ b/Views/Chiamate/Edit.cshtml @@ -26,18 +26,18 @@
- +
@Html.HiddenFor(x => x.chtipo)
- +
- +
@@ -57,12 +57,12 @@
- +
- +
@@ -72,7 +72,7 @@
- +
diff --git a/Views/Impianti/Create.cshtml b/Views/Impianti/Create.cshtml index c5a6a27..a38d625 100644 --- a/Views/Impianti/Create.cshtml +++ b/Views/Impianti/Create.cshtml @@ -52,7 +52,7 @@
 
- +
 
diff --git a/Views/Progressivi/Edit.cshtml b/Views/Progressivi/Edit.cshtml index 49d30bb..f26b0d0 100644 --- a/Views/Progressivi/Edit.cshtml +++ b/Views/Progressivi/Edit.cshtml @@ -13,16 +13,19 @@
+
 
+
 
+
 
diff --git a/Views/Rapp_New/Edit.cshtml b/Views/Rapp_New/Edit.cshtml index 741ab01..d547e38 100644 --- a/Views/Rapp_New/Edit.cshtml +++ b/Views/Rapp_New/Edit.cshtml @@ -23,7 +23,8 @@
- + @* *@ +
@*
@@ -35,7 +36,7 @@ @Html.DisplayFor(model => model.azienda_impianto)
- +
diff --git a/Views/Rapp_New/Index.cshtml b/Views/Rapp_New/Index.cshtml index 2e043dd..3666a3d 100644 --- a/Views/Rapp_New/Index.cshtml +++ b/Views/Rapp_New/Index.cshtml @@ -18,9 +18,9 @@
-

+ @*

Crea un nuovo elemento -

+

*@ @using (Html.BeginForm()) { @@ -286,17 +286,17 @@ @Html.DisplayFor(modelItem => item.rafoto10) - + @* Modifica - | + | *@ Dettaglio | - + @* Elimina - + *@ } diff --git a/Views/Registrazioni/Edit.cshtml b/Views/Registrazioni/Edit.cshtml index fed7d6e..c0e6526 100644 --- a/Views/Registrazioni/Edit.cshtml +++ b/Views/Registrazioni/Edit.cshtml @@ -22,67 +22,79 @@ @Html.HiddenFor(x => x.id)
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +
+
 
- +