Fix editing ItemFlux... con conversione ordini/carichi
This commit is contained in:
Binary file not shown.
@@ -368,8 +368,11 @@ namespace StockManMVC.Controllers
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public ActionResult Edit([Bind(Include = "ID,ItemID,LocationID,MovTypeID,ExtLocationID,dtMov,Qta,TotValue,UnitVal,CodDoc,Note,dtExport,OperatorID")] ItemFlux itemFlux)
|
||||
public ActionResult Edit([Bind(Include = "ID,LocationID,ExtLocationID,dtMov,Qta,TotValue,UnitVal,CodDoc,Note,dtExport")] ItemFlux itemFlux)
|
||||
//public ActionResult Edit([Bind(Include = "ID,ItemID,LocationID,MovTypeID,ExtLocationID,dtMov,Qta,TotValue,UnitVal,CodDoc,Note,dtExport,OperatorID")] ItemFlux itemFlux)
|
||||
{
|
||||
// recupero vecchi valori...
|
||||
ItemFlux itemFluxOld = db.ItemFlux.Find(itemFlux.ID);
|
||||
// fix operatore modifica
|
||||
string currOpIDMod = "ND"; // default
|
||||
try
|
||||
@@ -382,6 +385,10 @@ namespace StockManMVC.Controllers
|
||||
{
|
||||
}
|
||||
itemFlux.ModOperatorID = currOpIDMod;
|
||||
// imposto valori vecchi x campi "bloccati" (articolo, tipo movimento, operatore iniziale...)
|
||||
itemFlux.ItemID = itemFluxOld.ItemID;
|
||||
itemFlux.MovTypeID = itemFluxOld.MovTypeID;
|
||||
if (itemFlux.OperatorID == null) itemFlux.OperatorID = itemFluxOld.OperatorID;
|
||||
// continuo
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
@@ -397,7 +404,9 @@ namespace StockManMVC.Controllers
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// indico che devo salvare!
|
||||
// sblocco vecchio item x non fare conflitto
|
||||
db.Entry(itemFluxOld).State = EntityState.Detached;
|
||||
// indico che devo salvare nuovo!
|
||||
db.Entry(itemFlux).State = EntityState.Modified;
|
||||
db.SaveChanges();
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace StockManMVC.Models
|
||||
public string LocationID;
|
||||
|
||||
[Display(Name = "Operazione")]
|
||||
[Required]
|
||||
//[Required]
|
||||
public string MovTypeID;
|
||||
|
||||
[Display(Name = "Riferimento")]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
<hr />
|
||||
@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" })*@
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.ItemID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
@@ -24,14 +26,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.LocationID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("LocationID", null, htmlAttributes: new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(model => model.LocationID, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.MovTypeID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@@ -40,6 +34,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.LocationID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("LocationID", null, htmlAttributes: new { @class = "form-control" })
|
||||
@Html.ValidationMessageFor(model => model.LocationID, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.ExtLocationID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@@ -89,13 +91,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(model => model.OperatorID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("OperatorID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" })
|
||||
@Html.ValidationMessageFor(model => model.OperatorID, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>
|
||||
@*<div class="form-group">
|
||||
@Html.LabelFor(model => model.OperatorID, htmlAttributes: new { @class = "control-label col-md-2" })
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("OperatorID", null, htmlAttributes: new { @class = "form-control", disabled = "disabled", @readonly = "readonly" })
|
||||
@Html.ValidationMessageFor(model => model.OperatorID, "", new { @class = "text-danger" })
|
||||
</div>
|
||||
</div>*@
|
||||
|
||||
<div class="form-group no-color row">
|
||||
<div class="col-sm-3">
|
||||
|
||||
Binary file not shown.
+2
-2
@@ -5,7 +5,7 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.1.46.563")]
|
||||
[assembly: AssemblyFileVersion("1.1.46.563")]
|
||||
[assembly: AssemblyVersion("1.1.49.563")]
|
||||
[assembly: AssemblyFileVersion("1.1.49.563")]
|
||||
[assembly: AssemblyCopyright("Steamware © 2006-2016")]
|
||||
[assembly: AssemblyCompany("Steamware")]
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("1.1.46.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.1.46.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyVersion("1.1.49.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyFileVersion("1.1.49.<#= this.RevisionNumber #>")]
|
||||
[assembly: AssemblyCopyright("Steamware © 2006-<#= DateTime.Now.Year #>")]
|
||||
[assembly: AssemblyCompany("Steamware")]
|
||||
<#+
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user