Ejemplo n.º 1
0
        /// <summary>
        /// 查询库存预警列表
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        public List <V_StorageProductEntity> GetList(V_StorageProductEntity entity, ref PageInfo pageInfo)
        {
            entity.IncludeAll();
            entity.OrderBy(item => item.ID, EOrderBy.DESC);
            entity.And(item => item.CompanyID == this.CompanyID);

            if (entity.StorageNum.IsNotEmpty())
            {
                entity.And(item => item.StorageNum == entity.StorageNum);
            }

            if (entity.BarCode.IsNotEmpty())
            {
                entity.And("BarCode", ECondition.Like, "%" + entity.BarCode + "%");
            }
            if (entity.ProductName.IsNotEmpty())
            {
                entity.And("ProductName", ECondition.Like, "%" + entity.ProductName + "%");
            }

            ProductEntity Product = new ProductEntity();

            Product.Include(item => new { MinNum = item.MinNum, MaxNum = item.MaxNum });
            entity.Left <ProductEntity>(Product, new Params <string, string>()
            {
                Item1 = "ProductNum", Item2 = "SnNum"
            });

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

            pageInfo.RowCount = rowCount;

            return(listResult);
        }
Ejemplo n.º 2
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 BarCode     = WebUtil.GetFormValue <string>("BarCode", string.Empty);
            string ProductName = WebUtil.GetFormValue <string>("ProductName", string.Empty);
            string BatchNum    = WebUtil.GetFormValue <string>("BatchNum", string.Empty);
            string SupNum      = WebUtil.GetFormValue <string>("SupNum", string.Empty);

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

            V_StorageProductEntity entity = new V_StorageProductEntity();

            entity.CompanyID   = CompanyID;
            entity.StorageNum  = StorageNum;
            entity.BarCode     = BarCode;
            entity.ProductName = ProductName;

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

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

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

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }