Esempio n. 1
0
        public ActionResult GetLocalProductList()
        {
            string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty);
            LocalProductProvider      provider   = new LocalProductProvider();
            List <LocalProductEntity> listResult = provider.GetList(BarCode);

            listResult = listResult.IsNull() ? new List <LocalProductEntity>() : listResult;
            string json = ConvertJson.ListToJson <LocalProductEntity>(listResult, "List");

            this.ReturnJson.AddProperty("Data", new JsonObject(json));
            return(Content(this.ReturnJson.ToString()));
        }
Esempio 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);
            int    LocalType  = WebUtil.GetFormValue <int>("LocalType", 0);
            string LocalNum   = WebUtil.GetFormValue <string>("LocalNum", 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);

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

            LocalProductEntity entity = new LocalProductEntity();

            entity.CompanyID   = CompanyID;
            entity.StorageNum  = StorageNum;
            entity.LocalType   = LocalType;
            entity.LocalNum    = LocalNum;
            entity.BarCode     = BarCode;
            entity.ProductName = ProductName;
            entity.BatchNum    = BatchNum;

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

            DataListResult <LocalProductEntity> dataResult = new DataListResult <LocalProductEntity>()
            {
                Code     = (int)EResponseCode.Success,
                Message  = "响应成功",
                Result   = listResult,
                PageInfo = pageInfo
            };

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