From bbedc08f3833821f6f0b5c11da818e04f528f25b Mon Sep 17 00:00:00 2001 From: Michele Ferri Date: Wed, 27 Sep 2023 09:28:06 +0200 Subject: [PATCH] Michele Rapp New --- Controllers/AnagController.cs | 206 ++++++++++++- Controllers/ChiusureController.cs | 163 ++++++++-- Controllers/Rapp_NewController.cs | 262 ++++++++++++++++ Controllers/TecniciController.cs | 171 +++++++++-- Models/Rapp_New.cs | 193 ++++++++++++ Views/Anag/Create.cshtml | 88 ++++++ Views/Anag/Delete.cshtml | 93 ++++++ Views/Anag/Details.cshtml | 90 ++++++ Views/Anag/Edit.cshtml | 88 ++++++ Views/Anag/Index.cshtml | 6 +- Views/Chiusure/Delete.cshtml | 1 + Views/Chiusure/Index.cshtml | 43 ++- Views/Rapp_New/Create.cshtml | 333 ++++++++++++++++++++ Views/Rapp_New/Delete.cshtml | 387 ++++++++++++++++++++++++ Views/Rapp_New/Details.cshtml | 384 +++++++++++++++++++++++ Views/Rapp_New/Edit.cshtml | 333 ++++++++++++++++++++ Views/Rapp_New/Index.cshtml | 486 ++++++++++++++++++++++++++++++ Views/Tecnici/Index.cshtml | 78 +++-- 18 files changed, 3318 insertions(+), 87 deletions(-) create mode 100644 Controllers/Rapp_NewController.cs create mode 100644 Models/Rapp_New.cs create mode 100644 Views/Anag/Create.cshtml create mode 100644 Views/Anag/Delete.cshtml create mode 100644 Views/Anag/Details.cshtml create mode 100644 Views/Anag/Edit.cshtml create mode 100644 Views/Rapp_New/Create.cshtml create mode 100644 Views/Rapp_New/Delete.cshtml create mode 100644 Views/Rapp_New/Details.cshtml create mode 100644 Views/Rapp_New/Edit.cshtml create mode 100644 Views/Rapp_New/Index.cshtml diff --git a/Controllers/AnagController.cs b/Controllers/AnagController.cs index 3b3a6cb..36719c1 100644 --- a/Controllers/AnagController.cs +++ b/Controllers/AnagController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using NuGet.Common; using System.Runtime.Intrinsics.Arm; +using System.Text; using VirtualTask.Models; using X.PagedList; @@ -18,8 +19,11 @@ namespace VirtualTask.Controllers HttpClient client; public AnagController() { + } + #region INDEX + public IActionResult Index(string searchString, int? page = 1) { SessionHelper helper = new SessionHelper(this); @@ -42,14 +46,17 @@ namespace VirtualTask.Controllers string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); } + if (!string.IsNullOrEmpty(searchString)) { modelList = modelList.Where(s => s.andescri.ToUpper().Contains(searchString.ToUpper())).ToList(); - + ViewData["CurrentFilter"] = searchString; } else + { ViewData["CurrentFilter"] = null; + } if (page != null && page < 1) { @@ -57,12 +64,207 @@ namespace VirtualTask.Controllers } var pageSize = 10; - + var shortLinks = modelList .OrderByDescending(s => s.ancodice) .ToPagedList(page ?? 1, pageSize); return View(shortLinks); } + + #endregion INDEX + + #region CREATE + + public IActionResult Create() + { + + return View(); + } + + [HttpPost] + public IActionResult Create(Anag model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagrafiche/add"; + urlBase = urlBase + "?token=" + token; + 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"); + } + + return View(); + } + + #endregion CREATE + + #region DETAIL + + public IActionResult Details(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagraficheList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Anag anag = new Anag(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + anag = modelList.Where(x => x.ancodice.Equals(id)).First(); + } + + return View(anag); + } + + #endregion DETAIL + + #region EDIT + + public IActionResult Edit(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagraficheList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Anag anag = new Anag(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + anag = modelList.Where(x => x.ancodice.Equals(id)).First(); + + } + + return View(anag); + } + + [HttpPost] + public IActionResult Edit(Anag model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagrafiche/mod"; + urlBase = urlBase + "?token=" + token; + 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"); + } + + return View(model); + } + + #endregion EDIT + + #region DELETE + + [HttpGet] + public IActionResult Delete(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagraficheList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Anag anag = new Anag(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + anag = modelList.Where(x => x.ancodice.Equals(id)).First(); + } + + return View(anag); + } + + //DA MODIFICARE PERCHE' NON E' UNA DELETE MA UN UPDATE DELLA DATA OBSOLESCENZA + [HttpPost, ActionName("DeleteConfirmed")] + public IActionResult DeleteConfirmed(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "anagrafiche/del?" + "codice=" + id + "&"; + urlBase = urlBase + "token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + string data = JsonConvert.SerializeObject(id); + + StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + + if (response.IsSuccessStatusCode) + { + return RedirectToAction("Index"); + } + + return View(); + } + + #endregion DELETE } } diff --git a/Controllers/ChiusureController.cs b/Controllers/ChiusureController.cs index 77f6839..c8b1116 100644 --- a/Controllers/ChiusureController.cs +++ b/Controllers/ChiusureController.cs @@ -4,52 +4,99 @@ using System.Net; using System.Reflection; using System.Text; using VirtualTask.Models; +using X.PagedList; namespace VirtualTask.Controllers { public class ChiusureController : Controller { - Uri baseAddress = new Uri("http://10.0.0.187:8000/api/Polo/codici_chiusura?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + string apiUrl = string.Empty; + string urlBase = string.Empty; + string token = string.Empty; + + //Uri baseAddress = new Uri("http://10.0.0.187:8000/api/Polo/codici_chiusura?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); HttpClient client; - Uri baseAddressCreate = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/add?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientCreate; + //Uri baseAddressCreate = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/add?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientCreate; - Uri baseAddressEdit = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/mod?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientEdit; + //Uri baseAddressEdit = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/mod?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientEdit; - Uri baseAddressDelete = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/del?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientDelete; + //Uri baseAddressDelete = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/del?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientDelete; public ChiusureController() { - client = new HttpClient(); - client.BaseAddress = baseAddress; + //client = new HttpClient(); + //client.BaseAddress = baseAddress; - clientCreate = new HttpClient(); - clientCreate.BaseAddress = baseAddressCreate; + //clientCreate = new HttpClient(); + //clientCreate.BaseAddress = baseAddressCreate; - clientEdit = new HttpClient(); - clientEdit.BaseAddress = baseAddressEdit; + //clientEdit = new HttpClient(); + //clientEdit.BaseAddress = baseAddressEdit; - clientDelete = new HttpClient(); - clientDelete.BaseAddress = baseAddressDelete; + //clientDelete = new HttpClient(); + //clientDelete.BaseAddress = baseAddressDelete; } #region INDEX - public IActionResult Index() + public IActionResult Index(string searchString, int? page = 1) { + //List modelList = new List(); + //HttpResponseMessage response = client.GetAsync(baseAddress).Result; + //if (response.IsSuccessStatusCode) + //{ + // string data = response.Content.ReadAsStringAsync().Result; + // modelList = JsonConvert.DeserializeObject>(data); + //} + //return View(modelList); + + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + if (string.IsNullOrEmpty(token)) + return RedirectToAction("Index", "Login"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "codici_chiusura"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + List modelList = new List(); HttpResponseMessage response = client.GetAsync(baseAddress).Result; + if (response.IsSuccessStatusCode) { string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); } - return View(modelList); + if (!string.IsNullOrEmpty(searchString)) + { + modelList = modelList.Where(s => s.ccdescr.ToUpper().Contains(searchString.ToUpper())).ToList(); + + ViewData["CurrentFilter"] = searchString; + } + else + ViewData["CurrentFilter"] = null; + + if (page != null && page < 1) + { + page = 1; + } + + var pageSize = 10; + + var shortLinks = modelList + .OrderByDescending(s => s.cccodice) + .ToPagedList(page ?? 1, pageSize); + + return View(shortLinks); } #endregion INDEX @@ -64,9 +111,20 @@ namespace VirtualTask.Controllers [HttpPost] public IActionResult Create(Chiusure model) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "chiusure/add"; + urlBase = urlBase + "?token=" + token; + 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(baseAddressCreate, content).Result; + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { return RedirectToAction("Index"); @@ -81,6 +139,17 @@ namespace VirtualTask.Controllers public IActionResult Details(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "codici_chiusura"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Chiusure chiusura = new Chiusure(); List modelList = new List(); @@ -103,6 +172,17 @@ namespace VirtualTask.Controllers public IActionResult Edit(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "codici_chiusura"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Chiusure ele = new Chiusure(); List modelList = new List(); @@ -123,9 +203,20 @@ namespace VirtualTask.Controllers [HttpPost] public IActionResult Edit(Chiusure model) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "chiusure/mod"; + urlBase = urlBase + "?token=" + token; + 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(baseAddressEdit, content).Result; + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { return RedirectToAction("Index"); @@ -140,6 +231,17 @@ namespace VirtualTask.Controllers [HttpGet] public IActionResult Delete(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "codici_chiusura"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Chiusure elem = new Chiusure(); List modelList = new List(); HttpResponseMessage response = client.GetAsync(baseAddress).Result; @@ -150,21 +252,28 @@ namespace VirtualTask.Controllers modelList = JsonConvert.DeserializeObject>(data); elem = modelList.Where(t => t.cccodice.Equals(id)).First(); } - + return View(elem); } [HttpPost, ActionName("DeleteConfirmed")] - public IActionResult DeleteConfirmed(/*Chiusure model*/ string id) + public IActionResult DeleteConfirmed(string id) { - //var prova = id; - Uri cod = new Uri("http://10.0.0.187:8000/api/Polo/chiusure/del?"); + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "chiusure/del?" + "codice=" + id + "&"; + urlBase = urlBase + "token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + string data = JsonConvert.SerializeObject(id); StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - - HttpResponseMessage response = client.PostAsync(cod + "codice=" + id + "&" +"token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZ" + - "W50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3N" + - "jk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI", content).Result; + + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { diff --git a/Controllers/Rapp_NewController.cs b/Controllers/Rapp_NewController.cs new file mode 100644 index 0000000..b5d4b0f --- /dev/null +++ b/Controllers/Rapp_NewController.cs @@ -0,0 +1,262 @@ +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.Text; +using VirtualTask.Models; +using X.PagedList; + +namespace VirtualTask.Controllers +{ + public class Rapp_NewController : Controller + { + string apiUrl = string.Empty; + string urlBase = string.Empty; + string token = string.Empty; + + HttpClient client; + + public Rapp_NewController() + { + + } + + #region INDEX + + public IActionResult Index(string searchString, int? page = 1) + { + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + if (string.IsNullOrEmpty(token)) + return RedirectToAction("Index", "Login"); + + 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(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + } + if (!string.IsNullOrEmpty(searchString)) + { + modelList = modelList.Where(s => s.descrizione_intervento.ToUpper().Contains(searchString.ToUpper())).ToList(); + + ViewData["CurrentFilter"] = searchString; + } + else + ViewData["CurrentFilter"] = null; + + if (page != null && page < 1) + { + page = 1; + } + + var pageSize = 10; + + var shortLinks = modelList + .OrderByDescending(s => s.seriale_rapportino) + .ToPagedList(page ?? 1, pageSize); + + return View(shortLinks); + } + + #endregion INDEX + + #region CREATE + + public IActionResult Create() + { + return View(); + } + + [HttpPost] + public IActionResult Create(Rapp_New model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnew/add"; + urlBase = urlBase + "?token=" + token; + 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"); + } + + return View(); + } + + #endregion CREATE + + #region DETAIL + + public IActionResult Details(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnewList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Rapp_New rapp = new Rapp_New(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); + } + + return View(rapp); + } + + #endregion DETAIL + + #region EDIT + + public IActionResult Edit(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnewList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Rapp_New rapp = new Rapp_New(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); + + } + + return View(rapp); + } + + [HttpPost] + public IActionResult Edit(Rapp_New rapp) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnew/mod"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + string data = JsonConvert.SerializeObject(rapp); + + StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + + if (response.IsSuccessStatusCode) + { + return RedirectToAction("Index"); + } + + return View(rapp); + } + + #endregion EDIT + + #region DELETE + + [HttpGet] + public IActionResult Delete(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnewList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + Rapp_New rapp = new Rapp_New(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + rapp = modelList.Where(x => x.seriale_rapportino.Equals(id)).First(); + } + + return View(rapp); + } + + [HttpPost, ActionName("DeleteConfirmed")] + public IActionResult DeleteConfirmed(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "rappnew/del?" + "codice=" + id + "&"; + urlBase = urlBase + "token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + string data = JsonConvert.SerializeObject(id); + + StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); + + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; + + if (response.IsSuccessStatusCode) + { + return RedirectToAction("Index"); + } + + return View(); + } + + #endregion DELETE + } +} diff --git a/Controllers/TecniciController.cs b/Controllers/TecniciController.cs index c45179d..2227f9d 100644 --- a/Controllers/TecniciController.cs +++ b/Controllers/TecniciController.cs @@ -2,59 +2,108 @@ using Newtonsoft.Json; using System.Text; using VirtualTask.Models; +using X.PagedList; using static System.Net.Mime.MediaTypeNames; + namespace VirtualTask.Controllers { public class TecniciController : Controller { - Uri baseAddress = new Uri("http://10.0.0.187:8000/api/Polo/tecniciList?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + string apiUrl = string.Empty; + string urlBase = string.Empty; + string token = string.Empty; + + //MF commentati perchè L'Uri viene costruito + //Uri baseAddress = new Uri("http://10.0.0.187:8000/api/Polo/tecniciList?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); HttpClient client; - Uri baseAddressCreate = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/add?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientCreate; + //Uri baseAddressCreate = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/add?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientCreate; - Uri baseAddressEdit = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/mod?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientEdit; + //Uri baseAddressEdit = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/mod?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientEdit; - Uri baseAddressDelete = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/del?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); - HttpClient clientDelete; + //Uri baseAddressDelete = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/del?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3Njk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI"); + //HttpClient clientDelete; public TecniciController() { - client = new HttpClient(); - client.BaseAddress = baseAddress; + //client = new HttpClient(); + //client.BaseAddress = baseAddress; - clientCreate = new HttpClient(); - clientCreate.BaseAddress = baseAddressCreate; + //clientCreate = new HttpClient(); + //clientCreate.BaseAddress = baseAddressCreate; - clientEdit = new HttpClient(); - clientEdit.BaseAddress = baseAddressEdit; + //clientEdit = new HttpClient(); + //clientEdit.BaseAddress = baseAddressEdit; - clientDelete = new HttpClient(); - clientDelete.BaseAddress = baseAddressDelete; + //clientDelete = new HttpClient(); + //clientDelete.BaseAddress = baseAddressDelete; } #region INDEX - public IActionResult Index() + public IActionResult Index(string searchString, int? page = 1) { - List tecniciList = new List(); - + //List tecniciList = new List(); + + //HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + //if (response.IsSuccessStatusCode) + //{ + // string data = response.Content.ReadAsStringAsync().Result; + // tecniciList = JsonConvert.DeserializeObject>(data); + //} + + //return View(tecniciList); + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + if (string.IsNullOrEmpty(token)) + return RedirectToAction("Index", "Login"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecniciList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + List modelList = new List(); HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { string data = response.Content.ReadAsStringAsync().Result; - tecniciList = JsonConvert.DeserializeObject>(data); + modelList = JsonConvert.DeserializeObject>(data); + } + if (!string.IsNullOrEmpty(searchString)) + { + modelList = modelList.Where(s => s.tcdescri.ToUpper().Contains(searchString.ToUpper())).ToList(); + + ViewData["CurrentFilter"] = searchString; + } + else + ViewData["CurrentFilter"] = null; + + if (page != null && page < 1) + { + page = 1; } - return View(tecniciList); + var pageSize = 10; + + var shortLinks = modelList + .OrderByDescending(s => s.tccodice) + .ToPagedList(page ?? 1, pageSize); + + return View(shortLinks); } #endregion INDEX #region CREATE + public IActionResult Create() { @@ -64,9 +113,20 @@ namespace VirtualTask.Controllers [HttpPost] public IActionResult Create(Tecnici model) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecnici/add"; + urlBase = urlBase + "?token=" + token; + 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(baseAddressCreate, content).Result; + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { return RedirectToAction("Index"); @@ -81,6 +141,17 @@ namespace VirtualTask.Controllers public IActionResult Details(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecniciList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Tecnici tecnico = new Tecnici(); List modelList = new List(); @@ -90,7 +161,7 @@ namespace VirtualTask.Controllers if (response.IsSuccessStatusCode) { string data = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject < List>(data); + modelList = JsonConvert.DeserializeObject>(data); tecnico = modelList.Where(x => x.tccodice.Equals(id)).First(); } @@ -101,8 +172,19 @@ namespace VirtualTask.Controllers #region EDIT - public IActionResult Edit(string id) + public IActionResult Edit(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecniciList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Tecnici tecnico = new Tecnici(); List modelList = new List(); @@ -112,7 +194,7 @@ namespace VirtualTask.Controllers if (response.IsSuccessStatusCode) { string data = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject< List>(data); + modelList = JsonConvert.DeserializeObject>(data); tecnico = modelList.Where(x => x.tccodice.Equals(id)).First(); } @@ -123,11 +205,22 @@ namespace VirtualTask.Controllers [HttpPost] public IActionResult Edit(Tecnici tecnico) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecnici/mod"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + string data = JsonConvert.SerializeObject(tecnico); StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - HttpResponseMessage response = client.PostAsync(baseAddressEdit, content).Result; + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { @@ -144,11 +237,22 @@ namespace VirtualTask.Controllers [HttpGet] public IActionResult Delete(string id) { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecniciList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + Tecnici tecnico = new Tecnici(); List modelList = new List(); - HttpResponseMessage response= client.GetAsync(baseAddress).Result; + HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { @@ -163,15 +267,22 @@ namespace VirtualTask.Controllers [HttpPost, ActionName("DeleteConfirmed")] public IActionResult DeleteConfirmed(string id) { - Uri codice = new Uri("http://10.0.0.187:8000/api/Polo/tecnici/del?"); + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "tecnici/del?" + "codice=" + id + "&"; + urlBase = urlBase + "token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; string data = JsonConvert.SerializeObject(id); StringContent content = new StringContent(data, Encoding.UTF8, "application/json"); - HttpResponseMessage response = client.PostAsync(codice + "codice=" + id + "&" + "token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZ" + - "W50aXR5L2NsYWltcy9uYW1lIjoiVEVTVCIsImp0aSI6IjA2MzA5MzlmLTBhZDgtNDhkMi04ZTI5LWI3Mjk3N2IyOWM1YiIsInRlbmFudCI6Ik1BUlJPIiwidGNjb2RpY2UiOiJaWlogICAgICAgICAgICAiLCJleHAiOjE3MDE3N" + - "jk0NTUsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NjE5NTUiLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0OjQyMDAifQ.CDt3wR6ube4zzNscVG9Qv6bzOnNF6A9-bIZxxjbKmKI", content).Result; + HttpResponseMessage response = client.PostAsync(baseAddress, content).Result; if (response.IsSuccessStatusCode) { diff --git a/Models/Rapp_New.cs b/Models/Rapp_New.cs new file mode 100644 index 0000000..3a264a1 --- /dev/null +++ b/Models/Rapp_New.cs @@ -0,0 +1,193 @@ +using Microsoft.VisualBasic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Xml.Linq; + +namespace VirtualTask.Models +{ + public class Rapp_New + { + [Display(Name = "SERIALE RAPPORTINO")] + public string? seriale_rapportino { get; set; } + + [Display(Name = "TIPO RAPPORTINI")] + public string? tipo_rapportino { get; set; } + + [Display(Name = "AZIENDA")] + public string? azienda_impianto { get; set; } + + [Display(Name = "CODICE IMPIANTO")] + public string? codice_impianto { get; set; } + + [Display(Name = "AZ. CHIAMATA")] + public string? azienda_chiamata { get; set; } + + [Display(Name = "SERIALE CHIAMATA")] + public string? seriale_chiamata { get; set; } + + [Display(Name = "SERIALE COMMESSA")] + public string? seriale_commessa { get; set; } + + [Display(Name = "DATA RAPPORTINO")] + public DateTime data_rapportino { get; set; } + + [Display(Name = "ORA INIZIO")] + public string? ora_ini_rapportino { get; set; } + + [Display(Name = "MINUTO INIZIO")] + public string? min_ini_rapportino { get; set; } + + [Display(Name = "ORA FINE")] + public string? ora_fin_rapportino { get; set; } + + [Display(Name = "MINUTO FINE")] + public string? min_fin_rapportino { get; set; } + + [Display(Name = "CODICE CHIUSURA 1")] + public string? codice_chiusura_1 { get; set; } + + [Display(Name = "CODICE CHIUSURA 2")] + public string? codice_chiusura_2 { get; set; } + + [Display(Name = "CODICE CHIUSURA 3")] + public string? codice_chiusura_3 { get; set; } + + [Display(Name = "CODICE CHIUSURA 4")] + public string? codice_chiusura_4 { get; set; } + + [Display(Name = "CODICE CHIUSURA 5")] + public string? codice_chiusura_5 { get; set; } + + [Display(Name = "CODICE CHIUSURA 6")] + public string? codice_chiusura_6 { get; set; } + + [Display(Name = "CODICE CHIUSURA 7")] + public string? codice_chiusura_7 { get; set; } + + [Display(Name = "CODICE CHIUSURA 8")] + public string? codice_chiusura_8 { get; set; } + + [Display(Name = "CODICE CHIUSURA 9")] + public string? codice_chiusura_9 { get; set; } + + [Display(Name = "CODICE CHIUSURA 10")] + public string? codice_chiusura_10 { get; set; } + + [Display(Name = "DESC. INTERVENTO")] + public string? descrizione_intervento { get; set; } + + [Display(Name = "STATO")] + public string? stato_finale { get; set; } + + [Display(Name = "GENERATO")] + public string? generato { get; set; } + + [Display(Name = "AZ. TECNICO")] + public string? azienda_tecnico { get; set; } + + [Display(Name = "COD. TECNICO")] + public string? codice_tecnico { get; set; } + + [Display(Name = "RIFIUTATA")] + public string? rifiutata { get; set; } + + [Display(Name = "FIRMA")] + public string? firma { get; set; } + + [Display(Name = "INCARICO")] + public string? incarico { get; set; } + + [Display(Name = "DATA VALIDITA'")] + public DateTime data_validita { get; set; } + + [Display(Name = "IMMAGINE")] + public string? immagine { get; set; } + + [Display(Name = "SERIALE BUONO")] + public string? ser_buono { get; set; } + + [Display(Name = "DATA EFFETTIVA")] + public DateTime? data_effettiva { get; set; } + + [Display(Name = "CODICE INTERVENTO")] + public string? codice_intervento { get; set; } + + [Display(Name = "DIFETTI")] + public string? difetti_riscontrati { get; set; } + + [Display(Name = "LAVORO")] + public string? lavoro_eseguito { get; set; } + + [Display(Name = "ESITO")] + public string? esito_intervento { get; set; } + + [Display(Name = "NOTE")] + public string? note_intervento { get; set; } + + [Display(Name = "NUOVO CONTRATTO")] + public string? nuovo_contratto { get; set; } + + [Display(Name = "ORE LAVORO")] + public double? ore_lavoro { get; set; } + + [Display(Name = "CAUSALE")] + public string? causale { get; set; } + + [Display(Name = "MATERIALE")] + public double? materiale { get; set; } + + [Display(Name = "DIRITTO CHIAMATA")] + public double? diritto_chiamata { get; set; } + + [Display(Name = "MANODOPERA")] + public double? manodopera { get; set; } + + [Display(Name = "SPESE VIAGGIO")] + public double? spese_viaggio { get; set; } + + [Display(Name = "PAGAMENTO")] + public string? pagamento { get; set; } + + [Display(Name = "ANTICIPO")] + public double? anticipo { get; set; } + + [Display(Name = "TOTALE")] + public double? totale { get; set; } + + [Display(Name = "NOTE PAGAMENTO")] + public string? note_pagamento { get; set; } + + [Display(Name = "TIPO INTERVENTO")] + public string? tipo_intervento { get; set; } + + [Display(Name = "FOTO 1")] + public string? rafoto { get; set; } + + [Display(Name = "FOTO 2")] + public string? rafoto2 { get; set; } + + [Display(Name = "FOTO 3")] + public string? rafoto3 { get; set; } + + [Display(Name = "FOTO 4")] + public string? rafoto4 { get; set; } + + [Display(Name = "FOTO 5")] + public string? rafoto5 { get; set; } + + [Display(Name = "FOTO 6")] + public string? rafoto6 { get; set; } + + [Display(Name = "FOTO 7")] + public string? rafoto7 { get; set; } + + [Display(Name = "FOTO 8")] + public string? rafoto8 { get; set; } + + [Display(Name = "FOTO 9")] + public string? rafoto9 { get; set; } + + [Display(Name = "FOTO 10")] + public string? rafoto10 { get; set; } + } +} diff --git a/Views/Anag/Create.cshtml b/Views/Anag/Create.cshtml new file mode 100644 index 0000000..b8e3e01 --- /dev/null +++ b/Views/Anag/Create.cshtml @@ -0,0 +1,88 @@ +@model VirtualTask.Models.Anag + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ +

