コード例 #1
0
        /// <summary>
        /// 获得所有供应商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <SupplierEntity> GetList(SupplierEntity 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.SupName.IsEmpty())
            {
                entity.And("SupName", ECondition.Like, "%" + entity.SupName + "%");
            }
            if (!entity.SupNum.IsEmpty())
            {
                entity.And("SupNum", ECondition.Like, "%" + entity.SupNum + "%");
            }
            if (entity.SupType > 0)
            {
                entity.And(a => a.SupType == entity.SupType);
            }
            if (!entity.Phone.IsEmpty())
            {
                entity.And("Phone", ECondition.Like, "%" + entity.Phone + "%");
            }
            int rowCount = 0;
            List <SupplierEntity> listResult = this.Supplier.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;

            return(listResult);
        }
コード例 #2
0
        /// <summary>
        /// 获得所有供应商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <SupplierEntity> GetList(SupplierEntity 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 <SupplierEntity> listResult = this.Supplier.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;
            return(listResult);
        }
コード例 #3
0
        /// <summary>
        /// 获得所有供应商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <SupplierEntity> GetList()
        {
            //List<SupplierEntity> listResult = CacheHelper.Get(CacheKey.JOOSHOW_SUPPLIER_CACHE) as List<SupplierEntity>;
            //if (!listResult.IsNullOrEmpty())
            //{
            //    return listResult;
            //}
            SupplierEntity entity = new SupplierEntity();

            entity.IncludeAll();
            entity.OrderBy(a => a.ID, EOrderBy.DESC);
            entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete);
            List <SupplierEntity> listResult = this.Supplier.GetList(entity);

            //if (!listResult.IsNullOrEmpty())
            //{
            //    CacheHelper.Insert(CacheKey.JOOSHOW_SUPPLIER_CACHE, listResult);
            //}
            return(listResult);
        }
コード例 #4
0
        /// <summary>
        /// 获得所有供应商信息
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <SupplierEntity> GetList()
        {
            string key = string.Format(CacheKey.JOOSHOW_SUPPLIER_CACHE, this.CompanyID);
            List <SupplierEntity> listResult = CacheHelper.Get(key) as List <SupplierEntity>;

            if (!listResult.IsNullOrEmpty())
            {
                return(listResult);
            }
            SupplierEntity entity = new SupplierEntity();

            entity.IncludeAll();
            entity.OrderBy(a => a.ID, EOrderBy.DESC);
            entity.Where(a => a.IsDelete == (int)EIsDelete.NotDelete)
            .And(a => a.CompanyID == this.CompanyID);
            listResult = this.Supplier.GetList(entity);
            if (!listResult.IsNullOrEmpty())
            {
                CacheHelper.Insert(key, listResult);
            }
            return(listResult);
        }