public void SetFilter(HttpSessionStateBase session, ForumFilterBm bm) { session[CRRConfig.CurrentForumPage] = 0; if (string.IsNullOrWhiteSpace(bm.Title) && string.IsNullOrWhiteSpace(bm.Content) && string.IsNullOrWhiteSpace(bm.Tags) && string.IsNullOrWhiteSpace(bm.Category)) { session[CRRConfig.ForumFilter] = null; } session[CRRConfig.ForumFilter] = bm; }
public ActionResult FilterByTag(string filter) { if (string.IsNullOrWhiteSpace(filter)) { this.Response.StatusCode = 404; return this.View("_Custom404FileNotFound"); } ForumFilterBm bm = new ForumFilterBm(); bm.Tags = filter; this.forumManager.SetFilter(this.HttpContext.Session, bm); return this.RedirectToAction("Index"); }
public ActionResult FilterByCategory(int filter) { ForumFilterBm bm = new ForumFilterBm(); bm.Category = this.forumManager.GetCategorySystemNameById(filter); if (string.IsNullOrWhiteSpace(bm.Category)) { this.Response.StatusCode = 404; return this.View("_Custom404FileNotFound"); } if (bm.Category == "clear") { bm.Category = null; } this.forumManager.SetFilter(this.HttpContext.Session, bm); return this.RedirectToAction("Index"); }
public ActionResult FilterPosts([Bind(Prefix = "FilterVm")]ForumFilterBm bm) { this.forumManager.SetFilter(this.HttpContext.Session, bm); return this.RedirectToAction("Posts"); }