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"; } }
private void Page_Load(object sender, System.EventArgs e) { this._forumForum = base.ForumModule.GetForumById(base.ForumModule.CurrentForumId); base.ForumModule.CurrentForumCategoryId = this._forumForum.CategoryId; this.BindTopFooter(); base.LocalizeControls(); this.BindJS(); this.BindEmoticon(); }
private void Page_Load(object sender, System.EventArgs e) { this._module = base.Module as ForumModule; this._forumForum = this._module.GetForumById(this._module.CurrentForumId); this._module.CurrentForumCategoryId = this._forumForum.CategoryId; this.BindTopFooter(); if(this._forumForum.AllowGuestPost == 1 || this.Page.User.Identity.IsAuthenticated) { this.hplNewTopic.Visible = true; this.hplReply.Visible = true; this.hplQuotePost.Visible = true; } else { this.hplNewTopic.Visible = false; this.hplReply.Visible = false; this.hplQuotePost.Visible = false; } if(!this.IsPostBack) { if(this._module.DownloadId != 0) { this.DownloadCurrentFile(); } this.BindLinks(); this.BindForumPost(); this.BindForumPostReplies(); this.LocalizeControls(); } }
private void Page_Load(object sender, System.EventArgs e) { this._forumForum = base.ForumModule.GetForumById(base.ForumModule.CurrentForumId); base.ForumModule.CurrentForumCategoryId = this._forumForum.CategoryId; if(this._forumForum.AllowGuestPost == 1 || this.Page.User.Identity.IsAuthenticated) { this.hplNewTopic.Visible = true; } else { this.hplNewTopic.Visible = false; } this.BindForumPosts(); this.BindTopFooter(); base.LocalizeControls(); this.Translate(); }
public virtual void SaveForum(ForumForum forum) { ISession session = this._sessionManager.OpenSession(); NHibernate.ITransaction tx = session.BeginTransaction(); try { session.SaveOrUpdate(forum); tx.Commit(); session.Close(); } catch (Exception ex) { tx.Rollback(); throw new Exception("Unable to save Forum ", ex); } }
private void Page_Load(object sender, System.EventArgs e) { this._origPost = base.ForumModule.GetForumPostById(base.ForumModule.CurrentForumPostId); this._forumForum = base.ForumModule.GetForumById(base.ForumModule.CurrentForumId); base.ForumModule.CurrentForumCategoryId = this._forumForum.CategoryId; this.BindTopFooter(); base.LocalizeControls(); this.ltOrigPost.Text = this._origPost.Message; this.BindJS(); this.BindEmoticon(); if(!this.IsPostBack) { if(base.ForumModule.QuotePost == 1) { this.txtMessage.Text = "[quote]" + TextParser.HtmlToForumCode(this._origPost.Message,base.ForumModule) + "[/quote]"; } } }
private void btnSave_Click(object sender, System.EventArgs e) { if (this.IsValid) { if (this._forum == null) { this._forum = new ForumForum(); } this.SaveForum(); } }
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) { IList categories = this._module.GetAllCategories(); foreach (ForumCategory category in categories) { this.lstCategories.Items.Add(new ListItem(category.Name, category.Id.ToString())); } if (this.lstCategories.Items.Count == 0) { this.LabelNoCategory.Visible = true; this.btnSave.Visible = false; } else { this.LabelNoCategory.Visible = false; this.btnSave.Visible = true; } } if (Request.QueryString["ForumId"] != null) { int forumId = Int32.Parse(Request.QueryString["ForumId"]); if (forumId > 0) { this._forum = this._module.GetForumById(forumId); if (! this.IsPostBack) { BindForum(); } this.btnDelete.Visible = true; this.btnDelete.Attributes.Add("onClick", "return confirm('Are you sure?');"); } } }