From 31befcc8a58171387230bdcb9e7b1d8e05594d70 Mon Sep 17 00:00:00 2001 From: michele Date: Mon, 20 Nov 2023 10:37:43 +0100 Subject: [PATCH] MICHELE: commesse --- Controllers/CommesseVTController.cs | 458 +++++++++++++++++++++++ Models/CommesseVT.cs | 41 ++ Models/CommesseVT_Table.cs | 34 ++ Views/CommesseVT/Create.cshtml | 216 +++++++++++ Views/CommesseVT/Delete.cshtml | 141 +++++++ Views/CommesseVT/Details.cshtml | 135 +++++++ Views/CommesseVT/Edit.cshtml | 144 +++++++ Views/CommesseVT/Index.cshtml | 271 ++++++++++++++ Views/Registrazioni/Create.cshtml | 2 +- Views/Shared/_LayoutAreaRiservata.cshtml | 2 + 10 files changed, 1443 insertions(+), 1 deletion(-) create mode 100644 Controllers/CommesseVTController.cs create mode 100644 Models/CommesseVT.cs create mode 100644 Models/CommesseVT_Table.cs create mode 100644 Views/CommesseVT/Create.cshtml create mode 100644 Views/CommesseVT/Delete.cshtml create mode 100644 Views/CommesseVT/Details.cshtml create mode 100644 Views/CommesseVT/Edit.cshtml create mode 100644 Views/CommesseVT/Index.cshtml diff --git a/Controllers/CommesseVTController.cs b/Controllers/CommesseVTController.cs new file mode 100644 index 0000000..8ad8eb3 --- /dev/null +++ b/Controllers/CommesseVTController.cs @@ -0,0 +1,458 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Newtonsoft.Json; +using System.Diagnostics; +using System.Text; +using VirtualTask.Models; +using X.PagedList; + +namespace VirtualTask.Controllers +{ + public class CommesseVTController : Controller + { + string apiUrl = string.Empty; + string urlBase = string.Empty; + string token = string.Empty; + string tenant = string.Empty; + string errMes = string.Empty; + string admin = string.Empty; + + + HttpClient client; + private readonly IConfiguration _configuration; + + public CommesseVTController(IConfiguration configuration) + { + client = new HttpClient(); + _configuration = configuration; + var key = _configuration["ApplicationInsights:rootUrlApi"]; + apiUrl = key; + } + + #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"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + urlBase = apiUrl + "commesseList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + + client = new HttpClient(); + client.BaseAddress = baseAddress; + + List modelList = new List(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + + if (!string.IsNullOrEmpty(searchString)) + { + modelList = modelList.Where(s => s.andescri.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.lacodcom) + .ToPagedList(page ?? 1, pageSize); + + return View(shortLinks); + + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + //return View(); + } + + #endregion INDEX + + #region CREATE + + public IActionResult Create() + { + SessionHelper helper = new SessionHelper(this); + + admin = helper.GetStringValue("admin"); + + ViewBag.Admin = admin; + + ViewBag.Impianti = getImpianti(); + ViewBag.Anag = getClienti(); + return View(); + } + + [HttpPost] + public IActionResult Create (CommesseVT_Table model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + + if (string.IsNullOrEmpty(token)) + { + return RedirectToAction("Index", "Login"); + } + + model.lacodazi = tenant; + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "commesseVT/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"); + } + + //return View(); + } + + #endregion CREATE + + #region DETAILS + + public IActionResult Details(string id) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "commesseList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + CommesseVT_Table commessa = new CommesseVT_Table(); + List modelList = new List(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + commessa = modelList.Where(x => x.laserial.Equals(id)).First(); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("Error", errMes); + return RedirectToAction("Error"); + } + + return View(commessa); + } + + #endregion DETAILS + + #region EDIT + + public IActionResult Edit(string id) + { + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "commesseList"; + urlBase = urlBase + "?token=" + token; + Uri baseAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseAddress; + + + ViewBag.Impianti = getImpianti(); + ViewBag.Anag = getClienti(); + //urlBase = "http://10.0.0.187:8000/api/Polo" + //Uri baseAddress = new Uri(urlBase); + //client = new HttpClient(); + //client.BaseAddress = baseAddress; + + CommesseVT_Table commessa = new CommesseVT_Table(); + List modelList = new List(); + + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + commessa = modelList.Where(x => x.laserial.Equals(id)).First(); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + + return View(commessa); + } + + [HttpPost] + public IActionResult Edit(CommesseVT_Table model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); + admin = helper.GetStringValue("admin"); + ViewBag.Admin = admin; + + if (string.IsNullOrEmpty(token)) + { + return RedirectToAction("Index", "Login"); + } + + model.lacodazi = tenant; + + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "commesseVT/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(urlBase, 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 + "commesseList"; + urlBase = urlBase + "?token=" + token; + Uri baseaAddress = new Uri(urlBase); + client = new HttpClient(); + client.BaseAddress = baseaAddress; + + CommesseVT_Table commesse = new CommesseVT_Table(); + List modelList = new List(); + HttpResponseMessage response = client.GetAsync(baseaAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + commesse = modelList.Where(x => x.laserial.Equals(id)).First(); + + return View(commesse); + } + else + { + errMes = response.Content.ReadAsStringAsync().Result; + helper.SetStringValue("errMsg", errMes); + return RedirectToAction("Error"); + } + } + + [HttpPost, ActionName("DeleteConfirmed")] + public IActionResult DeleteConfirmed(CommesseVT_Table model) + { + SessionHelper helper = new SessionHelper(this); + + token = helper.GetStringValue("tok"); + tenant = helper.GetStringValue("tenant"); + model.lacodazi = tenant; + model.ladatchi = DateTime.Now; + apiUrl = helper.GetStringValue("apiUrl"); + urlBase = apiUrl + "commesse/del"; + 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 DELETE + + #region METODI INTERNI + + private List getImpianti() + { + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + //apiUrl = helper.GetStringValue("") + 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(); + HttpResponseMessage response = client.GetAsync(baseAddress).Result; + + if (response.IsSuccessStatusCode) + { + string data = response.Content.ReadAsStringAsync().Result; + modelList = JsonConvert.DeserializeObject>(data); + foreach (var item in modelList) + { + SelectListItem listItem = new SelectListItem(); + string s = item.imcodimp + " - " + item.imdescri; + listItem.Value = item.imcodimp; + listItem.Text = s; + selectItems.Add(listItem); + } + } + + return selectItems; + } + + private List getClienti() + { + SessionHelper helper = new SessionHelper(this); + token = helper.GetStringValue("tok"); + urlBase = apiUrl + "anagraficheList"; + 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 listItemFirst = new SelectListItem(); + + listItemFirst.Value = string.Empty; + listItemFirst.Text = " - cliente"; + selectItems.Add(listItemFirst); + + foreach (var item in modelList) + { + SelectListItem listItem = new SelectListItem(); + + string s = item.ancodice + " - " + item.andescri; + listItem.Value = item.ancodice; + listItem.Text = s; + selectItems.Add(listItem); + } + } + + return selectItems; + } + + [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 }); + } + + //private bool checkAziendaPresente(string azienda) + //{ + // bool trovato = false; + // bool bAziPres = false; + + // //urlBase = "http://10.0.0.187:8000/api/Polo/AziendePresentiList"; + // urlBase = apiUrl + "AziendePresentiList"; + // 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); + // foreach (AziendaPres a in modelList) + // { + // if (!string.IsNullOrEmpty(a.tccodazi) && a.tccodazi.Trim().Equals(azienda)) + // trovato = true; + // } + // bAziPres = trovato; + // } + // return bAziPres; + //} + + #endregion ALTRI METODI + } +} diff --git a/Models/CommesseVT.cs b/Models/CommesseVT.cs new file mode 100644 index 0000000..f02b546 --- /dev/null +++ b/Models/CommesseVT.cs @@ -0,0 +1,41 @@ +namespace VirtualTask.Models +{ + //CLASSE PER LA LISTA + public class CommesseVT + { + /// seriale Commessa + public string? laserial { get; set; } + /// Azienda + public string? lacodazi { get; set; } + /// Codice Commessa + public string? lacodcom { get; set; } + /// Fase Commessa + public string? ladeslav { get; set; } + /// data fine validita Commessa + public DateTime? ladatchi { get; set; } + /// tipo + public string? latipcli { get; set; } + /// codice cliente + public string? lacodcli { get; set; } + /// descrizione cliente + public string? andescri { get; set; } + /// impianto + public string? imcodimp { get; set; } + /// tipo ind + public string? imindiri1 { get; set; } + /// indirizzo + public string? imindiri2 { get; set; } + /// numero + public int? imindiri3 { get; set; } + /// lettera + public string? imindiri4 { get; set; } + /// scala + public string? imindiri5 { get; set; } + /// localita + public string? imlocali { get; set; } + /// CAP + public string? imcodcap { get; set; } + /// provincia + public string? improvin { get; set; } + } +} diff --git a/Models/CommesseVT_Table.cs b/Models/CommesseVT_Table.cs new file mode 100644 index 0000000..7b72118 --- /dev/null +++ b/Models/CommesseVT_Table.cs @@ -0,0 +1,34 @@ +using System.ComponentModel.DataAnnotations; + +namespace VirtualTask.Models +{ + //CLASSE PER OPERAZIONI INSERT/EDIT/DELETE + public class CommesseVT_Table + { + /// seriale Commessa + [Display(Name = "Seriale commessa")] + public string? laserial { get; set; } + /// Azienda + [Display(Name = "Azienda")] + public string? lacodazi { get; set; } + /// Codice Commessa + [Display(Name = "Codice Commessa")] + public string? lacodcom { get; set; } + /// Fase Commessa + [Display(Name = "Fase Commessa")] + public string? ladeslav { get; set; } + /// data fine validita Commessa (data obsolescienza) + [Display(Name = "Data fine commessa")] + public DateTime? ladatchi { get; set; } + /// tipo + [Display(Name = "Tipo")] + public string? latipcli { get; set; } + /// codice cliente + [Display(Name = "Cod. Cliente")] + public string? lacodcli { get; set; } + /// codice impianto + [Display(Name = "Cod. Impianto")] + public string? lacodimp { get; set; } + + } +} diff --git a/Views/CommesseVT/Create.cshtml b/Views/CommesseVT/Create.cshtml new file mode 100644 index 0000000..8a29768 --- /dev/null +++ b/Views/CommesseVT/Create.cshtml @@ -0,0 +1,216 @@ +@model VirtualTask.Models.CommesseVT_Table + +@{ + ViewData["Title"] = "Nuovo"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + +
+
+
+
+
+
+
+ +
+ + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + @* *@ + @Html.DropDownListFor(x => x.lacodcli,(IEnumerable)ViewBag.Anag, new{@class = "form-control"}) + +
+
 
+
+ + @* *@ + @Html.DropDownListFor(x => x.lacodimp,(IEnumerable)ViewBag.Impianti, new{@class = "form-control"}) + +
+
 
+
+ +
+ +
+
+
+ + + @section Scripts { + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } + } + +
+
+
+
+ +@*
+
+
+
+
+
+
+ +
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ + + +
+
 
+
+ +
+
+
+
+
+ + + + @section Scripts { + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } + } + +
+
+
*@ +@* +

