From b49ccc793411d5b7b8f411fb907c4325e672948c Mon Sep 17 00:00:00 2001 From: michele Date: Mon, 12 May 2025 15:44:21 +0200 Subject: [PATCH] Gestione Codici segnalazione azienda lunghezza strettamente 5 + correzioni varie --- Controllers/ArticoliController.cs | 1 - Controllers/CodSegnaController.cs | 350 +++++++++++++++++++++++ Controllers/RapportiniController.cs | 98 +++++-- Models/CodiceSegnalazione.cs | 29 ++ Models/Registrazione.cs | 5 +- Views/CodSegna/Create.cshtml | 59 ++++ Views/CodSegna/Delete.cshtml | 102 +++++++ Views/CodSegna/Details.cshtml | 90 ++++++ Views/CodSegna/Edit.cshtml | 131 +++++++++ Views/CodSegna/Index.cshtml | 111 +++++++ Views/Shared/_LayoutAreaRiservata.cshtml | 1 + 11 files changed, 957 insertions(+), 20 deletions(-) create mode 100644 Controllers/CodSegnaController.cs create mode 100644 Models/CodiceSegnalazione.cs create mode 100644 Views/CodSegna/Create.cshtml create mode 100644 Views/CodSegna/Delete.cshtml create mode 100644 Views/CodSegna/Details.cshtml create mode 100644 Views/CodSegna/Edit.cshtml create mode 100644 Views/CodSegna/Index.cshtml diff --git a/Controllers/ArticoliController.cs b/Controllers/ArticoliController.cs index ca836e0..a7a3a31 100644 --- a/Controllers/ArticoliController.cs +++ b/Controllers/ArticoliController.cs @@ -10,7 +10,6 @@ namespace VirtualTask.Controllers { public class ArticoliController : Controller { - string apiUrl = string.Empty; string urlBase = string.Empty; string token = string.Empty; diff --git a/Controllers/CodSegnaController.cs b/Controllers/CodSegnaController.cs new file mode 100644 index 0000000..fb49691 --- /dev/null +++ b/Controllers/CodSegnaController.cs @@ -0,0 +1,350 @@ +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.Diagnostics; +using System.Text; +using VirtualTask.Models; +using X.PagedList; + +namespace VirtualTask.Controllers +{ + public class CodSegnaController : Controller + { + string apiUrl = string.Empty; + string urlBase = string.Empty; + string token = string.Empty; + string tenant = string.Empty; + string tenant2 = string.Empty; + string errMes = string.Empty; + string admin = string.Empty; + string time_sheet = string.Empty; + HttpClient client; + private readonly IConfiguration _configuration; + + public CodSegnaController(IConfiguration configuration) + { + _configuration = configuration; + var key = _configuration["ApplicationInsights:rootUrlApi"]; + apiUrl = key; + client = new HttpClient(); + } + + #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("Login2", "Login"); + } + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + time_sheet = helper.GetStringValue("time_sheet"); + ViewBag.TimeSheet = time_sheet; + urlBase = apiUrl + "CodiciSegnalazioniVTList"; + 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); + modelList = modelList.Where(x => x.DataObso == null).ToList(); + + if (!string.IsNullOrEmpty(searchString)) + { + modelList = modelList.Where(s => s.csdescr.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 + .OrderBy(s => s.cscodice) + .ToPagedList(page ?? 1, pageSize); + + return View(shortLinks); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } + + #endregion INDEX + + #region CREATE + + public IActionResult Create() + { + SessionHelper helper = new SessionHelper(this); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + + return View(); + } + + [HttpPost] + public IActionResult Create(CodiceSegnalazione model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); + + if (string.IsNullOrEmpty(token)) + { + return RedirectToAction("Login2", "Login"); + } + + model.cscodazi = tenant; + + //model.Desc_sup = model.ArDesArt; + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "CodiciSegnalazioniVT/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"); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } + + #endregion CREATE + + #region DETAILS + + public IActionResult Details(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "CodiciSegnalazioniVTList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + CodiceSegnalazione cod = new CodiceSegnalazione(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + cod = modelList.Where(x => x.cscodice.Equals(id)).First(); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + return View(cod); + } + + #endregion DETAILS + + #region EDIT + + public IActionResult Edit(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "CodiciSegnalazioniVTList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + CodiceSegnalazione ele = new CodiceSegnalazione(); + + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + var el = modelList.Where(t => t.cscodice.Equals(id)).First(); + ele = el; + + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + //ViewBag.Magazzini = MagazziniList(); + return View(ele); + } + + [HttpPost] + public IActionResult Edit(CodiceSegnalazione model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); + if (string.IsNullOrEmpty(token)) + { + return RedirectToAction("Index", "Login"); + } + + model.cscodazi = tenant; + //model.Desc_sup = model.ArDesArt; + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "CodiciSegnalazioniVT/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"); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } + + #endregion EDIT + + #region DELETE + + [HttpGet] + public IActionResult Delete(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "CodiciSegnalazioniVTList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + CodiceSegnalazione elem = new CodiceSegnalazione(); + List modelList = new List(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + elem = modelList.Where(t => t.cscodice.Equals(id)).First(); + return View(elem); + } + 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); + + token = helper.GetStringValue("tok"); + + apiUrl = helper.GetStringValue("apiUrl"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "CodiciSegnalazioniVT/del?" + "codSegn=" + 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"); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } + + #endregion DELETE + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + SessionHelper helper = new SessionHelper(this); + string e = helper.GetStringValue("errMsg"); + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e }); + } + } +} diff --git a/Controllers/RapportiniController.cs b/Controllers/RapportiniController.cs index 93e7a2e..2ff7663 100644 --- a/Controllers/RapportiniController.cs +++ b/Controllers/RapportiniController.cs @@ -72,7 +72,19 @@ namespace VirtualTask.Controllers string data = response.Content.ReadAsStringAsync().Result; modelList = JsonConvert.DeserializeObject>(data); - ViewBag.Rapportini = getImpianti(); + string urlImpianti = apiUrl + "impiantiListMngr?token=" + token; + HttpResponseMessage responseImpianti = client.GetAsync(urlImpianti).Result; + + List impiantiList = new List(); + + if (responseImpianti.IsSuccessStatusCode) + { + string dataImpianti = responseImpianti.Content.ReadAsStringAsync().Result; + impiantiList = JsonConvert.DeserializeObject>(dataImpianti); + ViewBag.Impianti = impiantiList; + } + + ViewBag.Rapportini = getImpianti(null); if (!string.IsNullOrEmpty(impianto)) { @@ -267,24 +279,35 @@ namespace VirtualTask.Controllers } } - private List getImpianti() + private List getImpianti(string impianto) { SessionHelper helper = new SessionHelper(this); + + //if (!string.IsNullOrEmpty(impianto)) + //{ + // helper.SetStringValue("imp", impianto); + //} + //else + //{ + // helper.SetStringValue("imp", ""); + //} + token = helper.GetStringValue("tok"); apiUrl = helper.GetStringValue("apiUrl"); - urlBase = apiUrl + "rapportiniList"; + urlBase = apiUrl + "impiantiListMngr"; urlBase = urlBase + "?token=" + token; Uri baseAddress = new Uri(urlBase); client = new HttpClient(); client.BaseAddress = baseAddress; List selectItems = new List(); - List modelList = new List(); + List modelList = new List(); HttpResponseMessage response = client.GetAsync(baseAddress).Result; if (response.IsSuccessStatusCode) { string data = response.Content.ReadAsStringAsync().Result; - modelList = JsonConvert.DeserializeObject>(data); - + modelList = JsonConvert.DeserializeObject>(data); + modelList = modelList.Where(x => x.imfinatt == null).ToList(); + //per gestire primo elemento tendina (deve essere vuoto) SelectListItem listItemFirt = new SelectListItem(); @@ -292,26 +315,67 @@ namespace VirtualTask.Controllers listItemFirt.Text = " - Impianto"; selectItems.Add(listItemFirt); - var appoggio = string.Empty; - foreach (var role in modelList) { - if (!appoggio.Equals(role.codice_impianto)) + SelectListItem listItem = new SelectListItem(); + string s = role.imcodimp + " - " + role.imdescri; + listItem.Value = role.imcodimp; + listItem.Text = s; + if (role.imcodimp != null && role.imcodimp.Equals(impianto)) { - SelectListItem listItem = new SelectListItem(); - string s = role.codice_impianto; - listItem.Value = role.codice_impianto; - listItem.Text = s; - selectItems.Add(listItem); + listItem.Selected = true; } - - appoggio = role.codice_impianto; + selectItems.Add(listItem); } } - return selectItems; } + //private List getImpianti() + //{ + // SessionHelper helper = new SessionHelper(this); + // token = helper.GetStringValue("tok"); + // apiUrl = helper.GetStringValue("apiUrl"); + // urlBase = apiUrl + "rapportiniList"; + // urlBase = urlBase + "?token=" + token; + // Uri baseAddress = new Uri(urlBase); + // client = new HttpClient(); + // client.BaseAddress = baseAddress; + // List selectItems = new List(); + // List modelList = new List(); + // HttpResponseMessage response = client.GetAsync(baseAddress).Result; + // if (response.IsSuccessStatusCode) + // { + // string data = response.Content.ReadAsStringAsync().Result; + // modelList = JsonConvert.DeserializeObject>(data); + + // //per gestire primo elemento tendina (deve essere vuoto) + // SelectListItem listItemFirt = new SelectListItem(); + + // listItemFirt.Value = string.Empty; + // listItemFirt.Text = " - Impianto"; + // selectItems.Add(listItemFirt); + + // var appoggio = string.Empty; + + // foreach (var role in modelList) + // { + // if (!appoggio.Equals(role.codice_impianto)) + // { + // SelectListItem listItem = new SelectListItem(); + // string s = role.codice_impianto; + // listItem.Value = role.codice_impianto; + // listItem.Text = s; + // selectItems.Add(listItem); + // } + + // appoggio = role.codice_impianto; + // } + // } + + // return selectItems; + //} + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/Models/CodiceSegnalazione.cs b/Models/CodiceSegnalazione.cs new file mode 100644 index 0000000..faac4e3 --- /dev/null +++ b/Models/CodiceSegnalazione.cs @@ -0,0 +1,29 @@ +using System.ComponentModel.DataAnnotations; + +namespace VirtualTask.Models +{ + public class CodiceSegnalazione + { + [Display(Name = "Codice"), Required(ErrorMessage = "Inserire codice")] + [StringLength(15)] + public string? cscodice { get; set; } + + [Display(Name = "Descrizione"), Required(ErrorMessage = "Inserire una descrizione")] + [StringLength(30)] + public string? csdescr { get; set; } + + [Display(Name = "Fermo impianto")] + [StringLength(1)] + public string? csferimp { get; set; } + + [Display(Name = "Azienda")] + public string? cscodazi { get; set; } + + [Display(Name = "Tipo segnalazione")] + [StringLength(1)] + public string? cstipseg { get; set; } + + [Display(Name = "Data obsoles")] + public DateTime? DataObso { get; set; } + } +} diff --git a/Models/Registrazione.cs b/Models/Registrazione.cs index 35d7722..5b3095c 100644 --- a/Models/Registrazione.cs +++ b/Models/Registrazione.cs @@ -32,8 +32,9 @@ namespace VirtualTask.Models [Display(Name = "Conferma Email"), Required(ErrorMessage = "Conferma Email obbligatorio")] public string? emailConf { get; set;} - [Display(Name = "Codice azienda (max lunghezza 5)"), Required(ErrorMessage = "Azienda obbligatorio")] - [StringLength(5)] + [Display(Name = "Codice azienda (lunghezza 5)"), Required(ErrorMessage = "Azienda obbligatorio")] + [RegularExpression(@"^.{5}$", ErrorMessage = "Il codice azienda deve essere lungo esattamente 5 caratteri.")] + //[StringLength(5)] public string? azienda { get; set; } [Display(Name = "Username"), Required(ErrorMessage = "Username obbligatorio")] diff --git a/Views/CodSegna/Create.cshtml b/Views/CodSegna/Create.cshtml new file mode 100644 index 0000000..2b263a1 --- /dev/null +++ b/Views/CodSegna/Create.cshtml @@ -0,0 +1,59 @@ +@model VirtualTask.Models.CodiceSegnalazione + +@{ + ViewData["Title"] = "Nuovo codice segnalazione"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + +
+
+
+
+
+
+
+
 
+
+
+ + +
+
 
+
+
+ + +
+
 
+
+
+ + +
+
 
+
+
+ + +
+ +
 
+ + + @Html.HiddenFor(x => x.cscodazi) + @Html.HiddenFor(x => x.DataObso) + +
+
+
+ @section Scripts { + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } + } +
+
+
diff --git a/Views/CodSegna/Delete.cshtml b/Views/CodSegna/Delete.cshtml new file mode 100644 index 0000000..ee8d6bb --- /dev/null +++ b/Views/CodSegna/Delete.cshtml @@ -0,0 +1,102 @@ +@model VirtualTask.Models.CodiceSegnalazione + +@{ + ViewData["Title"] = "Elimina codice segnalazione"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + + +
+
+
+
+
+
+ @Html.DisplayNameFor(model => model.cscodice)   @Html.DisplayFor(model => model.cscodice) +
+
+ @Html.DisplayNameFor(model => model.csdescr)   @Html.DisplayFor(model => model.csdescr) +
+
+ @Html.DisplayNameFor(model => model.csferimp)   @Html.DisplayFor(model => model.csferimp) +
+
+ @Html.DisplayNameFor(model => model.cscodazi)   @Html.DisplayFor(model => model.cscodazi) +
+
+ @Html.DisplayNameFor(model => model.cstipseg)   @Html.DisplayFor(model => model.cstipseg) +
+ + @Html.HiddenFor(x => x.DataObso) + +
+
 
+
+
+ + model.cscodice) name="id" /> + Torna alla lista +
+
+
+
+
+
+ + +@* @model VirtualTask.Models.CodiceSegnalazione *@ + +@* @{ *@ +@* ViewData["Title"] = "Delete"; *@ +@* } *@ + +@*

Delete

*@ + +@*

Are you sure you want to delete this?

*@ +@*
*@ +@*

CodiceSegnalazione

*@ +@*
*@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cscodice) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cscodice) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.csdescr) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.csdescr) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.csferimp) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.csferimp) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cscodazi) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cscodazi) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cstipseg) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cstipseg) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.DataObso) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.DataObso) *@ +@*
*@ +@*
*@ + +@*
*@ +@* | *@ +@* Back to List *@ +@*
*@ +@*
*@ diff --git a/Views/CodSegna/Details.cshtml b/Views/CodSegna/Details.cshtml new file mode 100644 index 0000000..e673b35 --- /dev/null +++ b/Views/CodSegna/Details.cshtml @@ -0,0 +1,90 @@ +@model VirtualTask.Models.CodiceSegnalazione + +@{ + ViewData["Title"] = "Dettaglio codice segnalazione"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + +
+
+
+
+
+ @Html.DisplayNameFor(model => model.cscodice) - @Html.DisplayFor(model => model.cscodice) +
+
+ @Html.DisplayNameFor(model => model.csdescr) - @Html.DisplayFor(model => model.csdescr) +
+
+ @Html.DisplayNameFor(model => model.csferimp) - @Html.DisplayFor(model => model.csferimp) +
+
+ @Html.DisplayNameFor(model => model.cscodazi) @Html.DisplayFor(model => model.cscodazi) +
+
+ @Html.DisplayNameFor(model => model.cstipseg) @Html.DisplayFor(model => model.cstipseg) +
+ @Html.HiddenFor(model => model.DataObso) + + +
+
+
+
+ +@* @model VirtualTask.Models.CodiceSegnalazione *@ + +@* @{ *@ +@* ViewData["Title"] = "Details"; *@ +@* } *@ + +@*

Details

*@ + +@*
*@ +@*

CodiceSegnalazione

*@ +@*
*@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cscodice) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cscodice) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.csdescr) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.csdescr) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.csferimp) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.csferimp) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cscodazi) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cscodazi) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.cstipseg) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.cstipseg) *@ +@*
*@ +@*
*@ +@* @Html.DisplayNameFor(model => model.DataObso) *@ +@*
*@ +@*
*@ +@* @Html.DisplayFor(model => model.DataObso) *@ +@*
*@ +@*
*@ +@*
*@ +@*
*@ +@* @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | *@ +@* Back to List *@ +@*
*@ diff --git a/Views/CodSegna/Edit.cshtml b/Views/CodSegna/Edit.cshtml new file mode 100644 index 0000000..d0fbbf0 --- /dev/null +++ b/Views/CodSegna/Edit.cshtml @@ -0,0 +1,131 @@ +@model VirtualTask.Models.CodiceSegnalazione + +@{ + ViewData["Title"] = "Modifica codice segnalazione"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + +
+
+
+
+
+
+
 
+
+
+ @Html.HiddenFor(x => x.cscodice) + @Html.DisplayFor(model => model.cscodice) + +
+
 
+
+
+ + +
+
 
+
+
+ + +
+
 
+
+
+ @Html.HiddenFor(x => x.cscodazi) + @Html.DisplayFor(model => model.cscodazi) + +
+
 
+
+
+ + +
+ +
 
+ + @* @Html.HiddenFor(x => x.cscodazi) *@ + +
+
+
+
+
+ +@* +@section Scripts { + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } +} *@ + + + + +@* @model VirtualTask.Models.CodiceSegnalazione *@ + +@* @{ *@ +@* ViewData["Title"] = "Edit"; *@ +@* } *@ + +@*