Anag

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} diff --git a/Views/Anag/Delete.cshtml b/Views/Anag/Delete.cshtml new file mode 100644 index 0000000..e0c13a5 --- /dev/null +++ b/Views/Anag/Delete.cshtml @@ -0,0 +1,93 @@ +@model VirtualTask.Models.Anag + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

Anag

+
+
+
+ @Html.DisplayNameFor(model => model.antipcon) +
+
+ @Html.DisplayFor(model => model.antipcon) +
+
+ @Html.DisplayNameFor(model => model.ancodice) +
+
+ @Html.DisplayFor(model => model.ancodice) +
+
+ @Html.DisplayNameFor(model => model.an_email) +
+
+ @Html.DisplayFor(model => model.an_email) +
+
+ @Html.DisplayNameFor(model => model.ancodfis) +
+
+ @Html.DisplayFor(model => model.ancodfis) +
+
+ @Html.DisplayNameFor(model => model.anpariva) +
+
+ @Html.DisplayFor(model => model.anpariva) +
+
+ @Html.DisplayNameFor(model => model.anindiri) +
+
+ @Html.DisplayFor(model => model.anindiri) +
+
+ @Html.DisplayNameFor(model => model.antelefo) +
+
+ @Html.DisplayFor(model => model.antelefo) +
+
+ @Html.DisplayNameFor(model => model.annumcel) +
+
+ @Html.DisplayFor(model => model.annumcel) +
+
+ @Html.DisplayNameFor(model => model.an_empec) +
+
+ @Html.DisplayFor(model => model.an_empec) +
+
+ @Html.DisplayNameFor(model => model.andescri) +
+
+ @Html.DisplayFor(model => model.andescri) +
+
+ @Html.DisplayNameFor(model => model.annumlis) +
+
+ @Html.DisplayFor(model => model.annumlis) +
+
+ @Html.DisplayNameFor(model => model.andtobso) +
+
+ @Html.DisplayFor(model => model.andtobso) +
+
+ +
+ | + model.ancodice) name="id" /> + Back to List +
+
diff --git a/Views/Anag/Details.cshtml b/Views/Anag/Details.cshtml new file mode 100644 index 0000000..dfe0fa3 --- /dev/null +++ b/Views/Anag/Details.cshtml @@ -0,0 +1,90 @@ +@model VirtualTask.Models.Anag + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

