Michele: DATI AZIENDA controller + model + view
This commit is contained in:
parent
3a537c8e8e
commit
c0154565ee
317
Controllers/AziendaRifController.cs
Normal file
317
Controllers/AziendaRifController.cs
Normal file
@ -0,0 +1,317 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using VirtualTask.Models;
|
||||
using X.PagedList;
|
||||
|
||||
namespace VirtualTask.Controllers
|
||||
{
|
||||
public class AziendaRifController : Controller
|
||||
{
|
||||
string apiUrl = string.Empty;
|
||||
string urlBase = string.Empty;
|
||||
string token = string.Empty;
|
||||
string tenant = string.Empty;
|
||||
string errMes = string.Empty;
|
||||
|
||||
HttpClient client;
|
||||
|
||||
public AziendaRifController()
|
||||
{
|
||||
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 + "aziendeList";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
List<AziendaRif> modelList = new List<AziendaRif>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<AziendaRif>>(data);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchString))
|
||||
{
|
||||
modelList = modelList.Where(s => s.picodtec.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.picodtec)
|
||||
.ToPagedList(page ?? 1, pageSize);
|
||||
|
||||
return View(shortLinks);
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMes", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion INDEX
|
||||
|
||||
#region CREATE
|
||||
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Create(AziendaRif model)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
tenant = helper.GetStringValue("tenant");
|
||||
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
return RedirectToAction("Index", "Login");
|
||||
}
|
||||
|
||||
model.pirifazi = tenant;
|
||||
apiUrl = helper.GetStringValue("apiUrl");
|
||||
urlBase = apiUrl + "azienda/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");
|
||||
urlBase = apiUrl + "aziendeList";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
AziendaRif aziRif = new AziendaRif();
|
||||
|
||||
List<AziendaRif> modelList = new List<AziendaRif>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<AziendaRif>>(data);
|
||||
aziRif = modelList.Where(x => x.picodtec.Equals(id)).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
return View(modelList);
|
||||
}
|
||||
|
||||
#endregion DETAILS
|
||||
|
||||
#region EDIT
|
||||
|
||||
public IActionResult Edit(string id)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
apiUrl = helper.GetStringValue("apiUrl");
|
||||
urlBase = apiUrl + "aziendeList";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
AziendaRif aziRif = new AziendaRif();
|
||||
|
||||
List<AziendaRif> modelList = new List<AziendaRif>();
|
||||
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<AziendaRif>>(data);
|
||||
aziRif = modelList.Where(x => x.picodtec.Equals(id)).First();
|
||||
}
|
||||
else
|
||||
{
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
return View(aziRif);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Edit(AziendaRif model)
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
|
||||
token = helper.GetStringValue("tok");
|
||||
tenant = helper.GetStringValue("tenant");
|
||||
|
||||
if (string.IsNullOrEmpty(token))
|
||||
{
|
||||
return RedirectToAction("Index", "Login");
|
||||
}
|
||||
|
||||
model.pirifazi = token;
|
||||
apiUrl = helper.GetStringValue("apiUrl");
|
||||
urlBase = apiUrl + "azienda/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");
|
||||
urlBase = apiUrl + "azienda/del";
|
||||
urlBase = urlBase + "?token=" + token;
|
||||
Uri baseAddress = new Uri(urlBase);
|
||||
client = new HttpClient();
|
||||
client.BaseAddress = baseAddress;
|
||||
|
||||
AziendaRif aziRif = new AziendaRif();
|
||||
List<AziendaRif> modelList = new List<AziendaRif>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<AziendaRif>>(data);
|
||||
aziRif = modelList.Where(x => x.picodtec.Equals(id)).First();
|
||||
|
||||
return View(aziRif);
|
||||
}
|
||||
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");
|
||||
urlBase = apiUrl + "azienda/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 });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -118,15 +118,14 @@
|
||||
<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
|
||||
|
||||
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>
|
||||
58
Views/AziendaRif/Create.cshtml
Normal file
58
Views/AziendaRif/Create.cshtml
Normal file
@ -0,0 +1,58 @@
|
||||
@model VirtualTask.Models.AziendaRif
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Nuovo</h1>
|
||||
|
||||
<h4 hidden>AziendaRif</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="piazihoc" class="control-label"></label>
|
||||
<input asp-for="piazihoc" class="form-control" />
|
||||
<span asp-validation-for="piazihoc" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="picodtec" class="control-label"></label>
|
||||
<input asp-for="picodtec" class="form-control" />
|
||||
<span asp-validation-for="picodtec" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pirifazi" class="control-label"></label>
|
||||
<input asp-for="pirifazi" class="form-control" />
|
||||
<span asp-validation-for="pirifazi" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pinomede" class="control-label"></label>
|
||||
<input asp-for="pinomede" class="form-control" />
|
||||
<span asp-validation-for="pinomede" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pilogurl" class="control-label"></label>
|
||||
<input asp-for="pilogurl" class="form-control" />
|
||||
<span asp-validation-for="pilogurl" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pitextin" class="control-label"></label>
|
||||
<input asp-for="pitextin" class="form-control" />
|
||||
<span asp-validation-for="pitextin" 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");}
|
||||
}
|
||||
56
Views/AziendaRif/Delete.cshtml
Normal file
56
Views/AziendaRif/Delete.cshtml
Normal file
@ -0,0 +1,56 @@
|
||||
@model VirtualTask.Models.AziendaRif
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Elimina</h1>
|
||||
|
||||
<h3>Vuoi eliminare l'elemento?</h3>
|
||||
<div>
|
||||
<h4 hidden>AziendaRif</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.piazihoc)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.piazihoc)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.picodtec)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.picodtec)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pirifazi)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pirifazi)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pinomede)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pinomede)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pilogurl)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pilogurl)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pitextin)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pitextin)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="DeleteConfirmed">
|
||||
<input type="submit" value="Elimina" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</form>
|
||||
</div>
|
||||
54
Views/AziendaRif/Details.cshtml
Normal file
54
Views/AziendaRif/Details.cshtml
Normal file
@ -0,0 +1,54 @@
|
||||
@model VirtualTask.Models.AziendaRif
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h1>Dettaglio</h1>
|
||||
|
||||
<div>
|
||||
<h4 hidden>AziendaRif</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.piazihoc)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.piazihoc)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.picodtec)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.picodtec)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pirifazi)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pirifazi)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pinomede)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pinomede)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pilogurl)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pilogurl)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.pitextin)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.pitextin)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
@*@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |*@
|
||||
<a asp-action="Index">Torna indietro</a>
|
||||
</div>
|
||||
58
Views/AziendaRif/Edit.cshtml
Normal file
58
Views/AziendaRif/Edit.cshtml
Normal file
@ -0,0 +1,58 @@
|
||||
@model VirtualTask.Models.AziendaRif
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Modifica</h1>
|
||||
|
||||
<h4 hidden>AziendaRif</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="piazihoc" class="control-label"></label>
|
||||
<input asp-for="piazihoc" class="form-control" />
|
||||
<span asp-validation-for="piazihoc" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="picodtec" class="control-label"></label>
|
||||
<input asp-for="picodtec" class="form-control" />
|
||||
<span asp-validation-for="picodtec" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pirifazi" class="control-label"></label>
|
||||
<input asp-for="pirifazi" class="form-control" />
|
||||
<span asp-validation-for="pirifazi" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pinomede" class="control-label"></label>
|
||||
<input asp-for="pinomede" class="form-control" />
|
||||
<span asp-validation-for="pinomede" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pilogurl" class="control-label"></label>
|
||||
<input asp-for="pilogurl" class="form-control" />
|
||||
<span asp-validation-for="pilogurl" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="pitextin" class="control-label"></label>
|
||||
<input asp-for="pitextin" class="form-control" />
|
||||
<span asp-validation-for="pitextin" 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">Torna indietro</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
93
Views/AziendaRif/Index.cshtml
Normal file
93
Views/AziendaRif/Index.cshtml
Normal file
@ -0,0 +1,93 @@
|
||||
@model IPagedList<VirtualTask.Models.AziendaRif>
|
||||
@using X.PagedList;
|
||||
@using X.PagedList.Mvc.Core;
|
||||
@using X.PagedList.Web.Common;
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Dati azienda</h1>
|
||||
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
<p>
|
||||
Cerca per tecnico: @Html.TextBox("SearchString")
|
||||
<input type="submit" value="Cerca" />
|
||||
</p>
|
||||
}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.piazihoc)*@
|
||||
Azienda
|
||||
</th>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.picodtec)*@
|
||||
Codice tecnico
|
||||
</th>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.pirifazi)*@
|
||||
Azienda riferimento
|
||||
</th>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.pinomede)*@
|
||||
Azienda collegata
|
||||
</th>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.pilogurl)*@
|
||||
Url logo
|
||||
</th>
|
||||
<th>
|
||||
@*@Html.DisplayNameFor(model => model.pitextin)*@
|
||||
Testo rapportino
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.piazihoc)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.picodtec)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.pirifazi)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.pinomede)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.pilogurl)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.pitextin)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Modifica", "Edit", new { id=item.picodtec }) |
|
||||
@Html.ActionLink("Dettaglio", "Details", new { id=item.picodtec }) |
|
||||
@Html.ActionLink("Elimina", "Delete", new { id=item.picodtec })
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<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>
|
||||
@ -43,6 +43,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Progressivi" asp-action="Index">PROGRESSIVI</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="AziendaRif" asp-action="Index">DATI AZIENDA</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user