private void btnSave_Click(object sender, System.EventArgs e)
 {
     if (this.IsValid)
     {
         if (this._forumcategory == null)
         {
             this._forumcategory = new ForumCategory();
         }
         this._forumcategory.Name = this.txtName.Text;
         this.SaveCategory();
     }
 }
        private void ForumBreadCrumb()
        {
            if(this._module.CurrentForumId != 0)
            {
                this._forumForum	= this._module.GetForumById(this._module.CurrentForumId);
                this._forumCategory	= this._module.GetForumCategoryById(this._forumForum.CategoryId);

                this.hplForumLink.NavigateUrl	= String.Format("{0}/ForumView/{1}",UrlHelper.GetUrlFromSection(this._module.Section), this._module.CurrentForumId);
                this.hplForumLink.Text			= this._forumForum.Name;
                this.hplForumLink.Visible		= true;
                this.hplForumLink.CssClass		= "forum";

                this.lblForward_1.Visible = true;
                this.lblForward_2.Visible = true;

                this.hplCategoryLink.NavigateUrl	= String.Format("{0}/ForumCategoryList/{1}",UrlHelper.GetUrlFromSection(this._module.Section), this._module.CurrentForumCategoryId);
                this.hplCategoryLink.Text			= this._forumCategory.Name;
                this.hplCategoryLink.Visible		= true;
                this.hplCategoryLink.CssClass		= "forum";
            }

            if(this._module.CurrentForumPostId != 0)
            {
                this.hplPostlink.NavigateUrl	= String.Format("{0}/ForumViewPost/{1}/post/{2}",UrlHelper.GetUrlFromSection(this._module.Section), this._module.CurrentForumId,this._module.CurrentForumPostId);
                this.hplPostlink.Visible		= true;
                this.hplPostlink.Text			= this._module.GetForumPostById(this._module.CurrentForumPostId).Topic;
                this.hplPostlink.CssClass		= "forum";
                this.lblForward_3.Visible		= true;
            }

            HyperLink hplBreadCrumb	= (HyperLink)this.FindControl("hplForumBreadCrumb");
            if(hplBreadCrumb != null)
            {
                hplBreadCrumb.Text			= base.GetText("FORUMHOME");
                hplBreadCrumb.NavigateUrl	= UrlHelper.GetUrlFromSection(this._module.Section);
                hplBreadCrumb.ToolTip = base.GetText("FORUMHOME");
                hplBreadCrumb.CssClass		= "forum";
            }
        }
Example #3
0
 public virtual void SaveForumCategory(ForumCategory forumcategory)
 {
     ISession session = this._sessionManager.OpenSession();
     NHibernate.ITransaction tx = session.BeginTransaction();
     try
     {
         session.SaveOrUpdate(forumcategory);
         tx.Commit();
         session.Close();
     }
     catch (Exception ex)
     {
         tx.Rollback();
         throw new Exception("Unable to save Forum category", ex);
     }
 }
        private void Page_Load(object sender, System.EventArgs e)
        {
            this._module = base.Module as ForumModule;
            this.btnCancel.Attributes.Add("onClick", String.Format("document.location.href='AdminForum.aspx{0}'", base.GetBaseQueryString()));
            if (!this.IsPostBack)
            {
            }

            if (Request.QueryString["CategoryId"] != null)
            {
                int categoryId = Int32.Parse(Request.QueryString["CategoryId"]);
                if (categoryId > 0)
                {
                    this._forumcategory = this._module.GetForumCategoryById(categoryId);
                    if (!this.IsPostBack)
                    {
                        BindCategory();
                    }
                    this.btnDelete.Visible = true;
                    this.btnDelete.Attributes.Add("onClick", "return confirm('Are you sure?');");
                }
            }
        }