completata review MagStatus

x selezione magazzino SX/DX da select
This commit is contained in:
Samuele E. Locatelli (WEB DEV)
2016-10-04 00:17:59 +02:00
parent 90109bb3ad
commit 75c01c08e9
7 changed files with 111 additions and 8 deletions
@@ -47,6 +47,18 @@ namespace StockManMVC.Controllers
return View(itemStock.ToList());
}
/// <summary>
/// Elenco x famiglia ordine qta desc
/// </summary>
/// <param name="LocationID"></param>
/// <returns></returns>
public ActionResult ListByLocation(string LocationID)
{
if (LocationID == null) LocationID = "";
var itemStock = db.ItemStock.Where(s => s.LocationID == LocationID && s.QtyConf > 0).OrderByDescending(x => x.QtyConf);
return PartialView("ListByLocation", itemStock);
}
// GET: ItemStocks/Details/5
public ActionResult Details(int? id)
{
@@ -155,7 +155,6 @@ namespace StockManMVC.Controllers
var item = db.Item.Where(s => s.ItemFamilyID == FamilyID).OrderByDescending(x=>x.QtaPend);
return PartialView("ListByFamily", item);
}
// GET: Items/Consolidate/5?caller=callingController
public ActionResult Consolidate(int? id, string caller)
+1
View File
@@ -446,6 +446,7 @@
<Content Include="Views\Items\Edit.cshtml" />
<Content Include="Views\ItemFluxes\CreatePrecompiled.cshtml" />
<Content Include="Views\Items\ListByFamily.cshtml" />
<Content Include="Views\ItemStocks\ListByLocation.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
@@ -0,0 +1,68 @@
@model IEnumerable<StockManMVC.Models.ItemStock>
<div class="panel panel-info">
<div class="panel-heading">
<div class="row">
<div class="col-sm-8">
<strong>@Html.DisplayNameFor(model => model.Location.Descr)</strong>
</div>
<div class="col-sm-4">
<a href="@Url.Action("", "MagStatus")" class="btn btn-info btn-sm">reset <i class="glyphicon glyphicon-retweet"></i></a>
</div>
</div>
</div>
<div class="panel-body small">
<table class="table table-condensed table-responsive table-striped table-hover table-bordered table">
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.Item.CodInt)
</th>
<th>
@Html.DisplayNameFor(model => model.Item.Descr)
</th>
<th>
@Html.DisplayNameFor(model => model.QtyConf)
</th>
<th class="text-right">
@Html.DisplayNameFor(model => model.Item.CurrValue)
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
<a href="@Url.Action("Details", "Items", new { id = item.ID, StockItemID = item.ID, FluxItemID = item.ID })" class="btn btn-sm btn-info">
<i class="glyphicon glyphicon-search" aria-hidden="true"></i>
</a>
</td>
<td>
<div class="tNoWrap">
@Html.DisplayFor(modelItem => item.Item.CodInt)
</div>
<div class="small tNote">
(@Html.DisplayFor(modelItem => item.Item.CodExt))
</div>
</td>
<td>
<div>
@Html.DisplayFor(modelItem => item.Item.Descr)
</div>
<div class="small tNote">
(@Html.DisplayFor(modelItem => item.Item.DescrExt))
</div>
</td>
<td>
@Html.DisplayFor(modelItem => item.QtyConf)
</td>
<td class="text-right">
@Html.DisplayFor(modelItem => item.Item.CurrValue)
</td>
</tr>
}
</table>
</div>
</div>
+1 -1
View File
@@ -42,7 +42,7 @@
@Html.DisplayFor(modelItem => item.CodInt)
</div>
<div class="small tNote">
(@Html.DisplayFor(modelItem => item.CodInt))
(@Html.DisplayFor(modelItem => item.CodExt))
</div>
</td>
+29 -6
View File
@@ -5,6 +5,10 @@
}
<div class="row" style="margin-top: 0.5em;">
@*<div class="col-sm-5">
<div class="" id="divChild">
</div>
</div>*@
<div class="col-sm-10 col-sm-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
@@ -13,6 +17,7 @@
<div class="panel-body">
<table class="table table-condensed table-responsive table-striped">
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.Location.Descr)
</th>
@@ -28,11 +33,15 @@
<th class="text-right">
@Html.DisplayNameFor(model => model.TotVal)
</th>
<th></th>
</tr>
@foreach (var item in Model)
{
<tr>
<tr id="@("row_"+item.LocationID)" class="singleRow">
<td class="text-center" style="width: 4em;">
<button class="btn btn-sm btn-info" title="Seleziona SX" onclick="LoadSx('@item.LocationID');"><i class="glyphicon glyphicon-search"></i></button>
</td>
<td>
@Html.DisplayFor(modelItem => item.Location.Descr)
</td>
@@ -48,6 +57,10 @@
<td class="text-right">
@Html.DisplayFor(modelItem => item.TotVal)
</td>
<td class="text-center" style="width: 4em;">
<button class="btn btn-sm btn-primary" title="Seleziona DX" onclick="LoadDx('@item.LocationID');"><i class="glyphicon glyphicon-search"></i></button>
</td>
</tr>
}
</table>
@@ -56,8 +69,6 @@
</div>
</div>
<div class="row" style="margin-top: 0.5em;">
@*@using (Html.BeginForm("Index", "MagStatus", FormMethod.Get))
{*@
<div class="col-sm-5 col-sm-offset-1 small">
<div class="panel panel-info">
<div class="panel-heading">
@@ -113,7 +124,6 @@
</div>
</div>
</div>
@*}*@
<script type="text/javascript">
@@ -134,14 +144,27 @@
refreshSelectedData();
});
});
function scambiaSel()
{
function scambiaSel() {
var LocationIdSx = $("#LocationID_SX").val();
var LocationIdDx = $("#LocationID_DX").val();
$("#LocationID_SX").val(LocationIdDx);
$("#LocationID_DX").val(LocationIdSx);
refreshSelectedData();
}
function updateSelect() {
refreshSelectedData();
$(".singleRow").removeClass("bg-info");
$("#row_" + ID).addClass("bg-info");
}
function LoadSx(ID) {
$("#LocationID_SX").val(ID);
updateSelect();
}
function LoadDx(ID) {
$("#LocationID_DX").val(ID);
updateSelect();
}
</script>
</div>
Binary file not shown.