Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
 public ActionResult FilterPosts([Bind(Prefix = "FilterVm")]ForumFilterBm bm)
 {
     this.forumManager.SetFilter(this.HttpContext.Session, bm);
     
     return this.RedirectToAction("Posts");
 }