Create

+ +

CommesseVT_Table

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} + *@ \ No newline at end of file diff --git a/Views/CommesseVT/Delete.cshtml b/Views/CommesseVT/Delete.cshtml new file mode 100644 index 0000000..03bbdf1 --- /dev/null +++ b/Views/CommesseVT/Delete.cshtml @@ -0,0 +1,141 @@ +@model VirtualTask.Models.CommesseVT_Table + +@{ + ViewData["Title"] = "Elimina"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + + +
+
+
+
+
+ @Html.DisplayNameFor(model => model.laserial) +
+
+ @Html.DisplayFor(model => model.laserial) +
+
+ @Html.DisplayNameFor(model => model.lacodazi) +
+
+ @Html.DisplayFor(model => model.lacodazi) +
+
+ @Html.DisplayNameFor(model => model.lacodcom) +
+
+ @Html.DisplayFor(model => model.lacodcom) +
+
+ @Html.DisplayNameFor(model => model.ladeslav) +
+
+ @Html.DisplayFor(model => model.ladeslav) +
+
+ @* @Html.DisplayNameFor(model => model.ladatchi) *@ + @Html.HiddenFor(model => model.ladatchi) +
+
+ @* @Html.DisplayFor(model => model.ladatchi) *@ + @Html.HiddenFor(model => model.ladatchi) +
+
+ @Html.DisplayNameFor(model => model.latipcli) +
+
+ @Html.DisplayFor(model => model.latipcli) +
+
+ @Html.DisplayNameFor(model => model.lacodcli) +
+
+ @Html.DisplayFor(model => model.lacodcli) +
+
+ @Html.DisplayNameFor(model => model.lacodimp) +
+
+ @Html.DisplayFor(model => model.lacodimp) +
+ +
+
 
+
+ + model.laserial) name="id" /> + +
+
+
+
+ + +@* +

