示例#1
0
        /// <summary>
        /// 获取门店用户
        /// </summary>
        private void shopList()
        {
            int pageindex   = this.GetFormValue("page", 1);//
            int pageSize    = this.GetFormValue("pagesize", 20);
            int recordCount = 0;

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


            List <ShopUserModel> result = UserService.Instance.GetShopList(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 <ShopUserModel> GetShopList(int customerid, int pageIndex, int pageSize, out int recordCount, ShopSearchWhere where)
 {
     return(dal.GetShopList(customerid, pageIndex, pageSize, out recordCount, where));
 }
示例#3
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 <ShopUserModel> GetShopList(int customerid, int pageIndex, int pageSize, out int recordCount, ShopSearchWhere where)
        {
            string sql = @"select * from Hot_ShopUser where customerid=@customerid";

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

                if (!string.IsNullOrEmpty(where.area))
                {
                    sql += string.Format(" and area='{0}' ", where.area);
                }
                if (!string.IsNullOrEmpty(where.pro))
                {
                    sql += string.Format(" and pro='{0}' ", where.pro);
                }
                if (!string.IsNullOrEmpty(where.city))
                {
                    sql += string.Format(" and city='{0}'", where.city);
                }
            }


            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 <ShopUserModel> lst = new List <ShopUserModel>();

            using (SqlDataReader dr = DbHelperSQL.ExecuteReader(querySql, parameters))
            {
                lst = DbHelperSQL.GetEntityList <ShopUserModel>(dr);
            }
            return(lst);
        }