using System; using System.ComponentModel; using SiberTek.Xenta.Presentation; using SiberTek.Xenta.Presentation.Presenters; using SiberTek.Xenta.Presentation.Utils; using SiberTek.Xenta.Presentation.Resources; using SiberTek.Xenta.Presentation.Views; using SiberTek.Xenta.Utils; using SiberTek.Xenta.Web.Controls; using SiberTek.Xenta.Web.Utils; using SiberTek.Xenta.Enums; namespace SiberTek.Xenta.Web.Home.Modules { public partial class PublicationInfo : ViewBase<PublicationPresenter>, IMetaContainer { #region Properties [Browsable(false)] public int PublicationID { get { return (int)ViewState["PublicationID"]; } set { ViewState["PublicationID"] = value; } } public string MetaTitle { get { return lblTitle.Text; } } public string MetaDescription { get { return Convert.ToString(ViewState["MetaDescription"]); } private set { ViewState["MetaDescription"] = value; } } public string MetaKeywords { get { return String.Empty; } } #endregion #region Methods public override void BindData() { DataContainer["PublicationID"] = PublicationID; Presenter.Load(); ViewDataContainer item = DataContainer["Publication"] as ViewDataContainer; if(item != null && ((bool)item["IsPublished"] || (int)item["AuthorID"] == UserContext.Current.UserID)) { lblTitle.Text = (string)item["Title"]; lblAuthor.Text = String.Format(StringManager.GetString("Home.PublicationInfo.lblAuthor.Text"), MembershipHelper.GetUsername((int)item["AuthorID"])); lblDate.Text = String.Format(StringManager.GetString("Home.PublicationInfo.lblDate.Text"), ((DateTime?)item["PublishedOn"]).HasValue ? UserContext.Current.DateTimeToDateString((DateTime)item["PublishedOn"]) : String.Empty); lblContent.Text = StringHelper.DecodeHtml((string)item["Text"]); MetaDescription = StringHelper.StripTags(StringHelper.DecodeHtml((string)item["Description"])); lnkPrint.NavigateUrl = UrlHelper.FormatUrl("home", "print/publication/{0}.aspx", item["PublicationID"]); lnkPrint.ToolTip = StringManager.GetString("Home.PublicationInfo.lnkPrint.ToolTip"); } else { Visible = false; } base.BindData(); } #endregion } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The MIT License