예제 #1
0
        private void BindList()
        {
            //国内
            Query q = new Query();

            q.OrderBy("Views desc");
            q.Append("NewsType='" + NewsType.国内新闻 + "'");
            IList <New> alist1     = bn.GetNewsTitleList(q).Take(13).ToList();
            New         toparticle = alist1.Take(1).FirstOrDefault();

            lttitle.Text       = Utils.CutString(toparticle.Title, 50);
            ltsummary.Text     = Utils.CutString(toparticle.summary, 170);
            hfaid.Value        = Utils.ObjectToStr(toparticle.NewsID);
            rplist1.DataSource = alist1.Skip(1).ToList();
            rplist1.DataBind();

            //国外
            Query q2 = new Query();

            q2.OrderBy("Views desc");
            q2.Append("NewsType='" + NewsType.国际会议 + "'");
            IList <New> alist2      = bn.GetNewsTitleList(q2).Take(13).ToList();
            New         toparticle2 = alist2.Take(1).FirstOrDefault();

            lttitle2.Text      = Utils.CutString(toparticle2.Title, 50);
            ltsummary2.Text    = Utils.CutString(toparticle2.summary, 170);
            hfaid2.Value       = Utils.ObjectToStr(toparticle2.NewsID);
            rplist2.DataSource = alist2.Skip(1).ToList();
            rplist2.DataBind();
        }
예제 #2
0
        private void BindDetail()
        {
            //绑定新闻,先将新闻信息列表展示
            IList <New> NewsTitleList = bn.GetNewsTitleList();

            rpNewList.DataSource = NewsTitleList;
            rpNewList.DataBind();
            rppiclist.DataSource = NewsTitleList.Take(3).ToList();
            rppiclist.DataBind();
            //foreach (var pic in tlist)
            //{
            //    pic.NewsPicPath = ConfigurationManager.AppSettings["FileBasicPath"] + "/"
            //      + pic.NewsPicPath;
            //    piclist.Add(pic);
            //}
            //if (tlist.Count < 3)
            //    for (int i = 0; i < 3 - tlist.Count; i++)
            //    {
            //        piclist.Add(new New());
            //    }

            //绑定通知公告
            rpNoticeList.DataSource = bo.GetNoticesTitleList();
            rpNoticeList.DataBind();
            //绑定联盟动态
            rpLMlist.DataSource = bd.GetDynamicsTitleList(DynamicType.联盟动态);
            rpLMlist.DataBind();
            //绑定团队动态
            rpTDlist.DataSource = bd.GetDynamicsTitleList(DynamicType.团队动态);
            rpTDlist.DataBind();
        }
예제 #3
0
        //还是通过ajax来做吧
        private void BindDetail()
        {
            Query q = new Query();

            q.OrderBy("Istop desc,Sort");
            q.Append("EIdentification='" + ExpertType.普通专家 + "'");
            IList <Expert> exlist = new List <Expert>();
            int            rec    = 0;

            rplist_new.DataSource = be.GetExpertsList(q, 1, 4, out rec);
            rplist_new.DataBind();
            hfrec.Value          = rec.ToString();
            hfPicFilePathV.Value = PicFilePathV;
            if (rec <= 4)
            {
                showmore.Visible = false;
            }
            //显示四个静态数据
            Query qn = new Query();

            qn.OrderBy("SubmitTime desc");
            qn.Append("StaticType='" + StaticType.知识建构理论 + "' or StaticType='" + StaticType.关于手段 + "' or StaticType='" +
                      StaticType.关于社区 + "' or StaticType='" + StaticType.关于观点 + "'");
            IList <New> nlist = bn.GetNewsTitleList(qn);
            New         n1    = nlist.FirstOrDefault(p => p.StaticType == StaticType.知识建构理论.ToString());

            hfnew1.Value     = Utils.ObjectToStr(n1?.NewsID);
            ltjgsummary.Text = Utils.CutString(n1?.summary, 500);
            New n2 = nlist.FirstOrDefault(p => p.StaticType == StaticType.关于手段.ToString());

            hfnew2.Value = Utils.ObjectToStr(n2?.NewsID);
            New n3 = nlist.FirstOrDefault(p => p.StaticType == StaticType.关于观点.ToString());

            hfnew3.Value = Utils.ObjectToStr(n3?.NewsID);
            New n4 = nlist.FirstOrDefault(p => p.StaticType == StaticType.关于社区.ToString());

            hfnew4.Value = Utils.ObjectToStr(n4?.NewsID);
        }