Beispiel #1
0
        /// <summary>
        /// 库存容量查询
        /// </summary>
        /// <returns></returns>
        public ActionResult GetList()
        {
            string CompanyID  = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            string StorageNum = WebUtil.GetFormValue <string>("StorageNum", string.Empty);

            string LocalName = WebUtil.GetFormValue <string>("LocalName", string.Empty);
            int    LocalType = WebUtil.GetFormValue <int>("LocalType", 0);

            int PageIndex = WebUtil.GetFormValue <int>("PageIndex", 1);
            int PageSize  = WebUtil.GetFormValue <int>("PageSize", 10);

            V_LocalCapacityEntity entity = new V_LocalCapacityEntity();

            entity.CompanyID  = CompanyID;
            entity.StorageNum = StorageNum;
            entity.LocalName  = LocalName;
            entity.LocalType  = LocalType;

            PageInfo pageInfo = new PageInfo()
            {
                PageIndex = PageIndex, PageSize = PageSize
            };
            StoreCapacityProvider        provider   = new StoreCapacityProvider(CompanyID);
            List <V_LocalCapacityEntity> listResult = provider.GetList(entity, ref pageInfo);

            DataListResult <V_LocalCapacityEntity> dataResult = new DataListResult <V_LocalCapacityEntity>();

            dataResult.Code     = (int)EResponseCode.Success;
            dataResult.Message  = "响应成功";
            dataResult.Result   = listResult;
            dataResult.PageInfo = pageInfo;

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
        /// <summary>
        /// 仓库库存容量
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <V_LocalCapacityEntity> GetList(V_LocalCapacityEntity entity, ref PageInfo pageInfo)
        {
            entity.IncludeAll();
            entity.OrderBy(item => item.ID, Framework.ORM.EOrderBy.DESC);
            entity.And(item => item.CompanyID == this.CompanyID);

            if (entity.StorageNum.IsNotEmpty())
            {
                entity.And(item => item.StorageNum == entity.StorageNum);
            }
            if (entity.LocalType > 0)
            {
                entity.And(item => item.LocalType == entity.LocalType);
            }
            if (entity.LocalName.IsNotEmpty())
            {
                entity.And("LocalName", ECondition.Like, "%" + entity.LocalName + "%");
            }

            int rowCount = 0;
            List <V_LocalCapacityEntity> listResult = this.V_LocalCapacity.GetList(entity, pageInfo.PageSize, pageInfo.PageIndex, out rowCount);

            pageInfo.RowCount = rowCount;

            return(listResult);
        }