Anag

+
+
+
+ @Html.DisplayNameFor(model => model.antipcon) +
+
+ @Html.DisplayFor(model => model.antipcon) +
+
+ @Html.DisplayNameFor(model => model.ancodice) +
+
+ @Html.DisplayFor(model => model.ancodice) +
+
+ @Html.DisplayNameFor(model => model.an_email) +
+
+ @Html.DisplayFor(model => model.an_email) +
+
+ @Html.DisplayNameFor(model => model.ancodfis) +
+
+ @Html.DisplayFor(model => model.ancodfis) +
+
+ @Html.DisplayNameFor(model => model.anpariva) +
+
+ @Html.DisplayFor(model => model.anpariva) +
+
+ @Html.DisplayNameFor(model => model.anindiri) +
+
+ @Html.DisplayFor(model => model.anindiri) +
+
+ @Html.DisplayNameFor(model => model.antelefo) +
+
+ @Html.DisplayFor(model => model.antelefo) +
+
+ @Html.DisplayNameFor(model => model.annumcel) +
+
+ @Html.DisplayFor(model => model.annumcel) +
+
+ @Html.DisplayNameFor(model => model.an_empec) +
+
+ @Html.DisplayFor(model => model.an_empec) +
+
+ @Html.DisplayNameFor(model => model.andescri) +
+
+ @Html.DisplayFor(model => model.andescri) +
+
+ @Html.DisplayNameFor(model => model.annumlis) +
+
+ @Html.DisplayFor(model => model.annumlis) +
+
+ @Html.DisplayNameFor(model => model.andtobso) +
+
+ @Html.DisplayFor(model => model.andtobso) +
+
+
+
+ @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | + Back to List +
diff --git a/Views/Anag/Edit.cshtml b/Views/Anag/Edit.cshtml new file mode 100644 index 0000000..ab7e7bd --- /dev/null +++ b/Views/Anag/Edit.cshtml @@ -0,0 +1,88 @@ +@model VirtualTask.Models.Anag + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +

