iniziato ad inglobare la partial view di dettaglio/editing x articolo...
This commit is contained in:
@@ -208,7 +208,7 @@ namespace StockManMVC
|
||||
.WithHeaderText("Operatore")
|
||||
.WithValueExpression(i => i.Operator.LastName + ", " + i.Operator.FirstName);
|
||||
cols.Add("Note").WithColumnName("Note")
|
||||
.WithVisibility(true, false)
|
||||
.WithVisibility(false, true)
|
||||
.WithHeaderText("Note")
|
||||
.WithValueExpression(i => i.Note);
|
||||
cols.Add("EditLink").WithColumnName("EditLink")
|
||||
|
||||
@@ -270,8 +270,8 @@ namespace StockManMVC.Controllers
|
||||
ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr", itemFlux.ItemID);
|
||||
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt", itemFlux.OperatorID);
|
||||
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID);
|
||||
|
||||
return View(itemFlux);
|
||||
|
||||
return PartialView("_CreatePrecompiled", itemFlux);
|
||||
}
|
||||
|
||||
// GET: ItemFluxes/Edit/5
|
||||
@@ -319,7 +319,7 @@ namespace StockManMVC.Controllers
|
||||
db.Entry(itemFlux).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
|
||||
// rimando ad azione differente...
|
||||
// rimando pag dettaglio...
|
||||
return RedirectToAction("Details", "Items", new { ID = itemFlux.ItemID, StockItemID = itemFlux.ItemID, FluxItemID = itemFlux.ItemID });
|
||||
//return RedirectToAction("Index");
|
||||
}
|
||||
@@ -329,7 +329,8 @@ namespace StockManMVC.Controllers
|
||||
ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt", itemFlux.OperatorID);
|
||||
ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID);
|
||||
|
||||
return View(itemFlux);
|
||||
// rimando pag dettaglio...
|
||||
return RedirectToAction("Details", "Items", new { ID = itemFlux.ItemID, StockItemID = itemFlux.ItemID, FluxItemID = itemFlux.ItemID });
|
||||
}
|
||||
|
||||
// GET: ItemFluxes/Delete/5
|
||||
|
||||
@@ -216,14 +216,14 @@ namespace StockManMVC.Controllers
|
||||
ViewBag.ItemID = (int)id;
|
||||
return View(item.ToList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ActionResult Grid()
|
||||
{
|
||||
var item = db.Item.Include(i => i.ItemFamily);
|
||||
return View(item.ToList());
|
||||
}
|
||||
|
||||
|
||||
// GET: Items/Details/5
|
||||
public ActionResult Details(int? id)
|
||||
{
|
||||
@@ -239,6 +239,24 @@ namespace StockManMVC.Controllers
|
||||
return View(item);
|
||||
}
|
||||
|
||||
|
||||
// GET: Items/Details/5
|
||||
public ActionResult CurrItemDetail(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
|
||||
}
|
||||
Item item = db.Item.Find(id);
|
||||
if (item == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
return PartialView("_ItemDetail", item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// GET: Items/Create
|
||||
public ActionResult Create()
|
||||
{
|
||||
@@ -312,7 +330,7 @@ namespace StockManMVC.Controllers
|
||||
{
|
||||
db.Entry(item).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
return RedirectToAction("Details", "Items", new { ID = item.ID, StockItemID = item.ID, FluxItemID = item.ID });
|
||||
}
|
||||
ViewBag.ItemFamilyID = new SelectList(db.ItemFamily, "ID", "Descr", item.ItemFamilyID);
|
||||
return View(item);
|
||||
|
||||
@@ -53,29 +53,38 @@ namespace StockManMVC.Models
|
||||
public Nullable<System.DateTime> dtExport;
|
||||
}
|
||||
|
||||
//public class ItemsMetadata
|
||||
//{
|
||||
// [StringLength(250)]
|
||||
// [Display(Name = "Descrizione Articolo")]
|
||||
// public string Descr;
|
||||
public class ItemMetadata
|
||||
{
|
||||
[StringLength(250)]
|
||||
[Display(Name = "Descr. Articolo")]
|
||||
public string Descr;
|
||||
|
||||
// [StringLength(50)]
|
||||
// [Display(Name = "Famiglia Articolo")]
|
||||
// public string Family;
|
||||
[StringLength(50)]
|
||||
[Display(Name = "Fam. Articolo")]
|
||||
public string ItemFamily;
|
||||
|
||||
// [StringLength(250)]
|
||||
// [Display(Name = "Descrizione Articolo Ext")]
|
||||
// public string DescrExt;
|
||||
[StringLength(250)]
|
||||
[Display(Name = "Descr. Articolo Ext")]
|
||||
public string DescrExt;
|
||||
|
||||
// [StringLength(250)]
|
||||
// [Display(Name = "Cod Articolo Ext")]
|
||||
// public string CodExt;
|
||||
[StringLength(250)]
|
||||
[Display(Name = "Cod. Ext")]
|
||||
public string CodExt;
|
||||
|
||||
// [StringLength(50)]
|
||||
// [Display(Name = "Cod Articolo Int")]
|
||||
// public string CodInt;
|
||||
[StringLength(50)]
|
||||
[Display(Name = "Cod. Int")]
|
||||
public string CodInt;
|
||||
|
||||
//}
|
||||
[Display(Name = "Giacenza Minima")]
|
||||
public string QtaMin;
|
||||
|
||||
[Display(Name = "Lotto acquisto")]
|
||||
public string QtaBatch;
|
||||
|
||||
[Display(Name = "Valore unit.")]
|
||||
public string CurrValue;
|
||||
|
||||
}
|
||||
|
||||
public class ItemStocksMetadata
|
||||
{
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace StockManMVC.Models
|
||||
{
|
||||
}
|
||||
|
||||
//[MetadataType(typeof(ItemsMetadata))]
|
||||
//public partial class Items
|
||||
//{
|
||||
//}
|
||||
[MetadataType(typeof(ItemMetadata))]
|
||||
public partial class Item
|
||||
{
|
||||
}
|
||||
|
||||
//[MetadataType(typeof(EnrollmentMetadata))]
|
||||
//public partial class Enrollment
|
||||
|
||||
@@ -449,6 +449,7 @@
|
||||
<Content Include="Views\MagStatus\Index.cshtml" />
|
||||
<Content Include="Views\MagStatus\_StockByLocation.cshtml" />
|
||||
<Content Include="Views\MagStatus\_confirmMove.cshtml" />
|
||||
<Content Include="Views\Items\_ItemDetail.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
||||
@@ -89,14 +89,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
@Html.LabelFor(model => model.dtExport, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.TextBoxFor(model => model.dtExport, new { @Value = Convert.ToDateTime(Model.dtExport).ToString("yyyy-MM-dd"), @class = "form-control date-picker", type = "date" })
|
||||
@Html.ValidationMessageFor(model => model.dtExport, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.OperatorID, "OperatorID", htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@@ -105,26 +97,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@*<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group no-color row">
|
||||
<div class="col-sm-3">
|
||||
<button type="submit" value="Save" class="btn btn-success form-control">Modifica <i class="glyphicon glyphicon-ok-circle"></i></button>
|
||||
<button type="submit" value="Save" class="btn btn-primary form-control">Salva modifiche <i class="glyphicon glyphicon-ok-circle"></i></button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="@Url.Action("Details", "Items", new { id=Model.ItemID, StockItemID= Model.ItemID, FluxItemID= Model.ItemID })" class="btn btn-info form-control">Torna ad elenco <i class="glyphicon glyphicon-retweet"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
@*<div>
|
||||
@Html.ActionLink("Torna ad elenco", "Details", "Items", new { id = Model.ItemID, StockItemID = Model.ItemID, FluxItemID = Model.ItemID }, null)
|
||||
</div>*@
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
|
||||
@@ -75,11 +75,10 @@
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-6">
|
||||
<button type="submit" class="btn btn-success form-control">Salva <i class="glyphicon glyphicon-ok-circle"></i></button>
|
||||
<button type="submit" class="btn btn-primary form-control">Salva <i class="glyphicon glyphicon-ok-circle"></i></button>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@*@Html.ActionLink("Torna ad elenco", "Details", "Items", new { id = itemID, StockItemID = itemID, FluxItemID = itemID }, null)*@
|
||||
<a href="@Url.Action("Details","Items", new { id = itemID, StockItemID = itemID, FluxItemID = itemID })" class="btn btn-danger form-control">Annulla <i class="glyphicon glyphicon-remove-circle"></i></a>
|
||||
<a href="@Url.Action("Details","Items", new { id = itemID, StockItemID = itemID, FluxItemID = itemID })" class="btn btn-info form-control">Annulla <i class="glyphicon glyphicon-remove-circle"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,82 +13,16 @@
|
||||
<strong>Dettaglio Articolo</strong>
|
||||
</div>
|
||||
<div class="panel-body small">
|
||||
<div>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Descr)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Descr)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CodInt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CodInt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CodExt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CodExt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.DescrExt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.DescrExt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.QtaMin)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.QtaMin)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.QtaBatch)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.QtaBatch)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CurrValue)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CurrValue)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.ItemFamily.Descr)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.ItemFamily.Descr)
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
@Html.Partial("_ItemDetail")
|
||||
<div id="itemPartialView">
|
||||
@*qui carico dinamicamente le view dell'ITEM*@
|
||||
</div>
|
||||
<p>
|
||||
@Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
|
||||
@Html.ActionLink("Back to List", "Index")
|
||||
</p>
|
||||
<button onclick="LoadItemDetail(@Model.ID);">carica</button>
|
||||
<button onclick="LoadItemEdit(@Model.ID);">edit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="col-sm-4 small">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Stock Giacenze</strong>
|
||||
@@ -98,13 +32,13 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 padZR">
|
||||
<a href="@Url.Action("Consolidate", "Items", new { id = Model.ID, caller="Items" })" class="btn btn-primary form-control" onClick="return confirm('Sicuro di voler confermare i movimenti da registrare?')">
|
||||
<a href="@Url.Action("Consolidate", "Items", new { id = Model.ID, caller="Items" })" class="btn btn-default form-control" onClick="return confirm('Sicuro di voler confermare i movimenti da registrare?')">
|
||||
<i class="glyphicon glyphicon-save" aria-hidden="true"></i>
|
||||
Conf. movimenti
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-6 padZL">
|
||||
<a href="@Url.Action("ShrinkHistory", "Items", new { id = Model.ID, caller="Items" })" class="btn btn-warning form-control" onClick="return confirm('Sicuro di voler eliminare i movimenti duplicati?')">
|
||||
<a href="@Url.Action("ShrinkHistory", "Items", new { id = Model.ID, caller="Items" })" class="btn btn-default form-control" onClick="return confirm('Sicuro di voler eliminare i movimenti duplicati?')">
|
||||
Elim. duplicati
|
||||
<i class="glyphicon glyphicon-compressed" aria-hidden="true"></i>
|
||||
</a>
|
||||
@@ -116,7 +50,7 @@
|
||||
<button class="btn btn-success form-control" onclick="CreateNewMov(@Model.ID, 'CAR');"><i class="glyphicon glyphicon-plus" aria-hidden="true"></i> Carico</button>
|
||||
</div>
|
||||
<div class="col-xs-4 padZRL">
|
||||
<button class="btn btn-info form-control" onclick="CreateNewMov(@Model.ID, 'RETT');"><i class="glyphicon glyphicon-edit" aria-hidden="true"></i> Rettifica</button>
|
||||
<button class="btn btn-warning form-control" onclick="CreateNewMov(@Model.ID, 'RETT');"><i class="glyphicon glyphicon-edit" aria-hidden="true"></i> Rettifica</button>
|
||||
</div>
|
||||
<div class="col-xs-4 padZL">
|
||||
<button class="btn btn-danger form-control" onclick="CreateNewMov(@Model.ID, 'SCAR');"><i class="glyphicon glyphicon-minus" aria-hidden="true"></i> Scarico</button>
|
||||
@@ -128,20 +62,20 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<div class="col-sm-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Movimenti</strong> (data indica movimenti <del>confermati</del> o <span class="text-warning mark">da registrare</span>)
|
||||
</div>
|
||||
<div class="panel-body small">
|
||||
@Html.Partial("_MVCGridToolbar", new StockManMVC.Models.MVCGridToolbarModel()
|
||||
{
|
||||
MVCGridName = "FluxItemsGrid",
|
||||
PageSize = true,
|
||||
ColumnVisibility = true,
|
||||
Export = false,
|
||||
GlobalSearch = true
|
||||
})
|
||||
{
|
||||
MVCGridName = "FluxItemsGrid",
|
||||
PageSize = true,
|
||||
ColumnVisibility = true,
|
||||
Export = false,
|
||||
GlobalSearch = true
|
||||
})
|
||||
@Html.MVCGrid("FluxItemsGrid")
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,4 +86,12 @@
|
||||
function CreateNewMov(ItemID, MovTypeID) {
|
||||
$("#divCreateMov").load('@(Url.Action("CreatePrecompiled", "ItemFluxes", null, Request.Url.Scheme))?ItemID=' + ItemID + '&MovTypeID=' + MovTypeID);
|
||||
}
|
||||
|
||||
function LoadItemDetail(ItemID) {
|
||||
$("#itemPartialView").load('@(Url.Action("CurrItemDetail", "Items", null, Request.Url.Scheme))?ID=' + ItemID);
|
||||
}
|
||||
|
||||
function LoadItemEdit(ItemID) {
|
||||
$("#itemPartialView").load('@(Url.Action("Edit", "Items", null, Request.Url.Scheme))?ID=' + ItemID);
|
||||
}
|
||||
</script>
|
||||
@@ -4,7 +4,7 @@
|
||||
ViewBag.Title = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
<h2>Modifica Articolo</h2>
|
||||
|
||||
|
||||
@using (Html.BeginForm())
|
||||
@@ -12,7 +12,6 @@
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
<div class="form-horizontal">
|
||||
<h4>Item</h4>
|
||||
<hr />
|
||||
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
|
||||
@Html.HiddenFor(model => model.ID)
|
||||
@@ -81,18 +80,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
|
||||
<div class="form-group no-color row">
|
||||
<div class="col-sm-3">
|
||||
<button type="submit" value="Save" class="btn btn-primary form-control">Salva Modifiche <i class="glyphicon glyphicon-ok-circle"></i></button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<a href="@Url.Action("Details", "Items", new { id=Model.ID, StockItemID= Model.ID, FluxItemID= Model.ID })" class="btn btn-info form-control">Torna ad Articolo <i class="glyphicon glyphicon-retweet"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
<div>
|
||||
@Html.ActionLink("Back to List", "Index")
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@Scripts.Render("~/bundles/jqueryval")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
@model StockManMVC.Models.Item
|
||||
|
||||
<div>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Descr)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Descr)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CodInt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CodInt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CodExt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CodExt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.DescrExt)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.DescrExt)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.QtaMin)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.QtaMin)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.QtaBatch)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.QtaBatch)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.CurrValue)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.CurrValue)
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.ItemFamily.Descr)
|
||||
</dt>
|
||||
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.ItemFamily.Descr)
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="form-group no-color row">
|
||||
<div class="col-sm-6">
|
||||
<a href="@Url.Action("Edit", "Items", new { id=Model.ID })" class="btn btn-default form-control">Modifica <i class="glyphicon glyphicon-edit"></i></a>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<a href="@Url.Action("Index", "Items", new { id=Model.ID })" class="btn btn-info form-control">Torna ad elenco <i class="glyphicon glyphicon-retweet"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
Binary file not shown.
Reference in New Issue
Block a user