diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config index e735d8a..2e2aac3 100644 --- a/.vs/config/applicationhost.config +++ b/.vs/config/applicationhost.config @@ -162,7 +162,7 @@ - + @@ -170,7 +170,7 @@ - + diff --git a/SiteSelector/bin/SiteSelector.dll b/SiteSelector/bin/SiteSelector.dll index 2d82dab..aeede37 100644 Binary files a/SiteSelector/bin/SiteSelector.dll and b/SiteSelector/bin/SiteSelector.dll differ diff --git a/StockManMVC/Controllers/ItemFluxesController.cs b/StockManMVC/Controllers/ItemFluxesController.cs index b33ca90..70096f9 100644 --- a/StockManMVC/Controllers/ItemFluxesController.cs +++ b/StockManMVC/Controllers/ItemFluxesController.cs @@ -422,7 +422,7 @@ namespace StockManMVC.Controllers } - // GET: Items/Duplicate/5 + // GET: ItemFluxes/Duplicate/5 public ActionResult Duplicate(int? id) { if (id == null) @@ -446,6 +446,90 @@ namespace StockManMVC.Controllers //return RedirectToAction("Details", "Items", new { ID = ItemID, StockItemID = ItemID }); } + // GET: ItemFluxes/Read/5 + public ActionResult Read(int? id,string mode) + { + if (id == null) + { + return new HttpStatusCodeResult(HttpStatusCode.BadRequest); + } + if (mode == null) + { + mode = "std"; + } + // recupero item + ItemFlux itemFlux = db.ItemFlux.Find(id); + if (itemFlux == null) + { + return HttpNotFound(); + } + // recupero SOLO gli scaffali ammissibili + var query = db.Location.Where(o => o.LocType.IsStock).Join(db.ItemStock.Where(s => s.ItemID == itemFlux.ItemID), + l => l.ID, + s => s.LocationID, + (l, s) => new { l.ID, l.Descr }); + // calcolo sfondo e location ammesse da vari casi tipo movimento + string CurrStyle = ""; + ViewBag.LocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.LocationID); + ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID); + switch (itemFlux.MovTypeID) + { + case "CAR": + // per partire scelgo la posizione di default ric ordini + ViewBag.LocationID = new SelectList(db.Location.Where(o => o.LocType.IsStock), "ID", "Descr", itemFlux.LocationID); + ViewBag.ExtLocationID = new SelectList(db.Location.Where(o => o.LocType.IsFor), "ID", "Descr", itemFlux.ExtLocationID); + CurrStyle = "bg-success"; + break; + case "SCAR": + if (query.Count() > 0) + { + ViewBag.LocationID = new SelectList(query, "ID", "Descr"); + } + ViewBag.ExtLocationID = new SelectList(db.Location.Where(o => o.LocType.IsCli), "ID", "Descr", itemFlux.ExtLocationID); + ViewBag.enabEditVal = false; + CurrStyle = "bg-danger"; + break; + case "MOV": + ViewBag.ExtLocationID = new SelectList(db.Location.Where(o => o.LocType.IsStock), "ID", "Descr", itemFlux.ExtLocationID); + ViewBag.enabEditVal = false; + CurrStyle = "bg-primary"; + break; + case "OFOR": + ViewBag.LocationID = new SelectList(db.Location.Where(o => o.LocType.IsStock), "ID", "Descr", itemFlux.LocationID); + ViewBag.ExtLocationID = new SelectList(db.Location.Where(o => o.LocType.IsFor), "ID", "Descr", itemFlux.ExtLocationID); + CurrStyle = "bg-info"; + break; + case "RETT": + if (query.Count() > 0) + { + ViewBag.LocationID = new SelectList(query, "ID", "Descr"); + } + ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID); + ViewBag.enabEditVal = false; + CurrStyle = "bg-warning"; + break; + case "ND": + default: + ViewBag.ExtLocationID = new SelectList(db.Location, "ID", "Descr", itemFlux.ExtLocationID); + CurrStyle = "bg-default"; + break; + } + // altri valori in viewbag + ViewBag.CurrStyle = CurrStyle; + 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); + if (mode == "std") + { + return PartialView(itemFlux); + } + else + { + return View(itemFlux); + } + + } + // GET: ItemFluxes/Edit/5 public ActionResult Edit(int? id, string mode) { diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index ebb741f..f428558 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -582,6 +582,7 @@ + Web.config diff --git a/StockManMVC/Views/ItemFluxes/Read.cshtml b/StockManMVC/Views/ItemFluxes/Read.cshtml new file mode 100644 index 0000000..3db15d3 --- /dev/null +++ b/StockManMVC/Views/ItemFluxes/Read.cshtml @@ -0,0 +1,120 @@ +@model StockManMVC.Models.ItemFlux + +@{ + ViewBag.Title = "Edit"; +} + +@using (Html.BeginForm()) +{ + @Html.AntiForgeryToken() +
+
+ Modifica Movimento +
+ +
+
+ @Html.ValidationSummary(true, "", new { @class = "text-danger" }) + @Html.HiddenFor(model => model.ID) + @*@Html.DropDownList("ItemID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" })*@ + @*@Html.DropDownList("MovTypeID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" })*@ + + @*
+ @Html.LabelFor(model => model.ItemID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("ItemID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" }) + @Html.ValidationMessageFor(model => model.ItemID, "", new { @class = "text-danger" }) +
+
*@ + +
+ @Html.LabelFor(model => model.MovTypeID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("MovTypeID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" }) + @Html.ValidationMessageFor(model => model.MovTypeID, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("ExtLocationID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" }) + @Html.ValidationMessageFor(model => model.ExtLocationID, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.CodDoc, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.CodDoc, new { htmlAttributes = new { @class = "form-control", disabled = "disabled", @readonly = "readonly" } }) + @Html.ValidationMessageFor(model => model.CodDoc, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.dtMov, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.TextBoxFor(model => model.dtMov, new { @Value = Model.dtMov.ToString("yyyy-MM-dd"), @class = "form-control date-picker", type = "date", disabled = "disabled", @readonly = "readonly" }) + @*@Html.EditorFor(model => model.dtMov, "DateTime", new { htmlAttributes = new { @class = "form-control date-picker", type="date" } })*@ + @Html.ValidationMessageFor(model => model.dtMov, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.Qta, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.Qta, new { htmlAttributes = new { @class = "form-control", disabled = "disabled", @readonly = "readonly" } }) + @Html.ValidationMessageFor(model => model.Qta, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.TotValue, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.EditorFor(model => model.TotValue, new { htmlAttributes = new { @class = "form-control", disabled = "disabled", @readonly = "readonly" } }) + @Html.ValidationMessageFor(model => model.TotValue, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.LocationID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("LocationID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" }) + @Html.ValidationMessageFor(model => model.LocationID, "", new { @class = "text-danger" }) +
+
+ +
+ @Html.LabelFor(model => model.Note, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @*@Html.TextAreaFor(model => model.Note, 3, 50, new { htmlAttributes = new { @class = "form-control", @disabled = "disabled"} })*@ + @Html.EditorFor(model => model.Note, new { htmlAttributes = new { @class = "form-control", disabled = "disabled", @readonly = "readonly" } }) + @Html.ValidationMessageFor(model => model.Note, "", new { @class = "text-danger" }) +
+
+ + @*
+ @Html.LabelFor(model => model.OperatorID, htmlAttributes: new { @class = "control-label col-md-2" }) +
+ @Html.DropDownList("OperatorID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" }) + @Html.ValidationMessageFor(model => model.OperatorID, "", new { @class = "text-danger" }) +
+
*@ + + @*
+
+ +
+ +
*@ +
+
+
+} + + +@section Scripts { + @Scripts.Render("~/bundles/jqueryval") +} diff --git a/StockManMVC/Views/ItemFluxes/_ListByItem.cshtml b/StockManMVC/Views/ItemFluxes/_ListByItem.cshtml index 311a8a5..e51eac7 100644 --- a/StockManMVC/Views/ItemFluxes/_ListByItem.cshtml +++ b/StockManMVC/Views/ItemFluxes/_ListByItem.cshtml @@ -52,6 +52,7 @@ @Html.DisplayFor(modelItem => item.Location1.Descr) + @Html.ActionLink(" ", "ConvOrder", new { ID = item.ID }, new { @class = "btn btn-xs btn-info glyphicon glyphicon-flash " + @delStyle + " " + @convStyle }) diff --git a/StockManMVC/Views/Items/Details.cshtml b/StockManMVC/Views/Items/Details.cshtml index 3ef564b..1a36bc1 100644 --- a/StockManMVC/Views/Items/Details.cshtml +++ b/StockManMVC/Views/Items/Details.cshtml @@ -134,5 +134,10 @@ $("#divBtnIF").hide(); } + function LoadItemFluxReadOnly(ID) { + $("#divCreateMov").load('@(Url.Action("Read", "ItemFluxes", null, Request.Url.Scheme))?ID=' + ID + '&mode=std'); + $("#divBtnIF").hide(); + } + \ No newline at end of file diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index c733117..81659c1 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ diff --git a/VersGen/bin/Debug/VersGen.dll b/VersGen/bin/Debug/VersGen.dll index f4aeb37..51cf4fa 100644 Binary files a/VersGen/bin/Debug/VersGen.dll and b/VersGen/bin/Debug/VersGen.dll differ diff --git a/VersGen/obj/Debug/VersGen.csproj.FileListAbsolute.txt b/VersGen/obj/Debug/VersGen.csproj.FileListAbsolute.txt index df92a22..41e4dfa 100644 --- a/VersGen/obj/Debug/VersGen.csproj.FileListAbsolute.txt +++ b/VersGen/obj/Debug/VersGen.csproj.FileListAbsolute.txt @@ -8,3 +8,8 @@ C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\StockMan\VersGen\bi C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.csprojResolveAssemblyReference.cache C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.dll C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.pdb +C:\Users\marco\Documents\VisualStudioProjects\StockMan\VersGen\bin\Debug\VersGen.dll +C:\Users\marco\Documents\VisualStudioProjects\StockMan\VersGen\bin\Debug\VersGen.pdb +C:\Users\marco\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.csprojResolveAssemblyReference.cache +C:\Users\marco\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.dll +C:\Users\marco\Documents\VisualStudioProjects\StockMan\VersGen\obj\Debug\VersGen.pdb diff --git a/VersGen/obj/Debug/VersGen.dll b/VersGen/obj/Debug/VersGen.dll index f4aeb37..51cf4fa 100644 Binary files a/VersGen/obj/Debug/VersGen.dll and b/VersGen/obj/Debug/VersGen.dll differ