Gestione Codici segnalazione
azienda lunghezza strettamente 5 + correzioni varie
This commit is contained in:
parent
b4acde18d0
commit
b49ccc7934
@ -10,7 +10,6 @@ namespace VirtualTask.Controllers
|
||||
{
|
||||
public class ArticoliController : Controller
|
||||
{
|
||||
|
||||
string apiUrl = string.Empty;
|
||||
string urlBase = string.Empty;
|
||||
string token = string.Empty;
|
||||
|
||||
350
Controllers/CodSegnaController.cs
Normal file
350
Controllers/CodSegnaController.cs
Normal file
@ -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<CodiceSegnalazione> modelList = new List<CodiceSegnalazione>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<CodiceSegnalazione>>(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<CodiceSegnalazione> modelList = new List<CodiceSegnalazione>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<CodiceSegnalazione>>(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<CodiceSegnalazione> modelList = new List<CodiceSegnalazione>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<CodiceSegnalazione>>(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<CodiceSegnalazione> modelList = new List<CodiceSegnalazione>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<CodiceSegnalazione>>(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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,19 @@ namespace VirtualTask.Controllers
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Rapportini>>(data);
|
||||
|
||||
ViewBag.Rapportini = getImpianti();
|
||||
string urlImpianti = apiUrl + "impiantiListMngr?token=" + token;
|
||||
HttpResponseMessage responseImpianti = client.GetAsync(urlImpianti).Result;
|
||||
|
||||
List<Impianto> impiantiList = new List<Impianto>();
|
||||
|
||||
if (responseImpianti.IsSuccessStatusCode)
|
||||
{
|
||||
string dataImpianti = responseImpianti.Content.ReadAsStringAsync().Result;
|
||||
impiantiList = JsonConvert.DeserializeObject<List<Impianto>>(dataImpianti);
|
||||
ViewBag.Impianti = impiantiList;
|
||||
}
|
||||
|
||||
ViewBag.Rapportini = getImpianti(null);
|
||||
|
||||
if (!string.IsNullOrEmpty(impianto))
|
||||
{
|
||||
@ -267,24 +279,35 @@ namespace VirtualTask.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
private List<SelectListItem> getImpianti()
|
||||
private List<SelectListItem> 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<SelectListItem> selectItems = new List<SelectListItem>();
|
||||
List<Rapportini> modelList = new List<Rapportini>();
|
||||
List<Impianto> modelList = new List<Impianto>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Rapportini>>(data);
|
||||
|
||||
modelList = JsonConvert.DeserializeObject<List<Impianto>>(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<SelectListItem> 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<SelectListItem> selectItems = new List<SelectListItem>();
|
||||
// List<Rapportini> modelList = new List<Rapportini>();
|
||||
// HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
// if (response.IsSuccessStatusCode)
|
||||
// {
|
||||
// string data = response.Content.ReadAsStringAsync().Result;
|
||||
// modelList = JsonConvert.DeserializeObject<List<Rapportini>>(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()
|
||||
{
|
||||
|
||||
29
Models/CodiceSegnalazione.cs
Normal file
29
Models/CodiceSegnalazione.cs
Normal file
@ -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; }
|
||||
}
|
||||
}
|
||||
@ -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")]
|
||||
|
||||
59
Views/CodSegna/Create.cshtml
Normal file
59
Views/CodSegna/Create.cshtml
Normal file
@ -0,0 +1,59 @@
|
||||
@model VirtualTask.Models.CodiceSegnalazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Nuovo codice segnalazione";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="cscodice" class="control-label"></label></h5>
|
||||
<input asp-for="cscodice" class="form-control" />
|
||||
<span asp-validation-for="cscodice" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="csdescr" class="control-label"></label></h5>
|
||||
<input asp-for="csdescr" class="form-control" />
|
||||
<span asp-validation-for="csdescr" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="csferimp" class="control-label"></label></h5>
|
||||
<input asp-for="csferimp" class="form-control" />
|
||||
<span asp-validation-for="csferimp" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="cstipseg" class="control-label"></label></h5>
|
||||
<input asp-for="cstipseg" class="form-control" />
|
||||
<span asp-validation-for="cstipseg" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Salva" class="agy-btn submitForm" />
|
||||
<a asp-action="Index" value="Torna alla lista" class="agy-btn submitForm">Torna alla lista</a>
|
||||
</div>
|
||||
|
||||
@Html.HiddenFor(x => x.cscodazi)
|
||||
@Html.HiddenFor(x => x.DataObso)
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@section Scripts {
|
||||
@{
|
||||
await Html.RenderPartialAsync("_ValidationScriptsPartial");
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
102
Views/CodSegna/Delete.cshtml
Normal file
102
Views/CodSegna/Delete.cshtml
Normal file
@ -0,0 +1,102 @@
|
||||
@model VirtualTask.Models.CodiceSegnalazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Elimina codice segnalazione";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cscodice)</b> @Html.DisplayFor(model => model.cscodice)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.csdescr)</b> @Html.DisplayFor(model => model.csdescr)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.csferimp)</b> @Html.DisplayFor(model => model.csferimp)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cscodazi)</b> @Html.DisplayFor(model => model.cscodazi)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cstipseg)</b> @Html.DisplayFor(model => model.cstipseg)
|
||||
</div>
|
||||
|
||||
@Html.HiddenFor(x => x.DataObso)
|
||||
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<form asp-action="DeleteConfirmed">
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Elimina" class="agy-btn submitForm" />
|
||||
<input type="hidden" id="id" value=@Html.DisplayFor(model => model.cscodice) name="id" />
|
||||
<a asp-action="Index" value="Torna alla lista" class="agy-btn submitForm">Torna alla lista</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@* @model VirtualTask.Models.CodiceSegnalazione *@
|
||||
|
||||
@* @{ *@
|
||||
@* ViewData["Title"] = "Delete"; *@
|
||||
@* } *@
|
||||
|
||||
@* <h1>Delete</h1> *@
|
||||
|
||||
@* <h3>Are you sure you want to delete this?</h3> *@
|
||||
@* <div> *@
|
||||
@* <h4>CodiceSegnalazione</h4> *@
|
||||
@* <hr /> *@
|
||||
@* <dl class="row"> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cscodice) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cscodice) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.csdescr) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.csdescr) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.csferimp) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.csferimp) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cscodazi) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cscodazi) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cstipseg) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cstipseg) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.DataObso) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.DataObso) *@
|
||||
@* </dd> *@
|
||||
@* </dl> *@
|
||||
|
||||
@* <form asp-action="Delete"> *@
|
||||
@* <input type="submit" value="Delete" class="btn btn-danger" /> | *@
|
||||
@* <a asp-action="Index">Back to List</a> *@
|
||||
@* </form> *@
|
||||
@* </div> *@
|
||||
90
Views/CodSegna/Details.cshtml
Normal file
90
Views/CodSegna/Details.cshtml
Normal file
@ -0,0 +1,90 @@
|
||||
@model VirtualTask.Models.CodiceSegnalazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Dettaglio codice segnalazione";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cscodice)</b> - @Html.DisplayFor(model => model.cscodice)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.csdescr)</b> - @Html.DisplayFor(model => model.csdescr)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.csferimp)</b> - @Html.DisplayFor(model => model.csferimp)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cscodazi)</b> @Html.DisplayFor(model => model.cscodazi)
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<b>@Html.DisplayNameFor(model => model.cstipseg)</b> @Html.DisplayFor(model => model.cstipseg)
|
||||
</div>
|
||||
@Html.HiddenFor(model => model.DataObso)
|
||||
|
||||
<div>
|
||||
<a asp-action="Index" value="Torna alla lista" class="agy-btn submitForm">Torna alla lista</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* @model VirtualTask.Models.CodiceSegnalazione *@
|
||||
|
||||
@* @{ *@
|
||||
@* ViewData["Title"] = "Details"; *@
|
||||
@* } *@
|
||||
|
||||
@* <h1>Details</h1> *@
|
||||
|
||||
@* <div> *@
|
||||
@* <h4>CodiceSegnalazione</h4> *@
|
||||
@* <hr /> *@
|
||||
@* <dl class="row"> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cscodice) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cscodice) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.csdescr) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.csdescr) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.csferimp) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.csferimp) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cscodazi) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cscodazi) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.cstipseg) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.cstipseg) *@
|
||||
@* </dd> *@
|
||||
@* <dt class = "col-sm-2"> *@
|
||||
@* @Html.DisplayNameFor(model => model.DataObso) *@
|
||||
@* </dt> *@
|
||||
@* <dd class = "col-sm-10"> *@
|
||||
@* @Html.DisplayFor(model => model.DataObso) *@
|
||||
@* </dd> *@
|
||||
@* </dl> *@
|
||||
@* </div> *@
|
||||
@* <div> *@
|
||||
@* @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | *@
|
||||
@* <a asp-action="Index">Back to List</a> *@
|
||||
@* </div> *@
|
||||
131
Views/CodSegna/Edit.cshtml
Normal file
131
Views/CodSegna/Edit.cshtml
Normal file
@ -0,0 +1,131 @@
|
||||
@model VirtualTask.Models.CodiceSegnalazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Modifica codice segnalazione";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="cscodice" class="agy-client-quote"></label></h5>
|
||||
@Html.HiddenFor(x => x.cscodice)
|
||||
@Html.DisplayFor(model => model.cscodice)
|
||||
<span asp-validation-for="cscodice" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="csdescr" class="agy-client-quote"></label></h5>
|
||||
<input asp-for="csdescr" class="agy-form-field require" class="form-control" />
|
||||
<span asp-validation-for="csdescr" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="csferimp" class="agy-client-quote"></label></h5>
|
||||
<input asp-for="csferimp" class="agy-form-field require" class="form-control" />
|
||||
<span asp-validation-for="csferimp" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="cscodazi" class="agy-client-quote"></label></h5>
|
||||
@Html.HiddenFor(x => x.cscodazi)
|
||||
@Html.DisplayFor(model => model.cscodazi)
|
||||
<span asp-validation-for="cscodazi" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="cstipseg" class="agy-client-quote"></label></h5>
|
||||
<input asp-for="cstipseg" class="agy-form-field require" class="form-control" />
|
||||
<span asp-validation-for="cstipseg" class="text-danger"></span>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Salva" class="agy-btn submitForm" />
|
||||
<a asp-action="Index" value="Torna alla lista" class="agy-btn submitForm">Torna alla lista</a>
|
||||
</div>
|
||||
@* @Html.HiddenFor(x => x.cscodazi) *@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* <script type="text/javascript">
|
||||
$(function () {
|
||||
$("#imultcli").select2();
|
||||
});
|
||||
</script>
|
||||
@section Scripts {
|
||||
@{
|
||||
await Html.RenderPartialAsync("_ValidationScriptsPartial");
|
||||
}
|
||||
} *@
|
||||
|
||||
|
||||
|
||||
|
||||
@* @model VirtualTask.Models.CodiceSegnalazione *@
|
||||
|
||||
@* @{ *@
|
||||
@* ViewData["Title"] = "Edit"; *@
|
||||
@* } *@
|
||||
|
||||
@* <h1>Edit</h1> *@
|
||||
|
||||
@* <h4>CodiceSegnalazione</h4> *@
|
||||
@* <hr /> *@
|
||||
@* <div class="row"> *@
|
||||
@* <div class="col-md-4"> *@
|
||||
@* <form asp-action="Edit"> *@
|
||||
@* <div asp-validation-summary="ModelOnly" class="text-danger"></div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="cscodice" class="control-label"></label> *@
|
||||
@* <input asp-for="cscodice" class="form-control" /> *@
|
||||
@* <span asp-validation-for="cscodice" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="csdescr" class="control-label"></label> *@
|
||||
@* <input asp-for="csdescr" class="form-control" /> *@
|
||||
@* <span asp-validation-for="csdescr" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="csferimp" class="control-label"></label> *@
|
||||
@* <input asp-for="csferimp" class="form-control" /> *@
|
||||
@* <span asp-validation-for="csferimp" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="cscodazi" class="control-label"></label> *@
|
||||
@* <input asp-for="cscodazi" class="form-control" /> *@
|
||||
@* <span asp-validation-for="cscodazi" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="cstipseg" class="control-label"></label> *@
|
||||
@* <input asp-for="cstipseg" class="form-control" /> *@
|
||||
@* <span asp-validation-for="cstipseg" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <label asp-for="DataObso" class="control-label"></label> *@
|
||||
@* <input asp-for="DataObso" class="form-control" /> *@
|
||||
@* <span asp-validation-for="DataObso" class="text-danger"></span> *@
|
||||
@* </div> *@
|
||||
@* <div class="form-group"> *@
|
||||
@* <input type="submit" value="Save" class="btn btn-primary" /> *@
|
||||
@* </div> *@
|
||||
@* </form> *@
|
||||
@* </div> *@
|
||||
@* </div> *@
|
||||
|
||||
@* <div> *@
|
||||
@* <a asp-action="Index">Back to List</a> *@
|
||||
@* </div> *@
|
||||
|
||||
@* @section Scripts { *@
|
||||
@* @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} *@
|
||||
@* } *@
|
||||
111
Views/CodSegna/Index.cshtml
Normal file
111
Views/CodSegna/Index.cshtml
Normal file
@ -0,0 +1,111 @@
|
||||
@model IPagedList<VirtualTask.Models.CodiceSegnalazione>
|
||||
@using X.PagedList;
|
||||
@using X.PagedList.Mvc.Core;
|
||||
@using X.PagedList.Web.Common;
|
||||
|
||||
|
||||
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
|
||||
@{
|
||||
ViewData["Title"] = "Codici Segnalazione";
|
||||
Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml";
|
||||
}
|
||||
|
||||
<div class="agy-project-wrapper agy-project-page-wrapper">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<p>
|
||||
<a asp-action="Create" class="info-data"><img src="~/assets/images/icons8-nuovo-50.png" alt="Crea un nuovo elemento" /></a>
|
||||
</p>
|
||||
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
<div class="card">
|
||||
<h5 class="card-header">Ricerca</h5>
|
||||
<table class="table">
|
||||
<tbody class="table-border-bottom-0">
|
||||
<tr>
|
||||
<td>
|
||||
<span class="fw-medium">@Html.TextBox("SearchString", null, new { placeholder = "Cerca per descrizione", @class = "agy-form-field require" })</span>
|
||||
</td>
|
||||
<td>
|
||||
<i class="bx bxl-angular bx-sm text-black me-3"> </i>
|
||||
<span class="fw-medium"><input type="submit" value="Cerca" class="agy-btn submitForm" /></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="width:100%;height:30px;">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h5 class="card-header">Cod. Segnalazioni</h5>
|
||||
<div class="table-responsive text-nowrap">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Codice</th>
|
||||
<th>Descrizione</th>
|
||||
<th hidden>Fermo impianto</th>
|
||||
<th hidden>Azienda</th>
|
||||
<th hidden>Tipo segnalazione</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td style ="width:20%">
|
||||
@Html.DisplayFor(modelItem => item.cscodice)
|
||||
</td>
|
||||
<td style="width:60%">
|
||||
@Html.DisplayFor(modelItem => item.csdescr)
|
||||
</td>
|
||||
|
||||
@Html.HiddenFor(modelItem => item.csferimp)
|
||||
@Html.HiddenFor(modelItem => item.cscodazi)
|
||||
@Html.HiddenFor(modelItem => item.cstipseg)
|
||||
@Html.HiddenFor(modelItem => item.DataObso)
|
||||
|
||||
<td style="width:10%">
|
||||
<a href="@Url.Action("Edit", "CodSegna", new { id=item.cscodice })" title="Modifica" class="links">
|
||||
<img alt="Modifica" src="@Url.Content("~/assets/images/icons8-modificare-64.png")" style="width:30px;height:30px;">
|
||||
</a>
|
||||
|
|
||||
<a href="@Url.Action("Details", "CodSegna", new { id=item.cscodice })" title="Dettaglio" class="links">
|
||||
<img alt="Dettaglio" src="@Url.Content("~/assets/images/icons8-visualizza-file-64.png")" style="width:30px;height:30px;">
|
||||
</a>
|
||||
|
|
||||
<a href="@Url.Action("Delete", "CodSegna", new { id=item.cscodice })" title="Elimina" class="links">
|
||||
<img alt="Elimina" src="@Url.Content("~/assets/images/icons8-elimina-50.png")" style="width:30px;height:30px;">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<nav>
|
||||
@Html.PagedListPager(Model, page => Url.Action("index", new { page = page, searchString = @ViewData["CurrentFilter"] }), new PagedListRenderOptions()
|
||||
{
|
||||
ActiveLiElementClass = "active",
|
||||
PageClasses = new[] { "page-link" },
|
||||
LiElementClasses = new[] { "page-item" },
|
||||
UlElementClasses = new[] { "pagination", "justify-content-center", "mt-3" },
|
||||
LinkToNextPageFormat = "Successiva",
|
||||
LinkToPreviousPageFormat = "Precedente",
|
||||
MaximumPageNumbersToDisplay = 5,
|
||||
DisplayLinkToPreviousPage = PagedListDisplayMode.Always,
|
||||
DisplayLinkToNextPage = PagedListDisplayMode.Always
|
||||
})
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -169,6 +169,7 @@ Purchase:
|
||||
<ul class="sub-menu">
|
||||
<li><a asp-area="" asp-controller="Tecnici" asp-action="Index">Tecnici</a></li>
|
||||
<li><a asp-area="" asp-controller="Chiusure" asp-action="Index">Tipi intervento</a></li>
|
||||
<li><a asp-area="" asp-controller="CodSegna" asp-action="Index">Cod. Segnalazione</a></li>
|
||||
<li><a asp-area="" asp-controller="Anag" asp-action="Index">Clienti</a></li>
|
||||
<li><a asp-area="" asp-controller="Impianti" asp-action="Index">Impianti</a></li>
|
||||
<li><a asp-area="" asp-controller="Articoli" asp-action="Index">Articoli</a></li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user