예제 #1
0
        private void GetNewsInfo()
        {
            string newsId = Request.QueryString["NewsID"];

            if (newsId != null)
            {
                this.Title = "编辑公司动态";
                var news = bllTNNEWS.GetModelByID(newsId);
                txtTitle.Text      = news.CN_TITLE;
                myEditor.InnerHtml = news.CN_CONTENT;
            }
            else
            {
                this.Title = "新增公司动态";
            }
        }
예제 #2
0
        private void BindContent()
        {
            try
            {
                string id = Request["id"];
                if (id != null)
                {
                    TNNEWSInfo info = bll.GetModelByID(id);
                    if (info != null)
                    {
                        labTitle.Text        = info.CN_TITLE;
                        labTime.Text         = "上传日期:" + DateTime.Parse(info.CN_CREATE_DATE.ToString()).ToString("yyyy-MM-dd");
                        divContent.InnerHtml = info.CN_CONTENT;

                        if (info.ListTNNEWSVIDEO != null && info.ListTNNEWSVIDEO.Count > 0)
                        {
                            divVideo.Visible = true;
                            StringBuilder sb  = new StringBuilder();
                            StringBuilder sb1 = new StringBuilder();
                            foreach (var item in info.ListTNNEWSVIDEO)
                            {
                                sb.Append("<div style='margin:10px' id='" + item.CN_ID + "'></div>");
                                sb1.Append("CKobject.embed('../Style/ckplayer/ckplayer.swf', '" + item.CN_ID + "', 'ckplayer_" + item.CN_ID + "', '750', '450', true, { f: '" + item.CN_VIDEO_PATH + "', c: 0, b: 1, i: '' }, ['" + item.CN_VIDEO_PATH + "']);");
                            }
                            StringBuilder result = new StringBuilder();
                            result.Append(sb.ToString());
                            result.Append("<script type='text/javascript'>");
                            result.Append(sb1.ToString());
                            result.Append("</script>");

                            video.InnerHtml = result.ToString();
                        }
                        else
                        {
                            divVideo.Visible = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteErrorLog(ex);
                MessageBox.Show(this, ex.Message);
            }
        }
예제 #3
0
        protected void BindList()
        {
            int    count  = 0;
            string newsId = Request.QueryString["NewsID"];

            if (newsId == null)
            {
                return;
            }
            var news = bllTNNEWS.GetModelByID(newsId);

            lblVideoTitle.Text = news.CN_TITLE;
            var where          = ExpressionExtension.CreateExpression <TNNEWSVIDEOInfo>();
            where = where.And(t => t.CR_NEWS_ID == newsId);
            List <TNNEWSVIDEOInfo> lst = bllTNNEWSVIDEO.GetListByPage(AspNetPager.CurrentPageIndex, AspNetPager.PageSize, where, "CN_CREATE_DATE DESC", out count).ToList();

            rep.DataSource = lst;
            rep.DataBind();
            AspNetPager.RecordCount = count;
        }