diff --git a/StockManMVC/Controllers/ItemFluxesController.cs b/StockManMVC/Controllers/ItemFluxesController.cs index e8f883a..e19094f 100644 --- a/StockManMVC/Controllers/ItemFluxesController.cs +++ b/StockManMVC/Controllers/ItemFluxesController.cs @@ -17,7 +17,7 @@ namespace StockManMVC.Controllers // GET: ItemFluxes public ActionResult Index() { - var itemFlux = db.ItemFlux.Include(i => i.Location).Include(i => i.MovType).Include(i => i.Item).Include(i => i.Operator); + var itemFlux = db.ItemFlux.Include(i => i.Location).Include(i => i.MovType).Include(i => i.Item).Include(i => i.Operator).Include(i => i.Location1); return View(itemFlux.ToList()); } @@ -43,6 +43,7 @@ namespace StockManMVC.Controllers ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr"); ViewBag.ItemID = new SelectList(db.Item, "ID", "Descr"); ViewBag.OperatorID = new SelectList(db.Operator, "ID", "CodExt"); + ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr"); return View(); } @@ -64,6 +65,7 @@ namespace StockManMVC.Controllers ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID); 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); } @@ -83,6 +85,7 @@ namespace StockManMVC.Controllers ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID); 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); } @@ -103,6 +106,7 @@ namespace StockManMVC.Controllers ViewBag.MovTypeID = new SelectList(db.MovType, "ID", "Descr", itemFlux.MovTypeID); 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); } diff --git a/StockManMVC/Models/ItemFlux.cs b/StockManMVC/Models/ItemFlux.cs index 0996190..1149a02 100644 --- a/StockManMVC/Models/ItemFlux.cs +++ b/StockManMVC/Models/ItemFlux.cs @@ -31,5 +31,6 @@ namespace StockManMVC.Models public virtual MovType MovType { get; set; } public virtual Item Item { get; set; } public virtual Operator Operator { get; set; } + public virtual Location Location1 { get; set; } } } diff --git a/StockManMVC/Models/Location.cs b/StockManMVC/Models/Location.cs index 399a0fd..033eb5c 100644 --- a/StockManMVC/Models/Location.cs +++ b/StockManMVC/Models/Location.cs @@ -19,6 +19,7 @@ namespace StockManMVC.Models { this.ItemFlux = new HashSet(); this.ItemStock = new HashSet(); + this.ItemFlux1 = new HashSet(); } public string ID { get; set; } @@ -30,5 +31,7 @@ namespace StockManMVC.Models [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection ItemStock { get; set; } public virtual LocType LocType { get; set; } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] + public virtual ICollection ItemFlux1 { get; set; } } } diff --git a/StockManMVC/Models/SMModel.edmx b/StockManMVC/Models/SMModel.edmx index aa99eb5..c76c6fc 100644 --- a/StockManMVC/Models/SMModel.edmx +++ b/StockManMVC/Models/SMModel.edmx @@ -161,6 +161,18 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + + + + + + + + + + + + @@ -266,6 +278,10 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + + + + @@ -311,6 +327,7 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + @@ -335,6 +352,7 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + @@ -448,6 +466,10 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + + + + @@ -554,6 +576,18 @@ warning 6002: The table/view 'StockMan.dbo.vItemStockStatus' does not have a pri + + + + + + + + + + + + diff --git a/StockManMVC/Models/SMModel.edmx.diagram b/StockManMVC/Models/SMModel.edmx.diagram index 40965a9..c7aacab 100644 --- a/StockManMVC/Models/SMModel.edmx.diagram +++ b/StockManMVC/Models/SMModel.edmx.diagram @@ -6,10 +6,10 @@ - - - - + + + + @@ -22,6 +22,7 @@ + diff --git a/StockManMVC/Views/ItemFluxes/Create.cshtml b/StockManMVC/Views/ItemFluxes/Create.cshtml index f0fc494..acfc0d5 100644 --- a/StockManMVC/Views/ItemFluxes/Create.cshtml +++ b/StockManMVC/Views/ItemFluxes/Create.cshtml @@ -40,9 +40,9 @@
- @Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.ExtLocationID, "ExtLocationID", htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.ExtLocationID, new { htmlAttributes = new { @class = "form-control" } }) + @Html.DropDownList("ExtLocationID", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })
diff --git a/StockManMVC/Views/ItemFluxes/Delete.cshtml b/StockManMVC/Views/ItemFluxes/Delete.cshtml index 0003b85..b8d18b0 100644 --- a/StockManMVC/Views/ItemFluxes/Delete.cshtml +++ b/StockManMVC/Views/ItemFluxes/Delete.cshtml @@ -11,14 +11,6 @@