Edit

*@ + +@*

CodiceSegnalazione

*@ +@*
*@ +@*
*@ +@*
*@ +@*
*@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@* *@ +@* *@ +@*
*@ +@*
*@ +@* *@ +@*
*@ +@*
*@ +@*
*@ +@*
*@ + +@*
*@ +@* Back to List *@ +@*
*@ + +@* @section Scripts { *@ +@* @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} *@ +@* } *@ diff --git a/Views/CodSegna/Index.cshtml b/Views/CodSegna/Index.cshtml new file mode 100644 index 0000000..b091604 --- /dev/null +++ b/Views/CodSegna/Index.cshtml @@ -0,0 +1,111 @@ +@model IPagedList +@using X.PagedList; +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; + + + +@{ + ViewData["Title"] = "Codici Segnalazione"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + +
+
+
+

+ Crea un nuovo elemento +

+ + @using (Html.BeginForm()) + { +
+
Ricerca
+ + + + + + + +
+ @Html.TextBox("SearchString", null, new { placeholder = "Cerca per descrizione", @class = "agy-form-field require" }) + +   + +
+
+ } + +
+   +
+ +
+
Cod. Segnalazioni
+
+ + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + @Html.HiddenFor(modelItem => item.csferimp) + @Html.HiddenFor(modelItem => item.cscodazi) + @Html.HiddenFor(modelItem => item.cstipseg) + @Html.HiddenFor(modelItem => item.DataObso) + + + + } + + +
CodiceDescrizione
+ @Html.DisplayFor(modelItem => item.cscodice) + + @Html.DisplayFor(modelItem => item.csdescr) + + + Modifica + + | + + Dettaglio + + | + + Elimina + +
+
+
+
+ +
+
+
diff --git a/Views/Shared/_LayoutAreaRiservata.cshtml b/Views/Shared/_LayoutAreaRiservata.cshtml index 4888282..100ec29 100644 --- a/Views/Shared/_LayoutAreaRiservata.cshtml +++ b/Views/Shared/_LayoutAreaRiservata.cshtml @@ -169,6 +169,7 @@ Purchase: