예제 #1
0
        /// <summary>
        /// 获取报名用户
        /// </summary>
        private void UserSignList()
        {
            int pageindex   = this.GetFormValue("page", 1);//
            int pageSize    = this.GetFormValue("pagesize", 20);
            int _customerid = 1002;
            int recordCount = 0;

            SignUserSearchWhere where = new SignUserSearchWhere();
            where.key  = this.GetFormValue("name", "");
            where.area = this.GetFormValue("area", "");
            where.pro  = this.GetFormValue("pro", "");
            where.city = this.GetFormValue("city", "");



            List <UserSignModel> result = UserSignUp.Instance.GetUserSignList(_customerid, pageindex, pageSize, out recordCount, where);
            int pageCount = recordCount / pageSize;

            if (recordCount % pageSize != 0)
            {
                ++pageCount;
            }
            this.Data["PageSize"]  = pageSize;
            this.Data["PageIndex"] = pageindex;
            this.Data["Total"]     = recordCount;
            this.Data["PageCount"] = pageCount;
            this.Data["Rows"]      = result;
        }
예제 #2
0
        /// <summary>
        /// 获取报名数据
        /// </summary>
        /// <param name="customerid"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="recordCount"></param>
        /// <param name="where"></param>
        /// <returns></returns>
        public List <UserSignModel> GetUserSignList(int customerid, int pageIndex, int pageSize, out int recordCount, SignUserSearchWhere where)
        {
            string sql = @"select id,customerid,name,mobile,[address],openid,nickname,headimgurl,city,Province,createtime,content1,content2,content3,content4 from  Hot_SignUpUser where customerid=@customerid ";

            if (where != null)
            {
                if (!string.IsNullOrEmpty(where.key))
                {
                    sql += string.Format(" and (name like '%{0}%' or name like '%{0}%'  or mobile like '%{0}%'   or nickname like '%{0}%')", where.key);
                }


                if (!string.IsNullOrEmpty(where.pro))
                {
                    sql += string.Format(" and Province='{0}' ", where.pro);
                }
                if (!string.IsNullOrEmpty(where.city))
                {
                    sql += string.Format(" and city='{0}' ", where.city);
                }
                if (!string.IsNullOrEmpty(where.area))
                {
                    sql += string.Format(" and address='{0}'", where.area);
                }
            }
            SqlParameter[] parameters =
            {
                new SqlParameter("@customerid", customerid)
            };
            string querySql       = DbHelperSQL.buildPageSql(pageIndex, pageSize, sql, "createtime", true);
            string recordCountSql = DbHelperSQL.buildRecordCountSql(sql);

            recordCount = Convert.ToInt32(DbHelperSQL.GetSingle(recordCountSql, parameters));

            List <UserSignModel> lst = new List <UserSignModel>();

            using (SqlDataReader dr = DbHelperSQL.ExecuteReader(querySql, parameters))
            {
                lst = DbHelperSQL.GetEntityList <UserSignModel>(dr);
            }
            return(lst);
        }
예제 #3
0
파일: UserSignUp.cs 프로젝트: Daqiv/sayhi
 /// <summary>
 /// 获取报名数据
 /// </summary>
 /// <param name="customerid"></param>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="recordCount"></param>
 /// <param name="where"></param>
 /// <returns></returns>
 public List <UserSignModel> GetUserSignList(int customerid, int pageIndex, int pageSize, out int recordCount, SignUserSearchWhere where)
 {
     return(dal.GetUserSignList(customerid, pageIndex, pageSize, out recordCount, where));
 }