コード例 #1
0
        /// <summary>
        /// 导出所有已上架信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <Shelves.GetReceiptByConditionResponse> GetReceiptExport(Shelves.GetReceiptByConditionRequest request)
        {
            Response <Shelves.GetReceiptByConditionResponse> response = new Response <Shelves.GetReceiptByConditionResponse>()
            {
                Result = new Shelves.GetReceiptByConditionResponse()
            };

            try
            {
                ShelvesManagementAccessor accessor = new ShelvesManagementAccessor();
                if (request.PageSize > 0)
                {
                    response.Result.receipt = accessor.GetReceiptExport(request.Condition);
                }
                else
                {
                    response.Result.receipt = accessor.GetReceiptExport(request.Condition);
                }
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                response.Exception = ex;
                response.IsSuccess = false;
            }

            return(response);
        }
コード例 #2
0
        /// <summary>
        /// 查询入库
        /// </summary>
        /// <returns></returns>
        public Response <Shelves.GetReceiptByConditionResponse> GetReceipt(Shelves.GetReceiptByConditionRequest request)
        {
            Response <Shelves.GetReceiptByConditionResponse> response = new Response <Shelves.GetReceiptByConditionResponse>()
            {
                Result = new Shelves.GetReceiptByConditionResponse()
            };

            try
            {
                ShelvesManagementAccessor accessor = new ShelvesManagementAccessor();
                int RowCount = 0;
                if (request.PageSize > 0)
                {
                    response.Result.receipt   = accessor.GetReceipt(request.Condition, request.PageIndex, request.PageSize, out RowCount);
                    response.Result.PageCount = RowCount % request.PageSize == 0 ? RowCount / request.PageSize : RowCount / request.PageSize + 1;
                    response.Result.PageIndex = request.PageIndex;
                }
                else
                {
                    response.Result.PageIndex = 0;
                    response.Result.PageCount = 0;
                    response.Result.receipt   = accessor.GetReceiptExecl(request.Condition);
                }
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                response.Exception = ex;
                response.IsSuccess = false;
            }

            return(response);
        }