Impianti
This commit is contained in:
parent
7ead066acc
commit
8d573b43cf
@ -15,7 +15,7 @@ namespace VirtualTask.Controllers
|
||||
string urlBase = string.Empty;
|
||||
string token = string.Empty;
|
||||
string tenant = string.Empty;
|
||||
|
||||
string errMes = string.Empty;
|
||||
HttpClient client;
|
||||
public ImpiantiController()
|
||||
{
|
||||
@ -46,27 +46,34 @@ namespace VirtualTask.Controllers
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Impianto>>(data);
|
||||
modelList = modelList.Where(s => !string.IsNullOrEmpty(s.imcodimp)).ToList();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchString))
|
||||
{
|
||||
modelList = modelList.Where(s => s.indirizzo.ToUpper().Contains(searchString.ToUpper())).ToList();
|
||||
ViewData["CurrentFilter"] = searchString;
|
||||
if (!string.IsNullOrEmpty(searchString))
|
||||
{
|
||||
modelList = modelList.Where(s => s.indirizzo.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.imcodimp)
|
||||
.ToPagedList(page ?? 1, pageSize);
|
||||
|
||||
return View(shortLinks);
|
||||
}
|
||||
else
|
||||
ViewData["CurrentFilter"] = null;
|
||||
|
||||
if (page != null && page < 1)
|
||||
{
|
||||
page = 1;
|
||||
errMes = response.Content.ReadAsStringAsync().Result;
|
||||
helper.SetStringValue("errMsg", errMes);
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
var pageSize = 10;
|
||||
|
||||
var shortLinks = modelList
|
||||
.OrderByDescending(s => s.imcodimp)
|
||||
.ToPagedList(page ?? 1, pageSize);
|
||||
|
||||
return View(shortLinks);
|
||||
|
||||
}
|
||||
|
||||
@ -167,7 +174,7 @@ namespace VirtualTask.Controllers
|
||||
modelList = JsonConvert.DeserializeObject<List<Impianto>>(data);
|
||||
impianto = modelList.Where(x => x.imcodimp.Equals(id)).First();
|
||||
}
|
||||
|
||||
ViewBag.AllStockList = LoadStockitems();
|
||||
return View(impianto);
|
||||
}
|
||||
|
||||
|
||||
@ -17,11 +17,7 @@
|
||||
<input asp-for="imcodimp" class="form-control" />
|
||||
<span asp-validation-for="imcodimp" class="text-danger"></span>
|
||||
</div>
|
||||
@* <div class="form-group">
|
||||
<label asp-for="imcodazi" class="control-label"></label>
|
||||
<input asp-for="imcodazi" class="form-control" />
|
||||
<span asp-validation-for="imcodazi" class="text-danger"></span>
|
||||
</div>*@
|
||||
|
||||
@Html.HiddenFor(m => m.imcodazi)
|
||||
<div class="form-group">
|
||||
<label asp-for="imdescri" class="control-label"></label>
|
||||
@ -87,15 +83,6 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" />
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
|
||||
<!-- (Optional) Latest compiled and minified JavaScript translation files -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/i18n/defaults-*.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
@ -17,11 +17,7 @@
|
||||
<input asp-for="imcodimp" class="form-control" />
|
||||
<span asp-validation-for="imcodimp" class="text-danger"></span>
|
||||
</div>
|
||||
@* <div class="form-group">
|
||||
<label asp-for="imcodazi" class="control-label"></label>
|
||||
<input asp-for="imcodazi" class="form-control" />
|
||||
<span asp-validation-for="imcodazi" class="text-danger"></span>
|
||||
</div> *@
|
||||
|
||||
@Html.HiddenFor(x => x.imcodazi)
|
||||
<div class="form-group">
|
||||
<label asp-for="imdescri" class="control-label"></label>
|
||||
@ -75,7 +71,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="imultcli" class="control-label"></label>
|
||||
<input asp-for="imultcli" class="form-control" />
|
||||
@Html.DropDownListFor(x =>x.imultcli,(IEnumerable<SelectListItem>)ViewBag.AllStockList,new {@class = "form-control"})
|
||||
<span asp-validation-for="imultcli" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -94,6 +90,21 @@
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css" />
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.min.js"></script>
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/css/bootstrap-select.min.css">
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/bootstrap-select.min.js"></script>
|
||||
<!-- (Optional) Latest compiled and minified JavaScript translation files -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.14/dist/js/i18n/defaults-*.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#imultcli").select2();
|
||||
});
|
||||
</script>
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
|
||||
@ -22,106 +22,27 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Cod. Impianto
|
||||
</th>
|
||||
<th>
|
||||
Azienda
|
||||
</th>
|
||||
<th>
|
||||
Descrizione
|
||||
</th>
|
||||
<th>Cod. Impianto</th>
|
||||
<th>Azienda</th>
|
||||
<th>Descrizione</th>
|
||||
<th>Indirizzo</th>
|
||||
@* <th>
|
||||
@Html.DisplayNameFor(model => model.imindiri1)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imindiri2)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imindiri3)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imindiri4)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imindiri5)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imlocali)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imcodcap)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.imcomune)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.improvin)
|
||||
</th>*@
|
||||
<th>
|
||||
Cod. Cliente
|
||||
</th>
|
||||
<th>Cod. Clienterr</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
|
||||
string message = string.Empty;
|
||||
if (!string.IsNullOrEmpty(item.imindiri1))
|
||||
message = message + item.imindiri1;
|
||||
if (!string.IsNullOrEmpty(item.imindiri2))
|
||||
message = " "+message + item.imindiri2;
|
||||
if (item.imindiri3!=null)
|
||||
message = "," + message + Convert.ToString( item.imindiri3);
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imcodimp)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imcodazi)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imdescri)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.indirizzo)
|
||||
</td>
|
||||
@* <td>
|
||||
@Html.DisplayFor(modelItem => item.imindiri1)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imindiri2)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imindiri3)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imindiri4)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imindiri5)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imlocali)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imcodcap)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imcomune)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.improvin)
|
||||
</td>*@
|
||||
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.imultcli)
|
||||
</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.imcodimp)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.imcodazi)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.imdescri)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.indirizzo)</td>
|
||||
<td>@Html.DisplayFor(modelItem => item.imultcli)pppp</td>
|
||||
<td>
|
||||
@Html.ActionLink("Edit", "Edit", new { id=item.imcodimp }) |
|
||||
@Html.ActionLink("Details", "Details", new { id=item.imcodimp }) |
|
||||
|
||||
Loading…
Reference in New Issue
Block a user