ItemFlux


-
- @Html.DisplayNameFor(model => model.ExtLocationID) -
- -
- @Html.DisplayFor(model => model.ExtLocationID) -
-
@Html.DisplayNameFor(model => model.dtMov)
@@ -99,6 +91,14 @@ @Html.DisplayFor(model => model.Operator.CodExt) +
+ @Html.DisplayNameFor(model => model.Location1.Descr) +
+ +
+ @Html.DisplayFor(model => model.Location1.Descr) +
+
@using (Html.BeginForm()) { diff --git a/StockManMVC/Views/ItemFluxes/Details.cshtml b/StockManMVC/Views/ItemFluxes/Details.cshtml index 4f8c88a..585b4ee 100644 --- a/StockManMVC/Views/ItemFluxes/Details.cshtml +++ b/StockManMVC/Views/ItemFluxes/Details.cshtml @@ -10,14 +10,6 @@

ItemFlux


-
- @Html.DisplayNameFor(model => model.ExtLocationID) -
- -
- @Html.DisplayFor(model => model.ExtLocationID) -
-
@Html.DisplayNameFor(model => model.dtMov)
@@ -98,6 +90,14 @@ @Html.DisplayFor(model => model.Operator.CodExt) +
+ @Html.DisplayNameFor(model => model.Location1.Descr) +
+ +
+ @Html.DisplayFor(model => model.Location1.Descr) +
+

diff --git a/StockManMVC/Views/ItemFluxes/Edit.cshtml b/StockManMVC/Views/ItemFluxes/Edit.cshtml index 5398444..e3bfbe6 100644 --- a/StockManMVC/Views/ItemFluxes/Edit.cshtml +++ b/StockManMVC/Views/ItemFluxes/Edit.cshtml @@ -42,9 +42,9 @@

- @Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.ExtLocationID, "ExtLocationID", htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.ExtLocationID, new { htmlAttributes = new { @class = "form-control" } }) + @Html.DropDownList("ExtLocationID", null, htmlAttributes: new { @class = "form-control" }) @Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })
diff --git a/StockManMVC/Views/ItemFluxes/Index.cshtml b/StockManMVC/Views/ItemFluxes/Index.cshtml index 172beed..3548aa5 100644 --- a/StockManMVC/Views/ItemFluxes/Index.cshtml +++ b/StockManMVC/Views/ItemFluxes/Index.cshtml @@ -11,9 +11,6 @@

- @@ -44,14 +41,14 @@ + @foreach (var item in Model) { - @@ -82,6 +79,9 @@ +
- @Html.DisplayNameFor(model => model.ExtLocationID) - @Html.DisplayNameFor(model => model.dtMov) @Html.DisplayNameFor(model => model.Operator.CodExt) + @Html.DisplayNameFor(model => model.Location1.Descr) +
- @Html.DisplayFor(modelItem => item.ExtLocationID) - @Html.DisplayFor(modelItem => item.dtMov) @Html.DisplayFor(modelItem => item.Operator.CodExt) + @Html.DisplayFor(modelItem => item.Location1.Descr) + @Html.ActionLink("Edit", "Edit", new { id=item.ID }) | @Html.ActionLink("Details", "Details", new { id=item.ID }) | diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index ed860bb..dffa11e 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