Exemplo n.º 1
0
        /// <summary>
        /// 分页查询客户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <CustomerEntity> GetCustomerList(CustomerEntity entity, ref PageInfo pageInfo)
        {
            entity.IncludeAll();
            entity.OrderBy(a => a.ID, EOrderBy.DESC);
            entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete)
            .And(a => a.CompanyID == this.CompanyID);
            if (!entity.CusNum.IsEmpty())
            {
                entity.And("CusNum", ECondition.Like, "%" + entity.CusNum + "%");
            }
            if (!entity.CusName.IsEmpty())
            {
                entity.And("CusName", ECondition.Like, "%" + entity.CusName + "%");
            }
            if (!entity.Phone.IsEmpty())
            {
                entity.And("Phone", ECondition.Like, "%" + entity.Phone + "%");
            }
            if (entity.CusType > 0)
            {
                entity.And(a => a.CusType == entity.CusType);
            }
            int rowCount = 0;
            List <CustomerEntity> listResult = this.Customer.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            return(listResult);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 分页查询客户信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <CustomerEntity> GetCustomerList(CustomerEntity entity, ref PageInfo pageInfo)
        {
            entity.IncludeAll();
            entity.OrderBy(a => a.ID, EOrderBy.DESC);
            entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
            int rowCount = 0;
            List <CustomerEntity> listResult = this.Customer.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            return(listResult);
        }