diff --git a/StockManMVC/Controllers/ItemStockStatusController.cs b/StockManMVC/Controllers/ItemStockStatusController.cs index c229aef..34184a3 100644 --- a/StockManMVC/Controllers/ItemStockStatusController.cs +++ b/StockManMVC/Controllers/ItemStockStatusController.cs @@ -14,10 +14,31 @@ namespace StockManMVC.Controllers { private StockManEntities db = new StockManEntities(); + //// GET: ItemStockStatus + //public ActionResult Index() + //{ + // return View(db.ItemStockStatus.ToList()); + //} + // GET: ItemStockStatus - public ActionResult Index() + public ActionResult Index(string SearchVal) { - return View(db.ItemStockStatus.ToList()); + var StockStatus = from s in db.ItemStockStatus + select s; + if (!String.IsNullOrEmpty(SearchVal)) + { + StockStatus = StockStatus.Where(s => s.LocationID.Contains(SearchVal) + || s.LocationDesc.Contains(SearchVal) + || s.ItemFamilyID.Contains(SearchVal) + || s.Descr.Contains(SearchVal) + || s.DescrExt.Contains(SearchVal) + || s.CodInt.Contains(SearchVal) + || s.CodExt.Contains(SearchVal) + ); + } + + return View(StockStatus.ToList()); + //return View(db.ItemStockStatus.ToList()); } // GET: ItemStockStatus/Consolidate/5 diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index f0a7fc3..2b0b931 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -328,6 +328,7 @@ + diff --git a/StockManMVC/Views/ItemStockStatus/Index.cshtml b/StockManMVC/Views/ItemStockStatus/Index.cshtml index 5d56d37..2351a87 100644 --- a/StockManMVC/Views/ItemStockStatus/Index.cshtml +++ b/StockManMVC/Views/ItemStockStatus/Index.cshtml @@ -1,10 +1,12 @@ @model IEnumerable @{ - ViewBag.Title = "Index"; + ViewBag.Title = "Stato Stock"; } -

Index

+

Stato Stock

+ +@Html.Partial("_searchBox")

@Html.ActionLink("Create New", "Create") diff --git a/StockManMVC/Views/Shared/_searchBox.cshtml b/StockManMVC/Views/Shared/_searchBox.cshtml new file mode 100644 index 0000000..ced8b53 --- /dev/null +++ b/StockManMVC/Views/Shared/_searchBox.cshtml @@ -0,0 +1,7 @@ +@using (Html.BeginForm()) +{ +

+ Ricerca: @Html.TextBox("SearchVal") + +

+} diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index dffa11e..d35e704 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