Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
        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%");
                }
            }
        }
Esempio n. 3
0
        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");

                lnkName.Text        = curData["Content_Name"].ToString();
                lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(DistributionDB.GetOriginalDistID(ConvertUtility.ToInt32(curData["Distribution_ContentID"]))));
            }
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
        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());
            }
        }
Esempio n. 6
0
        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:&nbsp;";
                }
                else
                {
                    CollectionPager1.LabelText = "Page:&nbsp;";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }