コード例 #1
0
ファイル: NoticeList.cs プロジェクト: 123456-cq/xkq34_src
        private void BindData(int pageno, int sendtype)
        {
            string      str5;
            NoticeQuery entity = new NoticeQuery {
                SortBy    = "ID",
                SortOrder = SortAction.Desc
            };

            Globals.EntityCoding(entity, true);
            entity.PageIndex     = pageno;
            entity.SendType      = sendtype;
            entity.PageSize      = this.pager.PageSize;
            entity.IsDistributor = true;
            this.title           = Globals.RequestQueryStr("title");
            string str  = Globals.RequestQueryStr("starttime");
            string str2 = Globals.RequestQueryStr("endtime");
            string str3 = Globals.RequestQueryStr("username");
            string s    = Globals.RequestQueryStr("state");

            if (!string.IsNullOrEmpty(this.title))
            {
                entity.Title       = this.title;
                this.txtTitle.Text = this.title;
            }
            try
            {
                if (!string.IsNullOrEmpty(str))
                {
                    entity.StartTime            = new DateTime?(DateTime.Parse(str));
                    this.calendarStartDate.Text = entity.StartTime.Value.ToString("yyyy-MM-dd");
                }
                if (!string.IsNullOrEmpty(str2))
                {
                    entity.EndTime            = new DateTime?(DateTime.Parse(str2));
                    this.calendarEndDate.Text = entity.EndTime.Value.ToString("yyyy-MM-dd");
                }
            }
            catch
            {
            }
            if (!string.IsNullOrEmpty(str3))
            {
                entity.Author         = str3;
                this.txtUserName.Text = str3;
            }
            if (((str5 = s) != null) && ((str5 == "0") || (str5 == "1")))
            {
                entity.IsPub = new int?(Globals.ToNum(s));
                this.ddlState.SelectedValue = s;
            }
            entity.SortBy = "IsPub asc,AddTime";
            DbQueryResult noticeRequest = NoticeHelper.GetNoticeRequest(entity);

            this.rptList.DataSource = noticeRequest.Data;
            this.rptList.DataBind();
            int totalRecords = noticeRequest.TotalRecords;

            this.pager.TotalRecords = totalRecords;
            this.recordcount        = totalRecords;
            if (this.pager.TotalRecords <= this.pager.PageSize)
            {
                this.pager.Visible = false;
            }
        }
コード例 #2
0
        private void BindData(int pageno, int sendtype)
        {
            NoticeQuery noticeQuery = new NoticeQuery();

            noticeQuery.SortBy    = "ID";
            noticeQuery.SortOrder = SortAction.Desc;
            Globals.EntityCoding(noticeQuery, true);
            noticeQuery.PageIndex     = pageno;
            noticeQuery.SendType      = sendtype;
            noticeQuery.PageSize      = this.pager.PageSize;
            noticeQuery.IsDistributor = new bool?(true);
            this.title = Globals.RequestQueryStr("title");
            string text  = Globals.RequestQueryStr("starttime");
            string text2 = Globals.RequestQueryStr("endtime");
            string text3 = Globals.RequestQueryStr("username");
            string text4 = Globals.RequestQueryStr("state");

            if (!string.IsNullOrEmpty(this.title))
            {
                noticeQuery.Title  = this.title;
                this.txtTitle.Text = this.title;
            }
            try
            {
                if (!string.IsNullOrEmpty(text))
                {
                    noticeQuery.StartTime       = new System.DateTime?(System.DateTime.Parse(text));
                    this.calendarStartDate.Text = noticeQuery.StartTime.Value.ToString("yyyy-MM-dd");
                }
                if (!string.IsNullOrEmpty(text2))
                {
                    noticeQuery.EndTime       = new System.DateTime?(System.DateTime.Parse(text2));
                    this.calendarEndDate.Text = noticeQuery.EndTime.Value.ToString("yyyy-MM-dd");
                }
            }
            catch
            {
            }
            if (!string.IsNullOrEmpty(text3))
            {
                noticeQuery.Author    = text3;
                this.txtUserName.Text = text3;
            }
            string a;

            if ((a = text4) != null && (a == "0" || a == "1"))
            {
                noticeQuery.IsPub           = new int?(Globals.ToNum(text4));
                this.ddlState.SelectedValue = text4;
            }
            noticeQuery.SortBy = "IsPub asc,AddTime";
            DbQueryResult noticeRequest = NoticeHelper.GetNoticeRequest(noticeQuery);

            this.rptList.DataSource = noticeRequest.Data;
            this.rptList.DataBind();
            int totalRecords = noticeRequest.TotalRecords;

            this.pager.TotalRecords = totalRecords;
            this.recordcount        = totalRecords;
            if (this.pager.TotalRecords <= this.pager.PageSize)
            {
                this.pager.Visible = false;
            }
        }