Anag

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} diff --git a/Views/Anag/Index.cshtml b/Views/Anag/Index.cshtml index 77eb92c..1e4b431 100644 --- a/Views/Anag/Index.cshtml +++ b/Views/Anag/Index.cshtml @@ -106,9 +106,9 @@ @Html.DisplayFor(modelItem => item.andtobso) *@ - @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) | - @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | - @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) + @Html.ActionLink("Edit", "Edit", new { id = item.ancodice }) | + @Html.ActionLink("Details", "Details", new { id = item.ancodice }) | + @Html.ActionLink("Delete", "Delete", new { id = item.ancodice }) } diff --git a/Views/Chiusure/Delete.cshtml b/Views/Chiusure/Delete.cshtml index 98e3cf9..cc20237 100644 --- a/Views/Chiusure/Delete.cshtml +++ b/Views/Chiusure/Delete.cshtml @@ -135,6 +135,7 @@
| + model.cccodice) name="id" /> Back to List
diff --git a/Views/Chiusure/Index.cshtml b/Views/Chiusure/Index.cshtml index 4000db0..e5f6a81 100644 --- a/Views/Chiusure/Index.cshtml +++ b/Views/Chiusure/Index.cshtml @@ -1,5 +1,10 @@ -@model IEnumerable +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; +@using X.PagedList; +@model IPagedList + + @{ ViewData["Title"] = "Index"; } @@ -9,20 +14,31 @@

