zoukankan      html  css  js  c++  java
  • 分页数据绑定例子模板

         public void BindData()
            {
                string FidTemp = Fid.Length < 1 ? ("") : (" and FirstSort='" + Fid + "'");
                string SidTemp = Sid.Length < 1 ? ("") : (" and SecSort='" + Sid + "'");
                string TidTemp = Tid.Length < 1 ? ("") : (" and [Sort]='" + Tid + "'");
                string idKeyWord =  this.GetRequest("idKeyWord").Trim();
                idKeyWord = idKeyWord.Length>0&&idKeyWord!="请输入关键字"?(" and [CompanyName] like '%"+idKeyWord+"%'"):("");
                string idProvince = HttpUtility.UrlDecode(this.GetRequest("idProvince"));
                idProvince = idProvince.Length > 0&&idProvince!="不限" ? (" and [Province] = '" + idProvince + "'") : ("");
                string idCity = this.GetRequest("idCity");
                idCity = idCity.Length > 0 &&idCity!="不限"? (" and [City] = '" + idCity + "'") : ("");
                string idArea = this.GetRequest("idArea");
                idArea = idArea.Length > 0 &&idArea!="不限"? (" and [Area] ='" + idArea + "'") : ("");
                string idCoMode = this.GetRequest("idCoMode");
                idCoMode = idCoMode.Length > 0 && idCoMode != "0" ? (" and [DealType] like '%" + (idCoMode == "1" ? ("生产型") : (idCoMode == "2" ? ("贸易型") : (idCoMode == "3" ? ("服务型") : (idCoMode == "4" ? ("政府或其他机构") : (""))))) + "%'") : ("");
                string idIsGender = this.GetRequest("idIsGender");
                idIsGender = idIsGender == "true" ? (" and [Genderid]=1") : ("");

                this.PageSize = 20;
                this.Columns = "  [domain],[C_ID],[CompanyName],[Introduce],[DealType],[MainProduct],[Province],[City],[Area],case  [Genderid] when 0 then '/img/mfree.jpg' when 1 then '/img/mvip.jpg' when 2 then '/img/mvip.jpg' end as Genderid,[Scores],[regTime],[regMoney],[PQQ],[PMSN]";
                this.TableName = "V_CompanysList";
                this.Where = string.Format(" 1=1{0}{1}{2}{3}{4}{5}{6}{7}{8}", idKeyWord, idProvince, idCity, idArea, idCoMode, idIsGender, FidTemp, SidTemp, TidTemp);
                this.Order = "Genderid desc,AddTime desc,C_ID desc";
                this.Pid = "C_ID";
                this.ResultCount = this.CurrentPage>25?(""):"500";
                this.Distinct = "distinct";

                this.Pages1.NumCount= Convert.ToInt32(this.Db.GetOne(string.Format("select count(C_ID) from V_CompanysList where {0}", Where)));
                this.Pages1.PageSize = this.PageSize;
                this.Pages1.CurrentPage = this.CurrentPage;

                this.RRpList.DataSource = this.PageData;
                this.RRpList.DataBind();
            }

  • 相关阅读:
    JavaScript怎么让字符串和JSON相互转化
    golang怎么使用redis,最基础的有效的方法
    SmartGit过期后破解方法
    Mac下安装ElasticSearch
    浏览器滚动条拉底部的方法
    git 管理
    MAC远程连接服务器,不需要输入密码的配置方式
    centos6.5下使用yum完美搭建LNMP环境(php5.6) 无脑安装
    【笔记】LAMP 环境无脑安装配置 Centos 6.3
    vs2008不能创建C#项目的解决方法
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835586.html
Copyright © 2011-2022 走看看