protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var curData = (DataRowView)e.Item.DataItem; var lnkName = (HyperLink)e.Item.FindControl("lnkName"); var litTeaser = (Literal)e.Item.FindControl("litTeaser"); //var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); lnkName.Text = curData["Content_Name"].ToString(); lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(curData["Distribution_ID"])); litTeaser.Text = curData["Content_Teaser"].ToString().Replace("\n", "<br />"); var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 120, 0); } else { imgAvatar.Visible = false; } } else { imgAvatar.Visible = false; } } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var curData = (DataRowView)e.Item.DataItem; var lnkName = (HyperLink)e.Item.FindControl("lnkName"); var litTeaser = (Literal)e.Item.FindControl("litTeaser"); var litDatetime = (Literal)e.Item.FindControl("litDatetime"); //var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var divRight = (HtmlGenericControl)e.Item.FindControl("divRight"); var lnkRegister = (HyperLink)e.Item.FindControl("lnkRegister"); lnkName.Text = curData["Content_Name"].ToString(); lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(curData["Distribution_ID"])); litTeaser.Text = curData["Content_Teaser"].ToString(); var khInfo = KhoahocDB.GetInfo(ConvertUtility.ToInt32(curData["Content_ID"])); if (khInfo != null) { litDatetime.Text = khInfo.Khoahoc_KhaiGiang; lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID( ConvertUtility.ToInt32( SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&khoahocid=" + khInfo.Khoahoc_ID; } //var newstime = ConvertUtility.ToDateTime(curData["Distribution_CreateDate"]); //litDatetime.Text = newstime.Day + " tháng " + newstime.Month + " năm" + newstime.Year; var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 120, 0); } else { imgAvatar.Visible = false; divRight.Attributes.Add("style", "width: 100%;"); } } else { imgAvatar.Visible = false; divRight.Attributes.Add("style", "width: 100%"); } } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; //HyperLink lnkZone = (HyperLink)e.Item.FindControl("lnkZone"); var litZone = (Literal)e.Item.FindControl("litZone"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var litDescription = (Literal)e.Item.FindControl("litDescription"); var rptSub2 = (Repeater)e.Item.FindControl("rptSub2"); //if (curData["Zone_ID"].ToString() == zoneCurrent.ToString()) lnkZone.CssClass = "selected"; //if (zoneCurrent == 0) //{ // if (curData["Zone_ID"].ToString() == zoneHome.ToString()) lnkZone.CssClass = "selected"; //} //if (curData["Zone_RealUrl"].ToString().Length > 0) // lnkZone.NavigateUrl = curData["Zone_RealUrl"].ToString(); //else // lnkZone.NavigateUrl = ZoneUtility.BuildUrlByZoneCurrent(ConvertUtility.ToInt32(curData["Zone_ID"])); litDescription.Text = curData["Zone_Description"].ToString(); litZone.Text = curData["Zone_Name"].ToString(); var avatar = curData["Zone_Avatar"].ToString().Trim(); if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 35, 0); } else { imgAvatar.Visible = false; } var dtSub = ZoneDB.GetByParentID(ConvertUtility.ToInt32(curData["Zone_ID"])); if (dtSub.Rows.Count == 0) { rptSub2.Visible = false; } else { rptSub2.DataSource = dtSub; rptSub2.ItemDataBound += new RepeaterItemEventHandler(rptSub2_ItemDataBound); rptSub2.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { const string boxtname = "homebottomcenter"; var zoneid = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname)); if (zoneid <= 0) { return; } var info = ZoneDB.GetInfo(zoneid); if (info == null) { return; } var avatar = info.Zone_Avatar; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 235, 0); } else { imgAvatar.Visible = false; } lnkName.Text = info.Zone_Name; var realUrl = info.Zone_RealUrl; if (realUrl.Length > 0) { lnkOther.NavigateUrl = lnkName.NavigateUrl = realUrl; } else { lnkOther.NavigateUrl = lnkName.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID); } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; var lnkName = (HyperLink)e.Item.FindControl("lnkName"); var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var litTeaser = (Literal)e.Item.FindControl("litTeaser"); var distid = ConvertUtility.ToInt32(curData["Distribution_ID"]); lnkName.Text = curData["Content_Name"].ToString(); lnkName.NavigateUrl = lnkAvatar.NavigateUrl = UrlFilter.BuildUrlByItemID(distid); litTeaser.Text = curData["Content_Teaser"].ToString(); var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(MultimediaUtility.GetOriginalImage(avatar), 224, 0); } else { imgAvatar.Visible = false; } } else { imgAvatar.Visible = false; } SessionUtility.Remove("excludeid"); SessionUtility.SetValue("excludeid", distid.ToString()); } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var curData = (DataRowView)e.Item.DataItem; var lnkName = (HyperLink)e.Item.FindControl("lnkName"); var litDescription = (Literal)e.Item.FindControl("litDescription"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); if (curData["Zone_ID"].ToString() == _zonecurrent.ToString()) { lnkName.Font.Underline = true; } litDescription.Text = curData["Zone_Description"].ToString(); var avatar = curData["Zone_Avatar"].ToString(); if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 120, 0); } else { imgAvatar.Visible = false; } lnkName.Text = curData["Zone_Name"].ToString(); if (curData["Zone_RealUrl"].ToString().Length > 0) { lnkName.NavigateUrl = curData["Zone_RealUrl"].ToString(); } else { lnkName.NavigateUrl = UrlFilter.BuildUrlByZoneID(ConvertUtility.ToInt32(curData["Zone_ID"])); } } }
protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var curData = (DataRowView)e.Item.DataItem; var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); var liAvatar = (HtmlGenericControl)e.Item.FindControl("liAvatar"); string avatar = ConvertUtility.ToString(curData["Image_File"]); if (string.IsNullOrEmpty(avatar)) { liAvatar.Visible = false; } else { imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 150, 0); lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar); lnkAvatar.Attributes.Add("rel", "prettyPhoto[pp_gal]"); //lnkAvatar.Attributes.Add("rel", "prettyPhoto"); lnkAvatar.ToolTip = curData["Image_Description"].ToString(); } } }
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(); //} }