Create New

+@using (Html.BeginForm()) +{ +

+ Find by name: @Html.TextBox("SearchString") + +

+} @@ -37,7 +53,7 @@ + @* => *@ @@ -57,3 +73,18 @@ }
- @Html.DisplayNameFor(model => model.cccodazi) + @* @Html.DisplayNameFor(model => model.cccodazi) *@ + AZIENDA - @Html.DisplayNameFor(model => model.cccodice) + @* @Html.DisplayNameFor(model => model.cccodice) *@ + CODICE - @Html.DisplayNameFor(model => model.ccdescr) + @* @Html.DisplayNameFor(model => model.ccdescr) *@ + DESCRIZIONE - @Html.DisplayNameFor(model => model.ccdessup) + @* @Html.DisplayNameFor(model => model.ccdessup) *@ + DESC. SUP.
@Html.DisplayFor(modelItem => item.cccodazi) - @Html.DisplayFor(modelItem => item.cccodice)
+
+ diff --git a/Views/Rapp_New/Create.cshtml b/Views/Rapp_New/Create.cshtml new file mode 100644 index 0000000..d33a52f --- /dev/null +++ b/Views/Rapp_New/Create.cshtml @@ -0,0 +1,333 @@ +@model VirtualTask.Models.Rapp_New + +@{ + ViewData["Title"] = "Create"; +} + +

Create

+ +

Rapp_New

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} diff --git a/Views/Rapp_New/Delete.cshtml b/Views/Rapp_New/Delete.cshtml new file mode 100644 index 0000000..4ecc587 --- /dev/null +++ b/Views/Rapp_New/Delete.cshtml @@ -0,0 +1,387 @@ +@model VirtualTask.Models.Rapp_New + +@{ + ViewData["Title"] = "Delete"; +} + +

Delete

+ +

Are you sure you want to delete this?

+
+

Rapp_New

