示例#1
0
        private void BindingList()
        {
            Query qm = Query.Build(new { SortFields = "IsTop Desc,IsHot Desc,SubmitTime Desc" });

            string Title = PubCom.CheckString(txtTitle.Text.Trim());

            if (Title != "")
            {
                qm.Add("Title", Title);
            }
            string Author = PubCom.CheckString(txtAuthor.Text.Trim());

            if (Author != "")
            {
                qm.Add("Uploader", Author);
            }
            string Subtime = PubCom.CheckString(StarTime.Text.Trim());


            if (Subtime != "")
            {
                qm.Add("Subtime", DateTime.Parse(Subtime));
            }

            if (dpIsTop.SelectedValue != "")
            {
                qm.Add("IsTop", dpIsTop.SelectedValue == "1");
            }

            if (dpIsHot.SelectedValue != "")
            {
                qm.Add("IsHot", dpIsHot.SelectedValue == "1");
            }

            int ret = 0;

            rplist.DataSource = bn.GetNewsList(qm, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out ret);
            rplist.DataBind();
            AspNetPager1.RecordCount = ret;

            // 插入日志  query
            SysOperateLog log = new SysOperateLog();

            log.LogID          = StringHelper.getKey();
            log.LogType        = LogType.新闻信息.ToString();
            log.OperateUser    = GetLogUserName();
            log.OperateDate    = DateTime.Now;
            log.LogOperateType = "用户查询";
            log.LogAfterObject = JsonHelper.Obj2Json <string>(qm.GetCondition(true));
            bsol.Insert(log);
        }
示例#2
0
        private void BindDetail()
        {
            //国内新闻 = 1,
            //国际新闻 = 2,
            //国际会议 = 3
            Query q = new Query();

            q.OrderBy("IsTop desc,IsHot desc");
            if (type != 0)
            {
                q.Append("NewsType='" + Enum.GetName(typeof(NewsType), type) + "'");
            }
            int rec = 0;

            rplist.DataSource = bn.GetNewsList(q, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out rec);
            rplist.DataBind();
            AspNetPager1.RecordCount = rec;
        }
示例#3
0
        private void BindList()
        {
            //国内
            Query q = new Query();

            q.OrderBy("Views desc");
            q.Append("IsInternal=1");
            rplist1.DataSource = ba.GetBriefArticlelist(q, 8);
            rplist1.DataBind();
            //国外
            Query q2 = new Query();

            q2.OrderBy("Views desc");
            q2.Append("IsInternal=0");
            rplist2.DataSource = ba.GetBriefArticlelist(q2, 8);
            rplist2.DataBind();
            //国际会议  新闻
            Query q3 = new Query();

            q3.OrderBy("IsTop desc,IsHot desc,SubmitTime desc");
            q3.Append("NewsType='" + NewsType.国际会议 + "'");
            rplist3.DataSource = bn.GetNewsList(q3).Take(8);
            rplist3.DataBind();
        }