Delete

+ +

Are you sure you want to delete this?

+
+

CommesseVT_Table

+
+
+
+ @Html.DisplayNameFor(model => model.laserial) +
+
+ @Html.DisplayFor(model => model.laserial) +
+
+ @Html.DisplayNameFor(model => model.lacodazi) +
+
+ @Html.DisplayFor(model => model.lacodazi) +
+
+ @Html.DisplayNameFor(model => model.lacodcom) +
+
+ @Html.DisplayFor(model => model.lacodcom) +
+
+ @Html.DisplayNameFor(model => model.ladeslav) +
+
+ @Html.DisplayFor(model => model.ladeslav) +
+
+ @Html.DisplayNameFor(model => model.ladatchi) +
+
+ @Html.DisplayFor(model => model.ladatchi) +
+
+ @Html.DisplayNameFor(model => model.latipcli) +
+
+ @Html.DisplayFor(model => model.latipcli) +
+
+ @Html.DisplayNameFor(model => model.lacodcli) +
+
+ @Html.DisplayFor(model => model.lacodcli) +
+
+ @Html.DisplayNameFor(model => model.ladatobso) +
+
+ @Html.DisplayFor(model => model.ladatobso) +
+
+ +
+ | + Back to List +
+
+ *@ \ No newline at end of file diff --git a/Views/CommesseVT/Details.cshtml b/Views/CommesseVT/Details.cshtml new file mode 100644 index 0000000..51e9c5e --- /dev/null +++ b/Views/CommesseVT/Details.cshtml @@ -0,0 +1,135 @@ +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; +@using X.PagedList; +@model VirtualTask.Models.CommesseVT_Table + + +@{ + ViewData["Title"] = "Dettaglio"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + + +
+
+
+
+
+
+ @Html.DisplayNameFor(model => model.laserial) +
+
+ @Html.DisplayFor(model => model.laserial) +
+
+ @Html.DisplayNameFor(model => model.lacodazi) +
+
+ @Html.DisplayFor(model => model.lacodazi) +
+
+ @Html.DisplayNameFor(model => model.lacodcom) +
+
+ @Html.DisplayFor(model => model.lacodcom) +
+
+ @Html.DisplayNameFor(model => model.ladeslav) +
+
+ @Html.DisplayFor(model => model.ladeslav) +
+ @Html.HiddenFor(model => model.ladatchi) + @*
+ @Html.DisplayNameFor(model => model.ladatchi) +
+
+ @Html.DisplayFor(model => model.ladatchi) +
*@ +
+ @Html.DisplayNameFor(model => model.latipcli) +
+
+ @Html.DisplayFor(model => model.latipcli) +
+
+ @Html.DisplayNameFor(model => model.lacodcli) +
+
+ @Html.DisplayFor(model => model.lacodcli) +
+
+ @Html.DisplayFor(model => model.lacodimp) +
+ +
+ Torna alla lista + @* *@ +
+
+
+
+
+
+ +@*

Details

*@ +@* +
+

CommesseVT_Table

+
+
+
+ @Html.DisplayNameFor(model => model.laserial) +
+
+ @Html.DisplayFor(model => model.laserial) +
+
+ @Html.DisplayNameFor(model => model.lacodazi) +
+
+ @Html.DisplayFor(model => model.lacodazi) +
+
+ @Html.DisplayNameFor(model => model.lacodcom) +
+
+ @Html.DisplayFor(model => model.lacodcom) +
+
+ @Html.DisplayNameFor(model => model.ladeslav) +
+
+ @Html.DisplayFor(model => model.ladeslav) +
+
+ @Html.DisplayNameFor(model => model.ladatchi) +
+
+ @Html.DisplayFor(model => model.ladatchi) +
+
+ @Html.DisplayNameFor(model => model.latipcli) +
+
+ @Html.DisplayFor(model => model.latipcli) +
+
+ @Html.DisplayNameFor(model => model.lacodcli) +
+
+ @Html.DisplayFor(model => model.lacodcli) +
+
+ @Html.DisplayNameFor(model => model.ladatobso) +
+
+ @Html.DisplayFor(model => model.ladatobso) +
+
+
+
+ @Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) | + Back to List +
+ *@ \ No newline at end of file diff --git a/Views/CommesseVT/Edit.cshtml b/Views/CommesseVT/Edit.cshtml new file mode 100644 index 0000000..8a1fad2 --- /dev/null +++ b/Views/CommesseVT/Edit.cshtml @@ -0,0 +1,144 @@ +@model VirtualTask.Models.CommesseVT_Table + +@{ + ViewData["Title"] = "Modifica"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + + +
+
+
+
+
+
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ @Html.HiddenFor(x => x.ladatchi) + @* + + *@ +
+
+ + + +
+
+ + @Html.DropDownListFor(x => x.lacodcli,(IEnumerable)ViewBag.Anag, new{@class = "form-control"}) + @* *@ + +
+
+ + @Html.DropDownListFor(x => x.lacodimp,(IEnumerable)ViewBag.Impianti, new{@class = "form-control"}) + @* *@ + +
+
 
+
+ +
+
+
+
+ + + @section Scripts { + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + } + } +
+
+
+ + + +@*