+
+
+
+ @Html.DisplayNameFor(model => model.seriale_rapportino) +
+
+ @Html.DisplayFor(model => model.seriale_rapportino) +
+
+ @Html.DisplayNameFor(model => model.tipo_rapportino) +
+
+ @Html.DisplayFor(model => model.tipo_rapportino) +
+
+ @Html.DisplayNameFor(model => model.azienda_impianto) +
+
+ @Html.DisplayFor(model => model.azienda_impianto) +
+
+ @Html.DisplayNameFor(model => model.codice_impianto) +
+
+ @Html.DisplayFor(model => model.codice_impianto) +
+
+ @Html.DisplayNameFor(model => model.azienda_chiamata) +
+
+ @Html.DisplayFor(model => model.azienda_chiamata) +
+
+ @Html.DisplayNameFor(model => model.seriale_chiamata) +
+
+ @Html.DisplayFor(model => model.seriale_chiamata) +
+
+ @Html.DisplayNameFor(model => model.seriale_commessa) +
+
+ @Html.DisplayFor(model => model.seriale_commessa) +
+
+ @Html.DisplayNameFor(model => model.data_rapportino) +
+
+ @Html.DisplayFor(model => model.data_rapportino) +
+
+ @Html.DisplayNameFor(model => model.ora_ini_rapportino) +
+
+ @Html.DisplayFor(model => model.ora_ini_rapportino) +
+
+ @Html.DisplayNameFor(model => model.min_ini_rapportino) +
+
+ @Html.DisplayFor(model => model.min_ini_rapportino) +
+
+ @Html.DisplayNameFor(model => model.ora_fin_rapportino) +
+
+ @Html.DisplayFor(model => model.ora_fin_rapportino) +
+
+ @Html.DisplayNameFor(model => model.min_fin_rapportino) +
+
+ @Html.DisplayFor(model => model.min_fin_rapportino) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_1) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_1) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_2) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_2) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_3) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_3) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_4) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_4) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_5) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_5) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_6) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_6) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_7) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_7) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_8) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_8) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_9) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_9) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_10) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_10) +
+
+ @Html.DisplayNameFor(model => model.descrizione_intervento) +
+
+ @Html.DisplayFor(model => model.descrizione_intervento) +
+
+ @Html.DisplayNameFor(model => model.stato_finale) +
+
+ @Html.DisplayFor(model => model.stato_finale) +
+
+ @Html.DisplayNameFor(model => model.generato) +
+
+ @Html.DisplayFor(model => model.generato) +
+
+ @Html.DisplayNameFor(model => model.azienda_tecnico) +
+
+ @Html.DisplayFor(model => model.azienda_tecnico) +
+
+ @Html.DisplayNameFor(model => model.codice_tecnico) +
+
+ @Html.DisplayFor(model => model.codice_tecnico) +
+
+ @Html.DisplayNameFor(model => model.rifiutata) +
+
+ @Html.DisplayFor(model => model.rifiutata) +
+
+ @Html.DisplayNameFor(model => model.firma) +
+
+ @Html.DisplayFor(model => model.firma) +
+
+ @Html.DisplayNameFor(model => model.incarico) +
+
+ @Html.DisplayFor(model => model.incarico) +
+
+ @Html.DisplayNameFor(model => model.data_validita) +
+
+ @Html.DisplayFor(model => model.data_validita) +
+
+ @Html.DisplayNameFor(model => model.immagine) +
+
+ @Html.DisplayFor(model => model.immagine) +
+
+ @Html.DisplayNameFor(model => model.ser_buono) +
+
+ @Html.DisplayFor(model => model.ser_buono) +
+
+ @Html.DisplayNameFor(model => model.data_effettiva) +
+
+ @Html.DisplayFor(model => model.data_effettiva) +
+
+ @Html.DisplayNameFor(model => model.codice_intervento) +
+
+ @Html.DisplayFor(model => model.codice_intervento) +
+
+ @Html.DisplayNameFor(model => model.difetti_riscontrati) +
+
+ @Html.DisplayFor(model => model.difetti_riscontrati) +
+
+ @Html.DisplayNameFor(model => model.lavoro_eseguito) +
+
+ @Html.DisplayFor(model => model.lavoro_eseguito) +
+
+ @Html.DisplayNameFor(model => model.esito_intervento) +
+
+ @Html.DisplayFor(model => model.esito_intervento) +
+
+ @Html.DisplayNameFor(model => model.note_intervento) +
+
+ @Html.DisplayFor(model => model.note_intervento) +
+
+ @Html.DisplayNameFor(model => model.nuovo_contratto) +
+
+ @Html.DisplayFor(model => model.nuovo_contratto) +
+
+ @Html.DisplayNameFor(model => model.ore_lavoro) +
+
+ @Html.DisplayFor(model => model.ore_lavoro) +
+
+ @Html.DisplayNameFor(model => model.causale) +
+
+ @Html.DisplayFor(model => model.causale) +
+
+ @Html.DisplayNameFor(model => model.materiale) +
+
+ @Html.DisplayFor(model => model.materiale) +
+
+ @Html.DisplayNameFor(model => model.diritto_chiamata) +
+
+ @Html.DisplayFor(model => model.diritto_chiamata) +
+
+ @Html.DisplayNameFor(model => model.manodopera) +
+
+ @Html.DisplayFor(model => model.manodopera) +
+
+ @Html.DisplayNameFor(model => model.spese_viaggio) +
+
+ @Html.DisplayFor(model => model.spese_viaggio) +
+
+ @Html.DisplayNameFor(model => model.pagamento) +
+
+ @Html.DisplayFor(model => model.pagamento) +
+
+ @Html.DisplayNameFor(model => model.anticipo) +
+
+ @Html.DisplayFor(model => model.anticipo) +
+
+ @Html.DisplayNameFor(model => model.totale) +
+
+ @Html.DisplayFor(model => model.totale) +
+
+ @Html.DisplayNameFor(model => model.note_pagamento) +
+
+ @Html.DisplayFor(model => model.note_pagamento) +
+
+ @Html.DisplayNameFor(model => model.tipo_intervento) +
+
+ @Html.DisplayFor(model => model.tipo_intervento) +
+
+ @Html.DisplayNameFor(model => model.rafoto) +
+
+ @Html.DisplayFor(model => model.rafoto) +
+
+ @Html.DisplayNameFor(model => model.rafoto2) +
+
+ @Html.DisplayFor(model => model.rafoto2) +
+
+ @Html.DisplayNameFor(model => model.rafoto3) +
+
+ @Html.DisplayFor(model => model.rafoto3) +
+
+ @Html.DisplayNameFor(model => model.rafoto4) +
+
+ @Html.DisplayFor(model => model.rafoto4) +
+
+ @Html.DisplayNameFor(model => model.rafoto5) +
+
+ @Html.DisplayFor(model => model.rafoto5) +
+
+ @Html.DisplayNameFor(model => model.rafoto6) +
+
+ @Html.DisplayFor(model => model.rafoto6) +
+
+ @Html.DisplayNameFor(model => model.rafoto7) +
+
+ @Html.DisplayFor(model => model.rafoto7) +
+
+ @Html.DisplayNameFor(model => model.rafoto8) +
+
+ @Html.DisplayFor(model => model.rafoto8) +
+
+ @Html.DisplayNameFor(model => model.rafoto9) +
+
+ @Html.DisplayFor(model => model.rafoto9) +
+
+ @Html.DisplayNameFor(model => model.rafoto10) +
+
+ @Html.DisplayFor(model => model.rafoto10) +
+
+ +
+ | + model.seriale_rapportino) name="id" /> + Back to List +
+
diff --git a/Views/Rapp_New/Details.cshtml b/Views/Rapp_New/Details.cshtml new file mode 100644 index 0000000..46745d6 --- /dev/null +++ b/Views/Rapp_New/Details.cshtml @@ -0,0 +1,384 @@ +@model VirtualTask.Models.Rapp_New + +@{ + ViewData["Title"] = "Details"; +} + +

