コード例 #1
0
ファイル: Video_List.ascx.cs プロジェクト: coltechvn/SolArt
        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;
            }
        }
コード例 #2
0
        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();
            //}
        }
コード例 #3
0
ファイル: Pix_List.ascx.cs プロジェクト: coltechvn/SolArt
        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  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

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