Edit

*@ +@* +

CommesseVT_Table

+
+
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+
+
+
+ + + +@section Scripts { + @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} +} + *@ \ No newline at end of file diff --git a/Views/CommesseVT/Index.cshtml b/Views/CommesseVT/Index.cshtml new file mode 100644 index 0000000..4921eaa --- /dev/null +++ b/Views/CommesseVT/Index.cshtml @@ -0,0 +1,271 @@ +@using X.PagedList.Mvc.Core; +@using X.PagedList.Web.Common; +@using X.PagedList; +@model IPagedList + + +@{ + ViewData["Title"] = "Commesse"; + Layout = "~/Views/Shared/_LayoutAreaRiservata.cshtml"; +} + + +@*

Index

*@ +
+
+
+

+ Crea nuova commessa +

+ + @using (Html.BeginForm()) + { + +
+
@Html.TextBox("SearchString", null, new { placeholder = "Cerca per commessa", @class = "agy-form-field require" })
+
 
+
+ +
+ + } + + + + + + + + + + + + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + + + + + + + + + + + + + } + +
Seriale CommessaAziendaCod. CommessaFase CommessaTipoCod. ClienteClienteimpianto
+ @Html.DisplayFor(modelItem => item.laserial) + + @Html.DisplayFor(modelItem => item.lacodazi) + + @Html.DisplayFor(modelItem => item.lacodcom) + + @Html.DisplayFor(modelItem => item.ladeslav) + + @Html.DisplayFor(modelItem => item.latipcli) + + @Html.DisplayFor(modelItem => item.lacodcli) + + @Html.DisplayFor(modelItem => item.andescri) + + @Html.DisplayFor(modelItem => item.imcodimp) + + + Modifica + + | + + Dettaglio + + | + + Elimina + +
+
+ + +
+
+
+@* + + + + +

