diff --git a/StockManMVC/App_Start/MVCGridConfig.cs b/StockManMVC/App_Start/MVCGridConfig.cs index b0bf0eb..41dbf74 100644 --- a/StockManMVC/App_Start/MVCGridConfig.cs +++ b/StockManMVC/App_Start/MVCGridConfig.cs @@ -87,7 +87,8 @@ namespace StockManMVC .WithValueExpression(i => i.QtaBatch.ToString()); cols.Add("QtaPend").WithColumnName("QtaPend") .WithHeaderText("Stock") - .WithCellCssClassExpression(p => p.QtaPend >= p.QtaMin ? "success" : "danger") + .WithCellCssClassExpression(p => p.QtaPend >= p.QtaMin ? "success text-right" : "danger text-right") + .WithSortColumnData("QtaPend") .WithValueExpression(i => i.QtaPend.ToString()); cols.Add("CurrValue").WithColumnName("CurrValue") .WithHeaderText("€/pz") diff --git a/StockManMVC/Controllers/ItemStockStatusController.cs b/StockManMVC/Controllers/ItemStockStatusController.cs index 25bfd9b..2b6c4ce 100644 --- a/StockManMVC/Controllers/ItemStockStatusController.cs +++ b/StockManMVC/Controllers/ItemStockStatusController.cs @@ -15,17 +15,11 @@ namespace StockManMVC.Controllers { private StockManEntities db = new StockManEntities(); - //// GET: ItemStockStatus - //public ActionResult Index() - //{ - // return View(db.ItemStockStatus.ToList()); - //} - // GET: ItemStockStatus public ActionResult Index(string SearchVal) { var StockStatus = from s in db.ItemStockStatus - select s; + select s; if (!String.IsNullOrEmpty(SearchVal)) { StockStatus = StockStatus.Where(s => s.LocationID.Contains(SearchVal) @@ -91,7 +85,7 @@ namespace StockManMVC.Controllers // more details see http://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost] [ValidateAntiForgeryToken] - public ActionResult Create([Bind(Include = "ID,LocationID,LocationDesc,ItemID,Descr,CodInt,ItemFamilyID,CodExt,DescrExt,QtaMin,QtaBatch,QtyConf,ValConf,QtaPend,ValPend,QtaNew,ValNew")] ItemStockStatus itemStockStatus) + public ActionResult Create([Bind(Include = "ID,LocationID,LocationDesc,ItemID,Descr,CodInt,ItemFamilyID,CodExt,DescrExt,QtaMin,QtaBatch,QtyConf,ValConf,QtyPend,ValPend,QtyNew,ValNew")] ItemStockStatus itemStockStatus) { if (ModelState.IsValid) { @@ -123,7 +117,7 @@ namespace StockManMVC.Controllers // more details see http://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost] [ValidateAntiForgeryToken] - public ActionResult Edit([Bind(Include = "ID,LocationID,LocationDesc,ItemID,Descr,CodInt,ItemFamilyID,CodExt,DescrExt,QtaMin,QtaBatch,QtyConf,ValConf,QtaPend,ValPend,QtaNew,ValNew")] ItemStockStatus itemStockStatus) + public ActionResult Edit([Bind(Include = "ID,LocationID,LocationDesc,ItemID,Descr,CodInt,ItemFamilyID,CodExt,DescrExt,QtaMin,QtaBatch,QtyConf,ValConf,QtyPend,ValPend,QtyNew,ValNew")] ItemStockStatus itemStockStatus) { if (ModelState.IsValid) { diff --git a/StockManMVC/Controllers/ItemsController.cs b/StockManMVC/Controllers/ItemsController.cs index f38d324..8a49d53 100644 --- a/StockManMVC/Controllers/ItemsController.cs +++ b/StockManMVC/Controllers/ItemsController.cs @@ -83,6 +83,36 @@ namespace StockManMVC.Controllers answ = answ.OrderBy(x => x.ItemFamilyID); } break; + case "qtapend": + if (Sort == "dsc") + { + answ = answ.OrderByDescending(x => x.QtaPend); + } + else + { + answ = answ.OrderBy(x => x.QtaPend); + } + break; + case "currvalue": + if (Sort == "dsc") + { + answ = answ.OrderByDescending(x => x.CurrValue); + } + else + { + answ = answ.OrderBy(x => x.CurrValue); + } + break; + case "totval": + if (Sort == "dsc") + { + answ = answ.OrderByDescending(x => x.CurrValue * x.QtaPend); + } + else + { + answ = answ.OrderBy(x => x.CurrValue * x.QtaPend); + } + break; case "descr": default: if (Sort == "dsc") diff --git a/StockManMVC/Models/ItemStockStatus.cs b/StockManMVC/Models/ItemStockStatus.cs index 05ad903..0ee31d5 100644 --- a/StockManMVC/Models/ItemStockStatus.cs +++ b/StockManMVC/Models/ItemStockStatus.cs @@ -27,9 +27,9 @@ namespace StockManMVC.Models public int QtaBatch { get; set; } public int QtyConf { get; set; } public decimal ValConf { get; set; } - public int QtaPend { get; set; } + public int QtyPend { get; set; } public Nullable ValPend { get; set; } - public Nullable QtaNew { get; set; } + public Nullable QtyNew { get; set; } public Nullable ValNew { get; set; } } } diff --git a/StockManMVC/Models/SMModel.edmx b/StockManMVC/Models/SMModel.edmx index ecdf1a1..8bbde5c 100644 --- a/StockManMVC/Models/SMModel.edmx +++ b/StockManMVC/Models/SMModel.edmx @@ -96,19 +96,6 @@ avviso 6002: Nessuna chiave primaria definita per la tabella/visualizzazione 'St - - - - - - - - - - - - - @@ -123,9 +110,9 @@ avviso 6002: Nessuna chiave primaria definita per la tabella/visualizzazione 'St - + - + @@ -263,9 +250,9 @@ avviso 6002: Nessuna chiave primaria definita per la tabella/visualizzazione 'St [vItemStockStatus].[QtaBatch] AS [QtaBatch], [vItemStockStatus].[QtyConf] AS [QtyConf], [vItemStockStatus].[ValConf] AS [ValConf], - [vItemStockStatus].[QtaPend] AS [QtaPend], + [vItemStockStatus].[QtyPend] AS [QtyPend], [vItemStockStatus].[ValPend] AS [ValPend], - [vItemStockStatus].[QtaNew] AS [QtaNew], + [vItemStockStatus].[QtyNew] AS [QtyNew], [vItemStockStatus].[ValNew] AS [ValNew] FROM [dbo].[vItemStockStatus] AS [vItemStockStatus] @@ -555,9 +542,9 @@ avviso 6002: Nessuna chiave primaria definita per la tabella/visualizzazione 'St - + - + @@ -688,10 +675,10 @@ avviso 6002: Nessuna chiave primaria definita per la tabella/visualizzazione 'St + + - - diff --git a/StockManMVC/Views/ItemFluxes/Edit.cshtml b/StockManMVC/Views/ItemFluxes/Edit.cshtml index e3bfbe6..5f6a789 100644 --- a/StockManMVC/Views/ItemFluxes/Edit.cshtml +++ b/StockManMVC/Views/ItemFluxes/Edit.cshtml @@ -52,7 +52,7 @@
@Html.LabelFor(model => model.dtMov, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.dtMov, new { htmlAttributes = new { @class = "form-control" } }) + @Html.EditorFor(model => model.dtMov, new { htmlAttributes = new { @class = "form-control date-picker", type="date" } }) @Html.ValidationMessageFor(model => model.dtMov, "", new { @class = "text-danger" })
@@ -92,7 +92,7 @@
@Html.LabelFor(model => model.dtExport, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.dtExport, new { htmlAttributes = new { @class = "form-control" } }) + @Html.EditorFor(model => model.dtExport, new { htmlAttributes = new { @class = "form-control date-picker", type = "date" } }) @Html.ValidationMessageFor(model => model.dtExport, "", new { @class = "text-danger" })
@@ -114,7 +114,9 @@ }
- @Html.ActionLink("Back to List", "Index") + @*@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)
@section Scripts { diff --git a/StockManMVC/Views/ItemStockStatus/Consolidate.cshtml b/StockManMVC/Views/ItemStockStatus/Consolidate.cshtml index 5d56d37..e117360 100644 --- a/StockManMVC/Views/ItemStockStatus/Consolidate.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Consolidate.cshtml @@ -48,13 +48,13 @@ @Html.DisplayNameFor(model => model.ValConf) - @Html.DisplayNameFor(model => model.QtaPend) + @Html.DisplayNameFor(model => model.QtyPend) @Html.DisplayNameFor(model => model.ValPend) - @Html.DisplayNameFor(model => model.QtaNew) + @Html.DisplayNameFor(model => model.QtyNew) @Html.DisplayNameFor(model => model.ValNew) @@ -101,13 +101,13 @@ @Html.DisplayFor(modelItem => item.ValConf) - @Html.DisplayFor(modelItem => item.QtaPend) + @Html.DisplayFor(modelItem => item.QtyPend) @Html.DisplayFor(modelItem => item.ValPend) - @Html.DisplayFor(modelItem => item.QtaNew) + @Html.DisplayFor(modelItem => item.QtyNew) @Html.DisplayFor(modelItem => item.ValNew) diff --git a/StockManMVC/Views/ItemStockStatus/Create.cshtml b/StockManMVC/Views/ItemStockStatus/Create.cshtml index 0d03c00..41424f8 100644 --- a/StockManMVC/Views/ItemStockStatus/Create.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Create.cshtml @@ -120,10 +120,10 @@
- @Html.LabelFor(model => model.QtaPend, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.QtyPend, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.QtaPend, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.QtaPend, "", new { @class = "text-danger" }) + @Html.EditorFor(model => model.QtyPend, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.QtyPend, "", new { @class = "text-danger" })
@@ -136,10 +136,10 @@
- @Html.LabelFor(model => model.QtaNew, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.QtyNew, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.QtaNew, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.QtaNew, "", new { @class = "text-danger" }) + @Html.EditorFor(model => model.QtyNew, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.QtyNew, "", new { @class = "text-danger" })
diff --git a/StockManMVC/Views/ItemStockStatus/Delete.cshtml b/StockManMVC/Views/ItemStockStatus/Delete.cshtml index cea84af..09015ef 100644 --- a/StockManMVC/Views/ItemStockStatus/Delete.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Delete.cshtml @@ -108,11 +108,11 @@
- @Html.DisplayNameFor(model => model.QtaPend) + @Html.DisplayNameFor(model => model.QtyPend)
- @Html.DisplayFor(model => model.QtaPend) + @Html.DisplayFor(model => model.QtyPend)
@@ -124,11 +124,11 @@
- @Html.DisplayNameFor(model => model.QtaNew) + @Html.DisplayNameFor(model => model.QtyNew)
- @Html.DisplayFor(model => model.QtaNew) + @Html.DisplayFor(model => model.QtyNew)
diff --git a/StockManMVC/Views/ItemStockStatus/Details.cshtml b/StockManMVC/Views/ItemStockStatus/Details.cshtml index b40d393..c8a629d 100644 --- a/StockManMVC/Views/ItemStockStatus/Details.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Details.cshtml @@ -107,11 +107,11 @@
- @Html.DisplayNameFor(model => model.QtaPend) + @Html.DisplayNameFor(model => model.QtyPend)
- @Html.DisplayFor(model => model.QtaPend) + @Html.DisplayFor(model => model.QtyPend)
@@ -123,11 +123,11 @@
- @Html.DisplayNameFor(model => model.QtaNew) + @Html.DisplayNameFor(model => model.QtyNew)
- @Html.DisplayFor(model => model.QtaNew) + @Html.DisplayFor(model => model.QtyNew)
diff --git a/StockManMVC/Views/ItemStockStatus/Edit.cshtml b/StockManMVC/Views/ItemStockStatus/Edit.cshtml index 37530cb..56fa3ce 100644 --- a/StockManMVC/Views/ItemStockStatus/Edit.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Edit.cshtml @@ -114,10 +114,10 @@
- @Html.LabelFor(model => model.QtaPend, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.QtyPend, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.QtaPend, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.QtaPend, "", new { @class = "text-danger" }) + @Html.EditorFor(model => model.QtyPend, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.QtyPend, "", new { @class = "text-danger" })
@@ -130,10 +130,10 @@
- @Html.LabelFor(model => model.QtaNew, htmlAttributes: new { @class = "control-label col-md-2" }) + @Html.LabelFor(model => model.QtyNew, htmlAttributes: new { @class = "control-label col-md-2" })
- @Html.EditorFor(model => model.QtaNew, new { htmlAttributes = new { @class = "form-control" } }) - @Html.ValidationMessageFor(model => model.QtaNew, "", new { @class = "text-danger" }) + @Html.EditorFor(model => model.QtyNew, new { htmlAttributes = new { @class = "form-control" } }) + @Html.ValidationMessageFor(model => model.QtyNew, "", new { @class = "text-danger" })
diff --git a/StockManMVC/Views/ItemStockStatus/Index.cshtml b/StockManMVC/Views/ItemStockStatus/Index.cshtml index 3dcbc93..b1dad79 100644 --- a/StockManMVC/Views/ItemStockStatus/Index.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Index.cshtml @@ -52,13 +52,13 @@ @Html.DisplayNameFor(model => model.ValConf) - @Html.DisplayNameFor(model => model.QtaPend) + @Html.DisplayNameFor(model => model.QtyPend) @Html.DisplayNameFor(model => model.ValPend) - @Html.DisplayNameFor(model => model.QtaNew) + @Html.DisplayNameFor(model => model.QtyNew) @Html.DisplayNameFor(model => model.ValNew) @@ -105,13 +105,13 @@ @Html.DisplayFor(modelItem => item.ValConf) - @Html.DisplayFor(modelItem => item.QtaPend) + @Html.DisplayFor(modelItem => item.QtyPend) @Html.DisplayFor(modelItem => item.ValPend) - @Html.DisplayFor(modelItem => item.QtaNew) + @Html.DisplayFor(modelItem => item.QtyNew) @Html.DisplayFor(modelItem => item.ValNew) diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index 3b2c3bb..31d57e6 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