Exemplo n.º 1
0
        void device()
        {
            BLL.dt_item bll        = new BLL.dt_item();
            int         pageSize   = int.Parse(request["pagesize"]);
            int         pageIdx    = int.Parse(request["pageidx"]);
            int         totalCount = 0;
            var         ds         = bll.GetList(pageSize, pageIdx, " ", " i.id desc", out totalCount);
            var         data       = (from DataRow dr in ds.Tables[0].Rows select new DBRowConvertor(dr).ConvertToEntity <Model.dt_item>()).ToList();

            this.res = DTcms.Common.JsonHelper2.GetCommonObj(0, data);
        }
Exemplo n.º 2
0
        private void RptBind(string _strWhere, string _orderby)
        {
            ddlState.SelectedValue  = this.state.ToString();
            ddlOnLine.SelectedValue = this.online.ToString();
            this.page = DTRequest.GetQueryInt("page", 1);
            BLL.dt_item bll = new BLL.dt_item();
            //this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            //this.rptList.DataBind();
            ds = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("warning_list.aspx", "keywords={0}&page={1}&state={2}&online={3}", this.keywords, "__id__", this.state.ToString(), this.online.ToString());

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
        }
Exemplo n.º 3
0
        protected void databind()
        {
            var model = GetAdminInfo();

            this.page   = DTRequest.GetQueryInt("page", 1);
            tbKeys.Text = this.keywords;
            string        strwhere = " 1=1 ";
            StringBuilder strTemp  = new StringBuilder();

            this.keywords = this.keywords.Replace("'", "");
            if (model.role_type != 1)
            {
                strwhere += $" and i.user_id={model.id} ";
            }
            if (!string.IsNullOrEmpty(this.areacode))
            {
                strwhere += $" and i.area_code='{this.areacode.Replace("'","")}' ";
            }
            if (!string.IsNullOrEmpty(this.keywords))
            {
                strwhere += $" and (i.name like  '%{this.keywords}%' or i.onenetnum='{this.keywords}')";
            }
            BLL.dt_item bll      = new BLL.dt_item();
            string      _orderby = " addtime desc ";
            var         q        = bll.GetList(this.pageSize, this.page, strwhere, _orderby, out this.totalCount);

            rptList1.DataSource = q;
            rptList1.DataBind();
            if (this.totalCount > 0)
            {
                string position = q.Tables[0].Rows[0]["position"].ToString();
                point1 = position.Substring(0, position.IndexOf(","));
                point2 = position.Substring(position.IndexOf(",") + 1);
            }
            string pageUrl = Utils.CombUrlTxt("map_show.aspx", "areacode={0}&keywords={1}&page={2}",
                                              this.areacode, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 3);
        }