diff --git a/StockManMVC/Controllers/LocationsController.cs b/StockManMVC/Controllers/LocationsController.cs index ec0affd..dd3c9fe 100644 --- a/StockManMVC/Controllers/LocationsController.cs +++ b/StockManMVC/Controllers/LocationsController.cs @@ -22,7 +22,7 @@ namespace StockManMVC.Controllers if (SortOrd == null) SortOrd = ""; ViewBag.LocTypeID = new SelectList(db.LocType, "ID", "Descr", LocTypeID); ViewBag.LocTypeSel = LocTypeID; - ViewBag.SearchString = SearchVal; + ViewBag.SearchVal = SearchVal; var location = db.Location.Include(l => l.LocType); return View(location.ToList()); } @@ -34,6 +34,8 @@ namespace StockManMVC.Controllers if (LocTypeID == null) LocTypeID = ""; if (SearchVal == null) SearchVal = ""; if (SortOrd == null) SortOrd = ""; + ViewBag.LocTypeSel = LocTypeID; + ViewBag.SearchVal = SearchVal; ViewBag.DescrSortParm = String.IsNullOrEmpty(SortOrd) ? "Descr_desc" : ""; ViewBag.LocTypeSortParm = SortOrd == "LocType" ? "LocType_desc" : "LocType"; var CurrLocations = db.Location.Where(s => s.ID != ""); diff --git a/StockManMVC/Views/Locations/Index.cshtml b/StockManMVC/Views/Locations/Index.cshtml index 40d14bb..b92dcb6 100644 --- a/StockManMVC/Views/Locations/Index.cshtml +++ b/StockManMVC/Views/Locations/Index.cshtml @@ -11,6 +11,7 @@
| - @*@Html.DisplayNameFor(model => model.Descr)*@ - @Html.ActionLink(Html.DisplayNameFor(model => model.Descr).ToString(), "Index", new { SortOrd = ViewBag.DescrSortParm }) + @Html.ActionLink(Html.DisplayNameFor(model => model.Descr).ToString(), "Index", new { LocTypeID = ViewBag.LocTypeSel, SearchVal = ViewBag.SearchVal, SortOrd = ViewBag.DescrSortParm }) | - @*@Html.DisplayNameFor(model => model.LocType.Descr)*@ - @Html.ActionLink(Html.DisplayNameFor(model => model.LocType.Descr).ToString(), "Index", new { SortOrd = ViewBag.LocTypeSortParm }) + @Html.ActionLink(Html.DisplayNameFor(model => model.LocType.Descr).ToString(), "Index", new { LocTypeID = ViewBag.LocTypeSel, SearchVal = ViewBag.SearchVal, SortOrd = ViewBag.LocTypeSortParm }) |
|---|