From d74a70b06b70cd11ecac416a685cd385682ee963 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 29 Sep 2016 09:54:36 +0200 Subject: [PATCH] =?UTF-8?q?ajax=20x=20partial=20view=20selezione=20tendine?= =?UTF-8?q?=20=C3=A8=20OK!=20fix=20emtadata=20intestazioni=20e=20tipo=20va?= =?UTF-8?q?lori...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/config/applicationhost.config | 2 +- .../Controllers/MagStatusController.cs | 17 ++++++++ StockManMVC/Models/Metadata.cs | 2 +- .../{Controllers => Models}/PartialClasses.cs | 5 +++ StockManMVC/StockManMVC.csproj | 2 +- StockManMVC/Views/MagStatus/Index.cshtml | 38 +++++++++++++----- StockManMVC/Views/Shared/_Layout.cshtml | 9 +++-- StockManMVC/Web.config | 4 +- StockManMVC/bin/StockManMVC.dll | Bin 122880 -> 120832 bytes StockManMVC/bin/StockManMVC.dll.config | 4 +- VersGen/bin/Release/VersGen.dll | Bin 4096 -> 4096 bytes VersGen/obj/Release/VersGen.dll | Bin 4096 -> 4096 bytes 12 files changed, 63 insertions(+), 20 deletions(-) rename StockManMVC/{Controllers => Models}/PartialClasses.cs (88%) diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config index 4bb94c2..0700253 100644 --- a/.vs/config/applicationhost.config +++ b/.vs/config/applicationhost.config @@ -162,7 +162,7 @@ - + diff --git a/StockManMVC/Controllers/MagStatusController.cs b/StockManMVC/Controllers/MagStatusController.cs index a7c4495..93bb606 100644 --- a/StockManMVC/Controllers/MagStatusController.cs +++ b/StockManMVC/Controllers/MagStatusController.cs @@ -7,6 +7,7 @@ using System.Net; using System.Web; using System.Web.Mvc; using StockManMVC.Models; +using System.Threading.Tasks; namespace StockManMVC.Controllers { @@ -46,6 +47,22 @@ namespace StockManMVC.Controllers return PartialView("_StockByLocation", CurrStock.ToList()); } + // GET: MagStatus + [HttpGet] + public async Task StockByLocationAjax(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, int QtyConf) { diff --git a/StockManMVC/Models/Metadata.cs b/StockManMVC/Models/Metadata.cs index baa2423..224c247 100644 --- a/StockManMVC/Models/Metadata.cs +++ b/StockManMVC/Models/Metadata.cs @@ -103,7 +103,7 @@ namespace StockManMVC.Models //public String Desc; [Display(Name = "Valore Articoli")] - [DataType(DataType.Currency)] + [DisplayFormat(DataFormatString = "{0:C2}", ApplyFormatInEditMode = true)] public String TotVal; [Display(Name = "Tot num Articoli")] diff --git a/StockManMVC/Controllers/PartialClasses.cs b/StockManMVC/Models/PartialClasses.cs similarity index 88% rename from StockManMVC/Controllers/PartialClasses.cs rename to StockManMVC/Models/PartialClasses.cs index aae89fc..d1831ec 100644 --- a/StockManMVC/Controllers/PartialClasses.cs +++ b/StockManMVC/Models/PartialClasses.cs @@ -25,6 +25,11 @@ namespace StockManMVC.Models { } + [MetadataType(typeof(vLocationValMetadata))] + public partial class vLocationVal + { + } + //[MetadataType(typeof(ItemsMetadata))] //public partial class Items //{ diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index d359e20..220e91d 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -183,7 +183,7 @@ - + diff --git a/StockManMVC/Views/MagStatus/Index.cshtml b/StockManMVC/Views/MagStatus/Index.cshtml index 9d73419..c995627 100644 --- a/StockManMVC/Views/MagStatus/Index.cshtml +++ b/StockManMVC/Views/MagStatus/Index.cshtml @@ -22,7 +22,7 @@ @Html.DisplayNameFor(model => model.TotPend) - + @Html.DisplayNameFor(model => model.TotVal) @@ -39,7 +39,7 @@ @Html.DisplayFor(modelItem => item.TotPend) - + @Html.DisplayFor(modelItem => item.TotVal) @@ -50,8 +50,8 @@
- @using (Html.BeginForm("Index", "MagStatus", FormMethod.Get)) - { + @*@using (Html.BeginForm("Index", "MagStatus", FormMethod.Get)) + {*@
@@ -64,8 +64,9 @@
@*@Html.LabelFor(model => model.ExtLocationID, "Riferimento", htmlAttributes: new { @class = "control-label col-md-2" })*@
- @Html.DropDownList("LocationID_SX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control", @onchange = "this.form.submit();" }) + @Html.DropDownList("LocationID_SX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control" }) @*@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })*@ + @*, @onchange = "this.form.submit();"*@
@@ -75,7 +76,7 @@
-
+
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelSX, LocationIDTo = @ViewBag.SelDX, ShowMove = true })
@@ -92,18 +93,37 @@
@*@Html.LabelFor(model => model.ExtLocationID, "Riferimento", htmlAttributes: new { @class = "control-label col-md-2" })*@
- @Html.DropDownList("LocationID_DX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control", @onchange = "this.form.submit();" }) + @Html.DropDownList("LocationID_DX", null, "-- Selezionare --", htmlAttributes: new { @class = "form-control" }) @*@Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" })*@ + @*, @onchange = "this.form.submit();"*@
-
+
@Html.Action("StockByLocation", new { LocationID = @ViewBag.SelDX, LocationIDTo = @ViewBag.SelSX })
- } + @*}*@ + + diff --git a/StockManMVC/Views/Shared/_Layout.cshtml b/StockManMVC/Views/Shared/_Layout.cshtml index 25616ea..31723ad 100644 --- a/StockManMVC/Views/Shared/_Layout.cshtml +++ b/StockManMVC/Views/Shared/_Layout.cshtml @@ -7,6 +7,9 @@ @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") + @Scripts.Render("~/bundles/jquery") + @Scripts.Render("~/bundles/jqueryui") +
@RenderBody() - @*navbar navbar-inverse*@ -
+ @*navbar-fixed-bottom navbar navbar-inverse*@ +
@@ -93,8 +96,6 @@
- @Scripts.Render("~/bundles/jquery") - @Scripts.Render("~/bundles/jqueryui") @Scripts.Render("~/bundles/bootstrap")