Details

+ +
+

Rapp_New

+
+
+
+ @Html.DisplayNameFor(model => model.seriale_rapportino) +
+
+ @Html.DisplayFor(model => model.seriale_rapportino) +
+
+ @Html.DisplayNameFor(model => model.tipo_rapportino) +
+
+ @Html.DisplayFor(model => model.tipo_rapportino) +
+
+ @Html.DisplayNameFor(model => model.azienda_impianto) +
+
+ @Html.DisplayFor(model => model.azienda_impianto) +
+
+ @Html.DisplayNameFor(model => model.codice_impianto) +
+
+ @Html.DisplayFor(model => model.codice_impianto) +
+
+ @Html.DisplayNameFor(model => model.azienda_chiamata) +
+
+ @Html.DisplayFor(model => model.azienda_chiamata) +
+
+ @Html.DisplayNameFor(model => model.seriale_chiamata) +
+
+ @Html.DisplayFor(model => model.seriale_chiamata) +
+
+ @Html.DisplayNameFor(model => model.seriale_commessa) +
+
+ @Html.DisplayFor(model => model.seriale_commessa) +
+
+ @Html.DisplayNameFor(model => model.data_rapportino) +
+
+ @Html.DisplayFor(model => model.data_rapportino) +
+
+ @Html.DisplayNameFor(model => model.ora_ini_rapportino) +
+
+ @Html.DisplayFor(model => model.ora_ini_rapportino) +
+
+ @Html.DisplayNameFor(model => model.min_ini_rapportino) +
+
+ @Html.DisplayFor(model => model.min_ini_rapportino) +
+
+ @Html.DisplayNameFor(model => model.ora_fin_rapportino) +
+
+ @Html.DisplayFor(model => model.ora_fin_rapportino) +
+
+ @Html.DisplayNameFor(model => model.min_fin_rapportino) +
+
+ @Html.DisplayFor(model => model.min_fin_rapportino) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_1) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_1) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_2) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_2) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_3) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_3) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_4) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_4) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_5) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_5) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_6) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_6) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_7) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_7) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_8) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_8) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_9) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_9) +
+
+ @Html.DisplayNameFor(model => model.codice_chiusura_10) +
+
+ @Html.DisplayFor(model => model.codice_chiusura_10) +
+
+ @Html.DisplayNameFor(model => model.descrizione_intervento) +
+
+ @Html.DisplayFor(model => model.descrizione_intervento) +
+
+ @Html.DisplayNameFor(model => model.stato_finale) +
+
+ @Html.DisplayFor(model => model.stato_finale) +
+
+ @Html.DisplayNameFor(model => model.generato) +
+
+ @Html.DisplayFor(model => model.generato) +
+
+ @Html.DisplayNameFor(model => model.azienda_tecnico) +
+
+ @Html.DisplayFor(model => model.azienda_tecnico) +
+
+ @Html.DisplayNameFor(model => model.codice_tecnico) +
+
+ @Html.DisplayFor(model => model.codice_tecnico) +
+
+ @Html.DisplayNameFor(model => model.rifiutata) +
+
+ @Html.DisplayFor(model => model.rifiutata) +
+
+ @Html.DisplayNameFor(model => model.firma) +
+
+ @Html.DisplayFor(model => model.firma) +
+
+ @Html.DisplayNameFor(model => model.incarico) +
+
+ @Html.DisplayFor(model => model.incarico) +
+
+ @Html.DisplayNameFor(model => model.data_validita) +
+
+ @Html.DisplayFor(model => model.data_validita) +
+
+ @Html.DisplayNameFor(model => model.immagine) +
+
+ @Html.DisplayFor(model => model.immagine) +
+
+ @Html.DisplayNameFor(model => model.ser_buono) +
+
+ @Html.DisplayFor(model => model.ser_buono) +
+
+ @Html.DisplayNameFor(model => model.data_effettiva) +
+
+ @Html.DisplayFor(model => model.data_effettiva) +
+
+ @Html.DisplayNameFor(model => model.codice_intervento) +
+
+ @Html.DisplayFor(model => model.codice_intervento) +
+
+ @Html.DisplayNameFor(model => model.difetti_riscontrati) +
+
+ @Html.DisplayFor(model => model.difetti_riscontrati) +
+
+ @Html.DisplayNameFor(model => model.lavoro_eseguito) +
+
+ @Html.DisplayFor(model => model.lavoro_eseguito) +
+
+ @Html.DisplayNameFor(model => model.esito_intervento) +
+
+ @Html.DisplayFor(model => model.esito_intervento) +
+
+ @Html.DisplayNameFor(model => model.note_intervento) +
+
+ @Html.DisplayFor(model => model.note_intervento) +
+
+ @Html.DisplayNameFor(model => model.nuovo_contratto) +
+
+ @Html.DisplayFor(model => model.nuovo_contratto) +
+
+ @Html.DisplayNameFor(model => model.ore_lavoro) +
+
+ @Html.DisplayFor(model => model.ore_lavoro) +
+
+ @Html.DisplayNameFor(model => model.causale) +
+
+ @Html.DisplayFor(model => model.causale) +
+
+ @Html.DisplayNameFor(model => model.materiale) +
+
+ @Html.DisplayFor(model => model.materiale) +
+
+ @Html.DisplayNameFor(model => model.diritto_chiamata) +
+
+ @Html.DisplayFor(model => model.diritto_chiamata) +
+
+ @Html.DisplayNameFor(model => model.manodopera) +
+
+ @Html.DisplayFor(model => model.manodopera) +
+
+ @Html.DisplayNameFor(model => model.spese_viaggio) +
+
+ @Html.DisplayFor(model => model.spese_viaggio) +
+
+ @Html.DisplayNameFor(model => model.pagamento) +
+
+ @Html.DisplayFor(model => model.pagamento) +
+
+ @Html.DisplayNameFor(model => model.anticipo) +
+
+ @Html.DisplayFor(model => model.anticipo) +
+
+ @Html.DisplayNameFor(model => model.totale) +
+
+ @Html.DisplayFor(model => model.totale) +
+
+ @Html.DisplayNameFor(model => model.note_pagamento) +
+
+ @Html.DisplayFor(model => model.note_pagamento) +
+
+ @Html.DisplayNameFor(model => model.tipo_intervento) +
+
+ @Html.DisplayFor(model => model.tipo_intervento) +
+
+ @Html.DisplayNameFor(model => model.rafoto) +
+
+ @Html.DisplayFor(model => model.rafoto) +
+
+ @Html.DisplayNameFor(model => model.rafoto2) +
+
+ @Html.DisplayFor(model => model.rafoto2) +
+
+ @Html.DisplayNameFor(model => model.rafoto3) +
+
+ @Html.DisplayFor(model => model.rafoto3) +
+
+ @Html.DisplayNameFor(model => model.rafoto4) +
+
+ @Html.DisplayFor(model => model.rafoto4) +
+
+ @Html.DisplayNameFor(model => model.rafoto5) +
+
+ @Html.DisplayFor(model => model.rafoto5) +
+
+ @Html.DisplayNameFor(model => model.rafoto6) +
+
+ @Html.DisplayFor(model => model.rafoto6) +
+
+ @Html.DisplayNameFor(model => model.rafoto7) +
+
+ @Html.DisplayFor(model => model.rafoto7) +
+
+ @Html.DisplayNameFor(model => model.rafoto8) +
+
+ @Html.DisplayFor(model => model.rafoto8) +
+
+ @Html.DisplayNameFor(model => model.rafoto9) +
+
+ @Html.DisplayFor(model => model.rafoto9) +
+
+ @Html.DisplayNameFor(model => model.rafoto10) +
+
+ @Html.DisplayFor(model => model.rafoto10) +
+
+
+
+ @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | + Back to List +
diff --git a/Views/Rapp_New/Edit.cshtml b/Views/Rapp_New/Edit.cshtml new file mode 100644 index 0000000..be2fb06 --- /dev/null +++ b/Views/Rapp_New/Edit.cshtml @@ -0,0 +1,333 @@ +@model VirtualTask.Models.Rapp_New + +@{ + ViewData["Title"] = "Edit"; +} + +

