protected void Page_Load(object sender, EventArgs e) { _zoneCurrent = ZoneUtility.GetZoneCurrent(); _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]); _distInfo = DistributionDB.GetInfo(_itemid); if (_distInfo == null) { Visible = false; return; } DistributionDB.UpdateView(_distInfo.Distribution_ID, 1); _contentId = _distInfo.Distribution_ContentID; var contentInfo = ContentDB.GetInfo(_contentId); lnkName.Text = contentInfo.Content_Name; lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid); lnkZone.Text = ZoneDB.GetZoneNameByID(_zoneCurrent); lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent); var strSQL = "SELECT CMS_ContentVideo.*, CMS_Videos.* FROM CMS_ContentVideo "; strSQL += " INNER JOIN CMS_Videos ON CMS_ContentVideo.Video_ID = CMS_Videos.Video_ID "; strSQL += " WHERE 1=1 "; strSQL += " AND CMS_ContentVideo.Content_ID=" + _contentId + " "; strSQL += " AND CMS_Videos.Video_Visible=1 "; strSQL += " ORDER BY CMS_ContentVideo.Priority ASC "; var source = DataHelper.GetDataFromTable(strSQL); if (source.Rows.Count > 0) { rptData.DataSource = source; rptData.DataBind(); } else { rptData.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]); var disInfo = DistributionDB.GetInfo(_itemid); if (disInfo != null) { if (disInfo.Distribution_Layout == "zone") { PlaceHolder1.Controls.Add(Page.LoadControl("Layout/" + ZoneDB.GetZoneLayout(disInfo.Distribution_ZoneID) + "_Item.ascx")); } else { PlaceHolder1.Controls.Add(Page.LoadControl("Layout/" + disInfo.Distribution_Layout + "_Item.ascx")); } } else { Response.Redirect("/"); } }
protected void Page_Load(object sender, EventArgs e) { _distInfo = DistributionDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["itemid"])); if (_distInfo == null) { Visible = false; return; } DistributionDB.UpdateView(_distInfo.Distribution_ID, 1); var contentInfo = ContentDB.GetInfo(_distInfo.Distribution_ContentID); litName.Text = contentInfo.Content_Name; if (_distInfo.Distribution_DisableTeaser) { pnTeaser.Visible = false; } else { if (contentInfo.Content_Teaser.Length > 0) { litTeaser.Text = contentInfo.Content_Teaser; } else { litTeaser.Visible = false; } if (_distInfo.Distribution_DisableAvatar) { imgAvatar.Visible = false; } else { var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(contentInfo.Content_ID)); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 150, 0); lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar); lnkAvatar.Attributes.Add("rel", "prettyPhoto"); lnkAvatar.ToolTip = coverInfo.Image_Description; } else { imgAvatar.Visible = false; } } else { imgAvatar.Visible = false; } } } litContent.Text = contentInfo.Content_Body; //litDatetime.Text = ConvertUtility.ToDateTime(distInfo.Distribution_CreateDate).ToString("dd/MM/yyyy"); //DataTable dtNews = DistributionDB.GetNewsForCurrent(distInfo.Distribution_ID, 5); //if (dtNews.Rows.Count == 0) //{ // pnNew.Visible = false; //} //else //{ // rptNew.DataSource = dtNews; // rptNew.DataBind(); //} }
protected void Page_Load(object sender, EventArgs e) { _zoneCurrent = ZoneUtility.GetZoneCurrent(); _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]); _distInfo = DistributionDB.GetInfo(_itemid); if (_distInfo == null) { Visible = false; return; } DistributionDB.UpdateView(_distInfo.Distribution_ID, 1); _contentId = _distInfo.Distribution_ContentID; var contentInfo = ContentDB.GetInfo(_contentId); lnkName.Text = contentInfo.Content_Name; lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid); lnkZone.Text = ZoneDB.GetZoneNameByID(_zoneCurrent); lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent); var strSQL = "SELECT CMS_ContentImage.*, CMS_Images.* FROM CMS_ContentImage "; strSQL += " INNER JOIN CMS_Images ON CMS_ContentImage.Image_ID = CMS_Images.Image_ID "; strSQL += " WHERE 1=1 "; strSQL += " AND CMS_ContentImage.Content_ID=" + _contentId + " "; strSQL += " AND CMS_Images.Image_Visible=1 "; strSQL += " ORDER BY CMS_ContentImage.Priority ASC "; var source = DataHelper.GetDataFromTable(strSQL); if (source.Rows.Count > 0) { CollectionPager1.DataSource = source.DefaultView; CollectionPager1.BindToControl = rptData; if (AppEnv.GetLanguageFrontEnd() == "vi-VN") { CollectionPager1.LabelText = "Trang: "; } else { CollectionPager1.LabelText = "Page: "; } CollectionPager1.BackText = "<<"; CollectionPager1.PageNumbersSeparator = " "; CollectionPager1.BackNextLinkSeparator = " "; rptData.DataSource = CollectionPager1.DataSourcePaged; rptData.DataBind(); } else { rptData.Visible = false; } }