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 litName = (Literal)e.Item.FindControl("litName"); var litTeaser = (Literal)e.Item.FindControl("litTeaser"); var litDatetime = (Literal)e.Item.FindControl("litDatetime"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); litName.Text = curData["Content_Name"].ToString(); litTeaser.Text = curData["Content_Teaser"].ToString(); litDatetime.Text = ConvertUtility.ToDateTime(curData["Distribution_CreateDate"]).ToString("dd MMMM yyyy"); var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { var avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = UrlFilter.BuildImageScaleHeight(avatar, 0, 50); } 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 dtlProduct_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView curData = (DataRowView)e.Item.DataItem; HyperLink lnkName = (HyperLink)e.Item.FindControl("lnkName"); var imgAvatar = (Image)e.Item.FindControl("imgAvatar"); Label lblProductPrice = (Label)e.Item.FindControl("lblProductPrice"); var txtQuantity = (TextBox)e.Item.FindControl("txtQuantity"); Label lblPriceSum = (Label)e.Item.FindControl("lblPriceSum"); var butRowUpdate = (Button)e.Item.FindControl("butRowUpdate"); var butRowDelete = (Button)e.Item.FindControl("butRowDelete"); lnkName.Text = curData["Content_Name"].ToString(); lblProductPrice.Text = String.Format("{0:0,0}", curData["Price"]) + " VNÐ"; txtQuantity.Text = curData["Quantity"].ToString(); lblPriceSum.Text = String.Format("{0:0,0}", curData["PriceSum"]) + " VNÐ"; butRowDelete.CommandArgument = butRowUpdate.CommandArgument = ConvertUtility.ToString(curData["Content_ID"]); var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"])); if (coverInfo != null) { string avatar = coverInfo.Image_File; if (avatar.Length > 0) { imgAvatar.ImageUrl = avatar; } 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 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 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(); //} }