Edit

+ +

Rapp_New

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} diff --git a/Views/Rapp_New/Index.cshtml b/Views/Rapp_New/Index.cshtml new file mode 100644 index 0000000..58ce3cf --- /dev/null +++ b/Views/Rapp_New/Index.cshtml @@ -0,0 +1,486 @@ +@model IPagedList +@using X.PagedList; +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; + + + + + + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+@using (Html.BeginForm()) +{ +

+ Find by name: @Html.TextBox("SearchString") + +

+} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + +
+ @* @Html.DisplayNameFor(model => model.seriale_rapportino) *@ + SERIALE RAPPORTINO + + @* @Html.DisplayNameFor(model => model.tipo_rapportino) *@ + TIPO RAPPORTINI + + @* @Html.DisplayNameFor(model => model.azienda_impianto) *@ + AZIENDA + + @* @Html.DisplayNameFor(model => model.codice_impianto) *@ + CODICE IMPIANTO + + @* @Html.DisplayNameFor(model => model.azienda_chiamata) *@ + AZ. CHIAMATA + + @* @Html.DisplayNameFor(model => model.seriale_chiamata) *@ + SERIALE CHIAMATA + + @* @Html.DisplayNameFor(model => model.seriale_commessa) *@ + SERIALE COMMESSA + + @* @Html.DisplayNameFor(model => model.data_rapportino) *@ + DATA RAPPORTINO +
+ @Html.DisplayFor(modelItem => item.seriale_rapportino) + + @Html.DisplayFor(modelItem => item.tipo_rapportino) + + @Html.DisplayFor(modelItem => item.azienda_impianto) + + @Html.DisplayFor(modelItem => item.codice_impianto) + + @Html.DisplayFor(modelItem => item.azienda_chiamata) + + @Html.DisplayFor(modelItem => item.seriale_chiamata) + + @Html.DisplayFor(modelItem => item.seriale_commessa) + + @Html.DisplayFor(modelItem => item.data_rapportino) + + @Html.ActionLink("Edit", "Edit", new { id=item.seriale_rapportino }) | + @Html.ActionLink("Details", "Details", new { id=item.seriale_rapportino }) | + @Html.ActionLink("Delete", "Delete", new { id=item.seriale_rapportino }) +
+
+ diff --git a/Views/Tecnici/Index.cshtml b/Views/Tecnici/Index.cshtml index 21c341d..566bc51 100644 --- a/Views/Tecnici/Index.cshtml +++ b/Views/Tecnici/Index.cshtml @@ -1,4 +1,12 @@ -@model IEnumerable +@* @model IEnumerable *@ +@model IPagedList +@using X.PagedList; +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; + + + + @{ ViewData["Title"] = "Index"; @@ -9,38 +17,55 @@

Create New

+@using (Html.BeginForm()) +{ +

+ Find by name: @Html.TextBox("SearchString") + +

+} - - - - @@ -66,16 +91,16 @@ - - - -
- @Html.DisplayNameFor(model => model.tccodazi) + @* @Html.DisplayNameFor(model => model.tccodazi) *@ + AZIENDA - @Html.DisplayNameFor(model => model.tccodice) + @* @Html.DisplayNameFor(model => model.tccodice) *@ + CODICE - @Html.DisplayNameFor(model => model.tcdescri) + @* @Html.DisplayNameFor(model => model.tcdescri) *@ + DESCRIZIONE - @Html.DisplayNameFor(model => model.tctelef1) + @* @Html.DisplayNameFor(model => model.tctelef1) *@ + TEL. - @Html.DisplayNameFor(model => model.tcuser) + @* @Html.DisplayNameFor(model => model.tcuser) *@ + UTENTE - @Html.DisplayNameFor(model => model.tcpwd) + @* @Html.DisplayNameFor(model => model.tcpwd) *@ + PASSWORD - @Html.DisplayNameFor(model => model.tccoor) + - @Html.DisplayNameFor(model => model.tccono) + - @Html.DisplayNameFor(model => model.tccost) + - @Html.DisplayNameFor(model => model.tccofe) +
@Html.DisplayFor(modelItem => item.tcpwd) + + + + @@ -87,3 +112,18 @@ }
+