altri fix x inserimento flussi

corretta mancata lettura dtMov...
This commit is contained in:
Samuele E. Locatelli (WEB DEV)
2016-09-27 00:02:31 +02:00
parent 4506fda305
commit 048dfe4cb4
5 changed files with 26 additions and 16 deletions
@@ -228,7 +228,7 @@ namespace StockManMVC.Controllers
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult CreatePrecompiled([Bind(Include = "ID,ItemID,LocationID,MovTypeID,ExtLocationID,Qta,TotValue,UnitVal,Note")] ItemFlux itemFlux)
public ActionResult CreatePrecompiled([Bind(Include = "ID,ItemID,LocationID,MovTypeID,ExtLocationID,dtMov,Qta,TotValue,UnitVal,Note")] ItemFlux itemFlux)
{
// aggiungo campi mancanti...
if (itemFlux.dtMov == null) itemFlux.dtMov = DateTime.Now;
@@ -236,7 +236,7 @@ namespace StockManMVC.Controllers
string currOpID = "ND"; // default
try
{
Operator currOp = (Operator)db.Operator.Where(o => o.CodExt == User.Identity.Name);
Operator currOp = (Operator)db.Operator.Where(o => o.CodExt == User.Identity.Name || o.CodExt.Contains(User.Identity.Name) || o.ID== User.Identity.Name);
currOpID = currOp.ID;
}
catch
+4 -2
View File
@@ -43,12 +43,14 @@ namespace StockManMVC.Models
public string TotValue;
[Display(Name = "Data Documento")]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[DataType(DataType.Date)]
public DateTime dtMov;
[Display(Name = "Data Exp")]
[Display(Name = "Data Conferma")]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
[DataType(DataType.Date)]
public DateTime dtExport;
public Nullable<System.DateTime> dtExport;
}
//public class ItemsMetadata
+8 -6
View File
@@ -10,7 +10,7 @@
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>ItemFlux</h4>
<hr />
@@ -52,7 +52,8 @@
<div class="form-group">
@Html.LabelFor(model => model.dtMov, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.dtMov, "DateTime", new { htmlAttributes = new { @class = "form-control date-picker", type="date" } })
@Html.TextBoxFor(model => model.dtMov, new { @Value = Model.dtMov.ToString("yyyy-MM-dd"), @class = "form-control date-picker", type = "date" })
@*@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" })
</div>
</div>
@@ -92,7 +93,8 @@
<div class="form-group">
@Html.LabelFor(model => model.dtExport, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.dtExport, new { htmlAttributes = new { @class = "form-control date-picker", type = "date" } })
@Html.TextBoxFor(model => model.dtExport, new { @Value = Convert.ToDateTime(Model.dtExport).ToString("yyyy-MM-dd"), @class = "form-control date-picker", type = "date" })
@*@Html.EditorFor(model => model.dtExport, new { htmlAttributes = new { @class = "form-control date-picker", type = "date" } })*@
@Html.ValidationMessageFor(model => model.dtExport, "", new { @class = "text-danger" })
</div>
</div>
@@ -114,9 +116,9 @@
}
<div>
@*@Html.ActionLink("Back to List", "Index")*@
@*@Html.ActionLink("Torna ad elenco", "Details", "Items")*@
@Html.ActionLink("Torna ad elenco", "Details", "Items", new { id = Model.ItemID, StockItemID = Model.ItemID, FluxItemID = Model.ItemID }, null)
@*@Html.ActionLink("Back to List", "Index")*@
@*@Html.ActionLink("Torna ad elenco", "Details", "Items")*@
@Html.ActionLink("Torna ad elenco", "Details", "Items", new { id = Model.ItemID, StockItemID = Model.ItemID, FluxItemID = Model.ItemID }, null)
</div>
@section Scripts {
+12 -6
View File
@@ -73,12 +73,18 @@
@Scripts.Render("~/bundles/jqueryui")
@Scripts.Render("~/bundles/bootstrap")
<!-- Code to wire up your DatePicker -->
@*<script type="text/javascript">
$(function () {
// This will make every element with the class "date-picker" into a DatePicker element
$('.date-picker').datepicker();
})
</script>*@
<script type="text/javascript">
//$(function () {
// // This will make every element with the class "date-picker" into a DatePicker element
// $('.date-picker').datepicker();
//})
if (!Modernizr.inputtypes.date) {
$('input[type=date]').datepicker({
// Consistent format with the HTML5 picker
dateFormat: 'yy-mm-dd'
});
}
</script>
<!-- Be sure this is after jquery reference -->
<script src="~/MVCGridHandler.axd/script.js"></script>
Binary file not shown.