protected void rptlstCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView curData      = (DataRowView)e.Item.DataItem;
            HyperLink   lnkTitle     = (HyperLink)e.Item.FindControl("lnkTitle");
            Label       lblCreatedOn = (Label)e.Item.FindControl("lblCreatedOn");
            Image       imgAvatar    = (Image)e.Item.FindControl("imgAvatar");

            if (lang == 1)
            {
                lnkTitle.Text = curData["Content_Headline"].ToString();
            }
            else
            {
                lnkTitle.Text = curData["Content_HeadlineKD"].ToString();
            }
            if (string.IsNullOrEmpty(ConvertUtility.ToString(curData["Content_Avatar"])))
            {
                imgAvatar.ImageUrl = "/Images/icon_app52.png";
            }
            else
            {
                imgAvatar.ImageUrl = AppEnv.GetAvatarTheThaoSo(curData["Content_Avatar"].ToString(), 60, 60);
            }
            lnkTitle.NavigateUrl = UrlProcess.GetNewsDetailUrlTheThaoSo(lang.ToString(), width, curData["Distribution_ID"].ToString());
            lblCreatedOn.Text    = ConvertUtility.ToDateTime(curData["Content_CreateDate"]).ToString("dd/MM/yyyy hh:mm");
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);

                //Detail
                //DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);
                //catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                //DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);

                DataSet   ds      = ThethaoController.GetNewsDetailHasCache(id);
                DataTable dtInfor = ds.Tables[0];
                DataTable dtList  = ds.Tables[1];

                //end detail

                if (lang == 1)
                {
                    //lnkCatName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    lblCat.Text         = "TIN ĐÃ ĐĂNG";
                    lblHeadline.Text    = dtInfor.Rows[0]["Content_Headline"].ToString();
                    ltrBody.Text        = ReplaceImageSource(dtInfor.Rows[0]["Content_Body"].ToString());
                    lnkHomeChannel.Text = "TIN TỨC";
                }
                else
                {
                    lblHeadline.Text = dtInfor.Rows[0]["Content_HeadlineKD"].ToString();
                    ltrBody.Text     = ReplaceImageSource(dtInfor.Rows[0]["Content_BodyKD"].ToString());
                    //lnkCatName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                }
                if (!string.IsNullOrEmpty(dtInfor.Rows[0]["Content_Avatar"].ToString()))
                {
                    //WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver();
                    //ws.GenerateAvatarThumnail(dtDetail.Rows[0]["Content_Avatar"].ToString(), 60, 60);
                    //imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(dtDetail.Rows[0]["Content_Avatar"].ToString(), 60, 60).Replace("~", "");
                    imgAvatar.ImageUrl = AppEnv.GetAvatarTheThaoSo(dtInfor.Rows[0]["Content_Avatar"].ToString(), 60, 60);
                }
                else
                {
                    imgAvatar.Visible = false;
                }

                lblCreatedOn.Text = ConvertUtility.ToDateTime(dtInfor.Rows[0]["Content_CreateDate"]).ToString("dd/MM/yyyy hh:mm");
                //lnkCatName.NavigateUrl = UrlProcess.GetNewsCategoryUrl(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetLastestNewsTheThaoSo(lang.ToString(), width);

                //start Older News
                rptlstCategory.DataSource     = dtList;
                rptlstCategory.ItemDataBound += rptlstCategory_ItemDataBound;
                rptlstCategory.DataBind();
                //start Older News
            }
        }
Example #3
0
        protected void rptNewLastest_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView curData      = (DataRowView)e.Item.DataItem;
            HyperLink   lnkTitlelist = (HyperLink)e.Item.FindControl("lnkTitlelist");
            Image       imglist      = (Image)e.Item.FindControl("imglist");
            Panel       pn           = (Panel)e.Item.FindControl("othernews");

            if (e.Item.ItemIndex == 0)
            {
                if (lang == 1)
                {
                    lnkTitle.Text = curData["Content_Headline"].ToString();
                    //ltrTeaser.Text = curData["Content_Teaser"].ToString();
                }
                else
                {
                    lnkTitle.Text = curData["Content_HeadlineKD"].ToString();
                    //ltrTeaser.Text = curData["Content_TeaserKD"].ToString();
                }
                //Ảnh đại diện
                if (string.IsNullOrEmpty(ConvertUtility.ToString(curData["Content_Avatar"])))
                {
                    imgAvatar.ImageUrl = "/Images/icon_app52.png";
                }
                else
                {
                    //WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver();
                    //ws.GenerateAvatarThumnail(curData["Content_Avatar"].ToString(), 51, 51);
                    //imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(curData["Content_Avatar"].ToString(), 51, 51).Replace("~", "");

                    imgAvatar.ImageUrl = AppEnv.GetAvatarTheThaoSo(curData["Content_Avatar"].ToString(), 51, 51);
                }
                lnkTitle.NavigateUrl = UrlProcess.GetNewsDetailUrlTheThaoSo(lang.ToString(), width, curData["Distribution_ID"].ToString());
                ltrTime.Text         = ConvertUtility.ToDateTime(curData["Content_CreateDate"]).ToString("dd/MM/yyyy HH:mm");
                pn.Visible           = false;
            }
            else
            {
                if (lang == 1)
                {
                    lnkTitlelist.Text = curData["Content_Headline"].ToString();
                }
                else
                {
                    lnkTitlelist.Text = curData["Content_HeadlineKD"].ToString();
                }

                lnkTitlelist.NavigateUrl = UrlProcess.GetNewsDetailUrlTheThaoSo(lang.ToString(), width, curData["Distribution_ID"].ToString());
                pn.Visible = true;
            }
        }