public ActionResult Sort(string sortOrder) { SearchCtx ctx = (SearchCtx)TempData["SearchCtx"]; if (ctx == null) { ctx = new SearchCtx(); } ctx.Sort(sortOrder); TempData["SearchCtx"] = ctx; TempData["vehicles"] = ctx.Results; return(RedirectToAction("Admin", new { page = 1 })); }
private ActionResult ShowAdmin(SearchCtx ctx, int page = 1) { if (ctx == null) { ctx = (SearchCtx)TempData["SearchCtx"]; } if (ctx == null) { ctx = new SearchCtx(); } ctx.TypesById = garage.TypesById(); if (ctx.Results.Count == 0) { ctx.Results = garage.Search(ctx).ToList(); } ctx.PagedResults = ctx.Results.ToPagedList(page, 10); TempData["vehicles"] = ctx.Results; TempData["SearchCtx"] = ctx; return(View(ctx)); }
public ActionResult Search(SearchCtx ctx) { TempData["vehicles"] = garage.Search(ctx).ToList <Vehicle>(); return(List()); }
public ActionResult Admin(SearchCtx ctx, int page = 1) { return(ShowAdmin(ctx, page)); }