aggiunto metodo scambia x scambiare le 2 locazioni
This commit is contained in:
@@ -29,27 +29,35 @@ namespace StockManMVC.Controllers
|
||||
return View(vLocationVal.ToList());
|
||||
}
|
||||
|
||||
//[HttpPost]
|
||||
//public ActionResult Index(string LocationID_SX, string LocationID_DX)
|
||||
//{
|
||||
// if (LocationID_SX == null) LocationID_SX = "";
|
||||
// if (LocationID_DX == null) LocationID_DX = "";
|
||||
// ViewBag.SelSX = LocationID_SX;
|
||||
// ViewBag.SelDX = LocationID_DX;
|
||||
// return View(Index());
|
||||
//}
|
||||
|
||||
// GET: MagStatus
|
||||
public ActionResult StockByLocation(string LocationID)
|
||||
public ActionResult StockByLocation(string LocationID, string LocationIDTo, bool? ShowMove)
|
||||
{
|
||||
var CurrStock = db.ItemStock
|
||||
.Where(s => s.QtyConf > 0 && s.LocationID == LocationID)
|
||||
.Include(v => v.Location)
|
||||
.Include(s => s.Item);
|
||||
|
||||
if (ShowMove == null) ShowMove = false;
|
||||
|
||||
ViewBag.LocationID = LocationID;
|
||||
ViewBag.LocationIDTo = LocationIDTo;
|
||||
ViewBag.ShowMove = ShowMove;
|
||||
return PartialView("_StockByLocation",CurrStock.ToList());
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Move(int ID, string LocationID, string LocationIDTo)
|
||||
{
|
||||
// chiamo la stored x il move
|
||||
|
||||
// appoggio variabili
|
||||
string SelSX = LocationIDTo;
|
||||
string SelDX = LocationID;
|
||||
// restituisco la view principale...
|
||||
return RedirectToAction("Index", new { LocationID_SX = SelSX, LocationID_DX = SelDX });
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="col-xs-4">
|
||||
<strong>Locazione</strong>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="col-xs-4">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
@*@Html.LabelFor(model => model.ExtLocationID, "Riferimento", htmlAttributes: new { @class = "control-label col-md-2" })*@
|
||||
@@ -70,37 +70,40 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<a href="@Url.Action("Index", "MagStatus", new { LocationID_SX = ViewBag.SelDX, LocationID_DX = ViewBag.SelSX })" class="btn btn-warning form-control">Scambia <i class="glyphicon glyphicon-retweet"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelSX })
|
||||
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelSX, LocationIDTo = @ViewBag.SelDX, ShowMove = true })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5 small">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<strong>Locazione</strong>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
@*@Html.LabelFor(model => model.ExtLocationID, "Riferimento", htmlAttributes: new { @class = "control-label col-md-2" })*@
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("LocationID_DX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control", @onchange = "this.form.submit();" })
|
||||
@*@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })*@
|
||||
</div>
|
||||
<div class="col-sm-5 small">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<strong>Locazione</strong>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
@*@Html.LabelFor(model => model.ExtLocationID, "Riferimento", htmlAttributes: new { @class = "control-label col-md-2" })*@
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("LocationID_DX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control", @onchange = "this.form.submit();" })
|
||||
@*@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelDX })
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelDX, LocationIDTo = @ViewBag.SelSX })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
@*<th>
|
||||
@Html.DisplayNameFor(model => model.Location.Descr)
|
||||
</th>*@
|
||||
@Html.DisplayNameFor(model => model.Location.Descr)
|
||||
</th>*@
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Item.Descr)
|
||||
</th>
|
||||
@@ -13,8 +13,8 @@
|
||||
@Html.DisplayNameFor(model => model.QtyConf)
|
||||
</th>
|
||||
@*<th>
|
||||
@Html.DisplayNameFor(model => model.Note)
|
||||
</th>*@
|
||||
@Html.DisplayNameFor(model => model.Note)
|
||||
</th>*@
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.dtLastUpd)
|
||||
</th>
|
||||
@@ -25,8 +25,8 @@
|
||||
{
|
||||
<tr>
|
||||
@*<td>
|
||||
@Html.DisplayFor(modelItem => item.Location.Descr)
|
||||
</td>*@
|
||||
@Html.DisplayFor(modelItem => item.Location.Descr)
|
||||
</td>*@
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Item.Descr)
|
||||
</td>
|
||||
@@ -34,18 +34,19 @@
|
||||
@Html.DisplayFor(modelItem => item.QtyConf)
|
||||
</td>
|
||||
@*<td>
|
||||
@Html.DisplayFor(modelItem => item.Note)
|
||||
</td>*@
|
||||
@Html.DisplayFor(modelItem => item.Note)
|
||||
</td>*@
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.dtLastUpd)
|
||||
</td>
|
||||
<td>
|
||||
@*@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
|
||||
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
|
||||
@Html.ActionLink("Delete", "Delete", new { id = item.ID })*@
|
||||
@Html.ActionLink("Sposta", "Move", new { id = item.ID })
|
||||
@if (ViewBag.ShowMove)
|
||||
{
|
||||
<a href="@Url.Action("Move", "MagStatus", new { id = item.ID, LocationID = ViewBag.LocationId, LocationIDTo = ViewBag.LocationIdTo })" class="btn btn-primary form-control" onClick="return confirm('Sicuro di voler procedere?')">Sposta <i class="glyphicon glyphicon-hand-right"></i></a>
|
||||
@*@Html.ActionLink("Sposta <i class=\"glyphicon glyphicon-retweet\"></i>", "Move", new { @class = "btn btn-info", id = item.ID, LocationID = ViewBag.LocationId, LocationIDTo = ViewBag.LocationIdTo });*@
|
||||
}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user