MICHELE: DATI AZIENDA tolta azienda + combo impianti
This commit is contained in:
parent
3e6e25ccdf
commit
6bc8405ca7
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Newtonsoft.Json;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
@ -101,6 +102,7 @@ namespace VirtualTask.Controllers
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
admin = helper.GetStringValue("admin");
|
||||
ViewBag.Admin = admin;
|
||||
ViewBag.Impianti = getImpianti();
|
||||
|
||||
return View();
|
||||
}
|
||||
@ -219,6 +221,7 @@ namespace VirtualTask.Controllers
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
ViewBag.Impianti = getImpianti();
|
||||
return View(aziRif);
|
||||
}
|
||||
|
||||
@ -335,6 +338,46 @@ namespace VirtualTask.Controllers
|
||||
|
||||
#endregion DELETE
|
||||
|
||||
#region Metodi Interni
|
||||
|
||||
private List<SelectListItem> getImpianti()
|
||||
{
|
||||
SessionHelper helper = new SessionHelper(this);
|
||||
token = helper.GetStringValue("tok");
|
||||
apiUrl = helper.GetStringValue("apiUrl");
|
||||
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<Impianto> modelList = new List<Impianto>();
|
||||
HttpResponseMessage response = client.GetAsync(baseAddress).Result;
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Impianto>>(data);
|
||||
|
||||
//per gestire primo elemento tendina (deve essere vuoto)
|
||||
SelectListItem listItemFirt = new SelectListItem();
|
||||
|
||||
listItemFirt.Value = string.Empty;
|
||||
listItemFirt.Text = " - Impianto";
|
||||
selectItems.Add(listItemFirt);
|
||||
|
||||
foreach (var role in modelList)
|
||||
{
|
||||
SelectListItem listItem = new SelectListItem();
|
||||
string s = role.imcodimp + " - " + role.imdescri;
|
||||
listItem.Value = role.imcodimp;
|
||||
listItem.Text = s;
|
||||
selectItems.Add(listItem);
|
||||
}
|
||||
}
|
||||
|
||||
return selectItems;
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
@ -343,5 +386,6 @@ namespace VirtualTask.Controllers
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e });
|
||||
}
|
||||
|
||||
#endregion Metodi Interni
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,6 +192,7 @@ namespace VirtualTask.Controllers
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
ViewBag.Impiabti = getImpianti();
|
||||
return View(commessa);
|
||||
}
|
||||
|
||||
@ -212,14 +213,6 @@ namespace VirtualTask.Controllers
|
||||
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<CommesseVT_Table> modelList = new List<CommesseVT_Table>();
|
||||
|
||||
@ -520,8 +513,6 @@ namespace VirtualTask.Controllers
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier, ErrMsg = e });
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region CASCADING
|
||||
@ -533,7 +524,6 @@ namespace VirtualTask.Controllers
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Cascading(string lacodcli)
|
||||
{
|
||||
|
||||
@ -15,14 +15,16 @@
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<h5><label asp-for="piazihoc" class="agy-client-quote"></label></h5>
|
||||
<input asp-for="piazihoc" class="agy-form-field require" placeholder="Azienda" />
|
||||
<span asp-validation-for="piazihoc" class="text-danger"></span>
|
||||
@* <h5><label asp-for="piazihoc" class="agy-client-quote"></label></h5> *@
|
||||
@Html.HiddenFor(x => x.piazihoc)
|
||||
@* <input asp-for="piazihoc" class="agy-form-field require" placeholder="Azienda" /> *@
|
||||
@* <span asp-validation-for="piazihoc" 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="picodtec" class="agy-client-quote"></label></h5>
|
||||
<input asp-for="picodtec" class="agy-form-field require" placeholder="Cod. Tecnico" />
|
||||
@* <input asp-for="picodtec" class="agy-form-field require" placeholder="Cod. Tecnico" /> *@
|
||||
@Html.DropDownListFor(x => x.picodtec, (IEnumerable<SelectListItem>)ViewBag.Impianti, new { @class = "form-control" })
|
||||
<span asp-validation-for="picodtec" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-12"> </div>
|
||||
|
||||
@ -16,13 +16,15 @@
|
||||
|
||||
<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>
|
||||
@* <label asp-for="piazihoc" class="control-label"></label> *@
|
||||
@Html.HiddenFor(x => x.piazihoc)
|
||||
@* <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" />
|
||||
@* <input asp-for="picodtec" class="form-control" /> *@
|
||||
@Html.DropDownListFor(x => x.picodtec, (IEnumerable<SelectListItem>)ViewBag.Impianti, new {@class = "form-control"})
|
||||
<span asp-validation-for="picodtec" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Seriale</th>
|
||||
@* <th>Seriale</th> *@
|
||||
<th>Esercizio</th>
|
||||
<th>Numero</th>
|
||||
<th>Data</th>
|
||||
@ -47,7 +47,8 @@
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.chserial)
|
||||
@* @Html.DisplayFor(modelItem => item.chserial) *@
|
||||
@Html.HiddenFor(modelItem => item.chserial)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.chcodese)
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<input asp-for="ladeslav" class="agy-form-field" class="form-control" placeholder="Descr. lavoro"/>
|
||||
<span asp-validation-for="ladeslav" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
@Html.HiddenFor(x => x.ladatchi)
|
||||
@* <label asp-for="ladatchi" class="control-label"></label>
|
||||
<input asp-for="ladatchi" class="agy-form-field" class="form-control" />
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
@{
|
||||
string location = string.Empty;
|
||||
// s = @"https://www.google.com/maps/dir/Polo+Informatico,+Via+Curio+Fornaci,+Terni,+TR/'45.59135,10.243048'/@43.7193823,8.2834344,7z/data=!3m1!4b1!4m11!4m10!1m5!1m1!1s0x132ee4b0d0b5464b:0xfe6f167f10da0915!2m2!1d12.612868!2d42.5681488!1m3!2m2!1d10.243048!2d45.59135?hl=it&entry=ttu";
|
||||
location = @"https://www.google.com/maps/dir/Polo+Informatico,+Via+Curio+Fornaci,+Terni,+TR//@42.5682046,12.5716686,13z/data=!4m8!4m7!1m5!1m1!1s0x132ee4b0d0b5464b:0xfe6f167f10da0915!2m2!1d12.612868!2d42.5681488!1m0?hl=it&entry=ttu";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user