+ Create New +

+ + + + + + + + + + + + + + + + + + + + + + + + +@foreach (var item in Model) { + + + + + + + + + + + + + + + + + + + + +} + *@ +
+ @Html.DisplayFor(modelItem => modelItem.laserial) + + @Html.DisplayNameFor(model => model.lacodazi) + + @Html.DisplayNameFor(model => model.lacodcom) + + @Html.DisplayNameFor(model => model.ladeslav) + + @Html.DisplayNameFor(model => model.ladatchi) + + @Html.DisplayNameFor(model => model.latipcli) + + @Html.DisplayNameFor(model => model.lacodcli) + + @Html.DisplayNameFor(model => model.andescri) + + @Html.DisplayNameFor(model => model.imcodimp) + + @Html.DisplayNameFor(model => model.imindiri1) + + @Html.DisplayNameFor(model => model.imindiri2) + + @Html.DisplayNameFor(model => model.imindiri3) + + @Html.DisplayNameFor(model => model.imindiri4) + + @Html.DisplayNameFor(model => model.imindiri5) + + @Html.DisplayNameFor(model => model.imlocali) + + @Html.DisplayNameFor(model => model.imcodcap) + + @Html.DisplayNameFor(model => model.improvin) +
+ @Html.DisplayFor(modelItem => item.laserial) + + @Html.DisplayFor(modelItem => item.lacodazi) + + @Html.DisplayFor(modelItem => item.lacodcom) + + @Html.DisplayFor(modelItem => item.ladeslav) + + @Html.DisplayFor(modelItem => item.ladatchi) + + @Html.DisplayFor(modelItem => item.latipcli) + + @Html.DisplayFor(modelItem => item.lacodcli) + + @Html.DisplayFor(modelItem => item.andescri) + + @Html.DisplayFor(modelItem => item.imcodimp) + + @Html.DisplayFor(modelItem => item.imindiri1) + + @Html.DisplayFor(modelItem => item.imindiri2) + + @Html.DisplayFor(modelItem => item.imindiri3) + + @Html.DisplayFor(modelItem => item.imindiri4) + + @Html.DisplayFor(modelItem => item.imindiri5) + + @Html.DisplayFor(modelItem => item.imlocali) + + @Html.DisplayFor(modelItem => item.imcodcap) + + @Html.DisplayFor(modelItem => item.improvin) + + @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) | + @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | + @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) +
diff --git a/Views/Registrazioni/Create.cshtml b/Views/Registrazioni/Create.cshtml index 25a5aa8..80d5276 100644 --- a/Views/Registrazioni/Create.cshtml +++ b/Views/Registrazioni/Create.cshtml @@ -8,7 +8,7 @@
-

@ViewData["Title"]

+ @*

@ViewData["Title"]

*@
@Html.ValidationSummary(false, "", new { @class = "text-danger" }) diff --git a/Views/Shared/_LayoutAreaRiservata.cshtml b/Views/Shared/_LayoutAreaRiservata.cshtml index c70358a..a1f6515 100644 --- a/Views/Shared/_LayoutAreaRiservata.cshtml +++ b/Views/Shared/_LayoutAreaRiservata.cshtml @@ -146,6 +146,8 @@ Purchase:
  • Chiamate
  • Progressivi
  • Dati Azienda
  • +
  • Commesse
  • + @{ if(admin.Equals("S")) {