Michele: registrazione controller model view
This commit is contained in:
parent
956a3bccbb
commit
03e8844808
@ -11,14 +11,13 @@ namespace VirtualTask.Controllers
|
||||
{
|
||||
public class ChiusureController : Controller
|
||||
{
|
||||
|
||||
string apiUrl = string.Empty;
|
||||
string urlBase = string.Empty;
|
||||
string token = string.Empty;
|
||||
string tenant = string.Empty;
|
||||
string errMes = string.Empty;
|
||||
HttpClient client;
|
||||
|
||||
HttpClient client;
|
||||
|
||||
public ChiusureController()
|
||||
{
|
||||
@ -29,7 +28,6 @@ namespace VirtualTask.Controllers
|
||||
|
||||
public IActionResult Index(string searchString, int? page = 1)
|
||||
{
|
||||
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
|
||||
|
||||
323
Controllers/RegistrazioniController.cs
Normal file
323
Controllers/RegistrazioniController.cs
Normal file
@ -0,0 +1,323 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using VirtualTask.Models;
|
||||
using X.PagedList;
|
||||
|
||||
namespace VirtualTask.Controllers
|
||||
{
|
||||
public class RegistrazioniController : Controller
|
||||
{
|
||||
string apiUrl = string.Empty;
|
||||
string urlBase = string.Empty;
|
||||
string token = string.Empty;
|
||||
string tenant = string.Empty;
|
||||
string errMes = string.Empty;
|
||||
|
||||
HttpClient client;
|
||||
|
||||
public RegistrazioniController()
|
||||
{
|
||||
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("Index", "Login");
|
||||
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
//urlBase = apiUrl + "RegistrazioniList";
|
||||
urlBase = "http://10.0.0.187:8000/api/Polo/RegistrazioniList";
|
||||
//urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
List<Registrazione> modelList = new List<Registrazione>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Registrazione>>(data);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchString))
|
||||
{
|
||||
modelList = modelList.Where(s => s.cognome.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.id)
|
||||
.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()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Create(Registrazione model)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("token");
|
||||
//tenant = helper.GetStringValue("tenant");
|
||||
|
||||
//if (string.IsNullOrEmpty(token))
|
||||
//{
|
||||
// return RedirectToAction("Index", "Login");
|
||||
//}
|
||||
|
||||
//model.azienda = tenant;
|
||||
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
//urlBase = apiUrl + "registrazioni/add";
|
||||
urlBase = "http://10.0.0.187:8000/api/Polo/registrazioni/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(int id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("tok");
|
||||
//urlBase = apiUrl + "registrazioniList";
|
||||
urlBase = "http://10.0.0.187:8000/api/Polo/RegistrazioniList";
|
||||
//urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
Registrazione reg = new Registrazione();
|
||||
|
||||
List<Registrazione> modelList = new List<Registrazione>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Registrazione>>(data);
|
||||
//reg = modelList.Where(x => x.id.Equals(id)).First();
|
||||
reg = modelList.Where(x => x.id == id).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
return View(reg);
|
||||
}
|
||||
|
||||
#endregion DETAILS
|
||||
|
||||
#region EDIT
|
||||
|
||||
public IActionResult Edit(int id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("tok");
|
||||
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
//urlBase = apiUrl + "chiusureVtList";
|
||||
urlBase = "http://10.0.0.187:8000/api/Polo/RegistrazioniList";
|
||||
//urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
Registrazione reg = new Registrazione();
|
||||
|
||||
List<Registrazione> modelList = new List<Registrazione>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Registrazione>>(data);
|
||||
reg = modelList.Where(x => x.id == id).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
return View(reg);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Edit(Registrazione model)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("tok");
|
||||
//tenant = helper.GetStringValue("tenant");
|
||||
//if (string.IsNullOrEmpty(token))
|
||||
//{
|
||||
// return RedirectToAction("Index", "Login");
|
||||
//}
|
||||
model.azienda = tenant;
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
//urlBase = apiUrl + "registrazioni/mod";
|
||||
urlBase = apiUrl + "http://10.0.0.187:8000/api/Polo/registrazioni/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(int id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("tok");
|
||||
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
//urlBase = apiUrl + "chiusureVtList";
|
||||
urlBase = "http://10.0.0.187:8000/api/Polo/RegistrazioniList";
|
||||
//urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
Registrazione reg = new Registrazione();
|
||||
List<Registrazione> modelList = new List<Registrazione>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Registrazione>>(data);
|
||||
reg = modelList.Where(x => x.id.Equals(id)).First();
|
||||
return View(reg);
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost, ActionName("DeleteConfirmed")]
|
||||
public IActionResult DeleteConfirmed(int id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
//token = helper.GetStringValue("tok");
|
||||
|
||||
//apiUrl = helper.GetStringValue("apiUrl");
|
||||
urlBase = /*apiUrl + */"http://10.0.0.187:8000/api/Polo/Registrazioni/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");
|
||||
}
|
||||
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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Models/Registrazione.cs
Normal file
20
Models/Registrazione.cs
Normal file
@ -0,0 +1,20 @@
|
||||
namespace VirtualTask.Models
|
||||
{
|
||||
public class Registrazione
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string? nome { get; set; }
|
||||
public string? cognome { get; set; }
|
||||
public string? telefono { get; set;}
|
||||
public string? cellulare { get; set;}
|
||||
public string? email { get; set;}
|
||||
public string? emailConf { get; set;}
|
||||
public string? azienda { get; set; }
|
||||
public string? username { get; set; }
|
||||
public string? passwd { get; set;}
|
||||
public string? citta { get; set;}
|
||||
public string? provincia { get; set;}
|
||||
public string? nazione { get; set;}
|
||||
public string? attivato { get; set;}
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ Purchase:
|
||||
<a href="index.html">Home</a>
|
||||
</li>
|
||||
<li><a href="about.html">About Us</a></li>
|
||||
<li><a href="services.html">Services</a></li>
|
||||
<li><a href="Registrazioni/Create">Registrati</a></li>
|
||||
<li><a href="Login/Login">Area Riservata</a></li>
|
||||
<li>
|
||||
<a href="javascript:void(0);">Blog</a>
|
||||
|
||||
99
Views/Registrazioni/Create.cshtml
Normal file
99
Views/Registrazioni/Create.cshtml
Normal file
@ -0,0 +1,99 @@
|
||||
@model VirtualTask.Models.Registrazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Registrazione nuovo utente</h1>
|
||||
|
||||
<h4 hidden>Registrazione</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
@* <div class="form-group">
|
||||
<label asp-for="id" class="control-label"></label>
|
||||
<input asp-for="id" class="form-control" />
|
||||
<span asp-validation-for="id" class="text-danger"></span>
|
||||
</div>*@
|
||||
@Html.HiddenFor(x => x.id)
|
||||
<div class="form-group">
|
||||
<label asp-for="nome" class="control-label"></label>
|
||||
<input asp-for="nome" class="form-control" />
|
||||
<span asp-validation-for="nome" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="cognome" class="control-label"></label>
|
||||
<input asp-for="cognome" class="form-control" />
|
||||
<span asp-validation-for="cognome" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="telefono" class="control-label"></label>
|
||||
<input asp-for="telefono" class="form-control" />
|
||||
<span asp-validation-for="telefono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="cellulare" class="control-label"></label>
|
||||
<input asp-for="cellulare" class="form-control" />
|
||||
<span asp-validation-for="cellulare" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="email" class="control-label"></label>
|
||||
<input asp-for="email" class="form-control" />
|
||||
<span asp-validation-for="email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="emailConf" class="control-label"></label>
|
||||
<input asp-for="emailConf" class="form-control" />
|
||||
<span asp-validation-for="emailConf" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="azienda" class="control-label"></label>
|
||||
<input asp-for="azienda" class="form-control" />
|
||||
<span asp-validation-for="azienda" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="username" class="control-label"></label>
|
||||
<input asp-for="username" class="form-control" />
|
||||
<span asp-validation-for="username" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="passwd" class="control-label"></label>
|
||||
<input asp-for="passwd" class="form-control" />
|
||||
<span asp-validation-for="passwd" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="citta" class="control-label"></label>
|
||||
<input asp-for="citta" class="form-control" />
|
||||
<span asp-validation-for="citta" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="provincia" class="control-label"></label>
|
||||
<input asp-for="provincia" class="form-control" />
|
||||
<span asp-validation-for="provincia" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="nazione" class="control-label"></label>
|
||||
<input asp-for="nazione" class="form-control" />
|
||||
<span asp-validation-for="nazione" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="attivato" class="control-label"></label>
|
||||
<input asp-for="attivato" class="form-control" />
|
||||
<span asp-validation-for="attivato" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Salva" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
104
Views/Registrazioni/Delete.cshtml
Normal file
104
Views/Registrazioni/Delete.cshtml
Normal file
@ -0,0 +1,104 @@
|
||||
@model VirtualTask.Models.Registrazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Elimina</h1>
|
||||
|
||||
<h3>Vuoi eliminare l'elemento?</h3>
|
||||
<div>
|
||||
<h4>Registrazione</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.id)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.id)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.nome)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.nome)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.cognome)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.cognome)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.telefono)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.telefono)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.cellulare)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.cellulare)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.email)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.email)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.emailConf)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.emailConf)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.azienda)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.azienda)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.username)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.username)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.passwd)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.passwd)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.citta)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.citta)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.provincia)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.provincia)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.nazione)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.nazione)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.attivato)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.attivato)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="DeleteConfirmed">
|
||||
<input type="submit" value="Elimina" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</form>
|
||||
</div>
|
||||
102
Views/Registrazioni/Details.cshtml
Normal file
102
Views/Registrazioni/Details.cshtml
Normal file
@ -0,0 +1,102 @@
|
||||
@model VirtualTask.Models.Registrazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h1>Dettaglio</h1>
|
||||
|
||||
<div>
|
||||
<h4 hidden>Registrazione</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.id)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.id)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.nome)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.nome)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.cognome)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.cognome)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.telefono)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.telefono)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.cellulare)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.cellulare)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.email)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.email)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.emailConf)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.emailConf)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.azienda)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.azienda)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.username)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.username)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.passwd)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.passwd)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.citta)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.citta)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.provincia)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.provincia)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.nazione)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.nazione)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.attivato)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.attivato)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@Html.ActionLink("Modifica", "Edit", new { /* id = Model.PrimaryKey */ }) |
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</div>
|
||||
98
Views/Registrazioni/Edit.cshtml
Normal file
98
Views/Registrazioni/Edit.cshtml
Normal file
@ -0,0 +1,98 @@
|
||||
@model VirtualTask.Models.Registrazione
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Modifica</h1>
|
||||
|
||||
<h4 hidden>Registrazione</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="id" class="control-label"></label>
|
||||
<input asp-for="id" class="form-control" />
|
||||
<span asp-validation-for="id" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="nome" class="control-label"></label>
|
||||
<input asp-for="nome" class="form-control" />
|
||||
<span asp-validation-for="nome" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="cognome" class="control-label"></label>
|
||||
<input asp-for="cognome" class="form-control" />
|
||||
<span asp-validation-for="cognome" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="telefono" class="control-label"></label>
|
||||
<input asp-for="telefono" class="form-control" />
|
||||
<span asp-validation-for="telefono" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="cellulare" class="control-label"></label>
|
||||
<input asp-for="cellulare" class="form-control" />
|
||||
<span asp-validation-for="cellulare" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="email" class="control-label"></label>
|
||||
<input asp-for="email" class="form-control" />
|
||||
<span asp-validation-for="email" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="emailConf" class="control-label"></label>
|
||||
<input asp-for="emailConf" class="form-control" />
|
||||
<span asp-validation-for="emailConf" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="azienda" class="control-label"></label>
|
||||
<input asp-for="azienda" class="form-control" />
|
||||
<span asp-validation-for="azienda" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="username" class="control-label"></label>
|
||||
<input asp-for="username" class="form-control" />
|
||||
<span asp-validation-for="username" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="passwd" class="control-label"></label>
|
||||
<input asp-for="passwd" class="form-control" />
|
||||
<span asp-validation-for="passwd" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="citta" class="control-label"></label>
|
||||
<input asp-for="citta" class="form-control" />
|
||||
<span asp-validation-for="citta" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="provincia" class="control-label"></label>
|
||||
<input asp-for="provincia" class="form-control" />
|
||||
<span asp-validation-for="provincia" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="nazione" class="control-label"></label>
|
||||
<input asp-for="nazione" class="form-control" />
|
||||
<span asp-validation-for="nazione" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="attivato" class="control-label"></label>
|
||||
<input asp-for="attivato" class="form-control" />
|
||||
<span asp-validation-for="attivato" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Salva" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
130
Views/Registrazioni/Index.cshtml
Normal file
130
Views/Registrazioni/Index.cshtml
Normal file
@ -0,0 +1,130 @@
|
||||
@using X.PagedList.Mvc.Core;
|
||||
@using X.PagedList.Web.Common;
|
||||
@using X.PagedList;
|
||||
@model IPagedList<VirtualTask.Models.Registrazione>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Nuovo</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.id) *@
|
||||
ID
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.nome) *@
|
||||
NOME
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.cognome) *@
|
||||
COGNOME
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.telefono) *@
|
||||
TELEFONO
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.cellulare) *@
|
||||
CELLULARE
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.email) *@
|
||||
EMAIL
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.emailConf) *@
|
||||
EMAIL CONFERMA
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.azienda) *@
|
||||
AZIENDA
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.username) *@
|
||||
USERNAME
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.passwd) *@
|
||||
PASSWORD
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.citta) *@
|
||||
CITTA'
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.provincia) *@
|
||||
PROVINCIA
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.nazione) *@
|
||||
NAZIONE
|
||||
</th>
|
||||
<th>
|
||||
@* @Html.DisplayNameFor(model => model.attivato) *@
|
||||
ATTIVATO
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.id)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.nome)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.cognome)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.telefono)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.cellulare)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.email)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.emailConf)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.azienda)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.username)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.passwd)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.citta)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.provincia)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.nazione)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.attivato)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Modifica", "Edit", new { id=item.id }) |
|
||||
@Html.ActionLink("Dettaglio", "Details", new { id=item.id }) |
|
||||
@Html.ActionLink("Elimina", "Delete", new { id=item.id })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
Loading…
Reference in New Issue
Block a user