Exemplo n.º 1
0
        /// <summary>
        /// 查询顺丰下单返回明细
        /// </summary>
        public Response <QueryAMSUploadResponses> GetWMS_SFDetailByCondition(QueryAMSUploadRequests request)
        {
            Response <QueryAMSUploadResponses> response = new Response <QueryAMSUploadResponses>()
            {
                Result = new QueryAMSUploadResponses()
            };

            if (request == null || request.WMS_PackageSearch == null)
            {
                ArgumentNullException ex = new ArgumentNullException("GetWMS_SFDetailByCondition request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                int RowCount;
                response.Result.WMS_SFDetaileCollection = accessor.GetWMS_SFDetailByCondition(request.WMS_SFDetailSearch, 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;
                response.IsSuccess        = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
Exemplo n.º 2
0
        public Response <GenBoxNumberResponse> AddGenBoxNumber(GenBoxNumberRequest request)
        {
            Response <GenBoxNumberResponse> response = new Response <GenBoxNumberResponse> {
                Result = new GenBoxNumberResponse()
            };

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("AddPackingLists request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                response.Result.AMSUploadCollection = accessor.AddAMSController(request.Check.Substring(0, request.Check.Length - 1));
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }
            return(response);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 订单号的查询
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <GenBoxNumberResponse> QueryGenBoxNumber(GenBoxNumberRequest request)
        {
            Response <GenBoxNumberResponse> response = new Response <GenBoxNumberResponse> {
                Result = new GenBoxNumberResponse()
            };

            if (request == null || request.SearchCondition == null)
            {
                ArgumentNullException ex = new ArgumentNullException("QueryAMSUpload request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                response.Result.AMSUploadCollection = accessor.GetBoxNumberAttachments(request.SearchCondition, request.Customers);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }
            return(response);
        }
Exemplo n.º 4
0
        public Response <QueryAMSUploadResponses> QueryAMSUpload(QueryAMSUploadRequests request)
        {
            Response <QueryAMSUploadResponses> response = new Response <QueryAMSUploadResponses>()
            {
                Result = new QueryAMSUploadResponses()
            };

            if (request == null || request.SearchCondition == null)
            {
                ArgumentNullException ex = new ArgumentNullException("QueryAMSUpload request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                int RowCount;
                response.Result.AMSUploadCollection = accessor.GetQueryAttachments(request.SearchCondition, request.Customers, 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;
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 新增回单
        /// </summary>
        public Response <IEnumerable <AMSUpload> > AddAMSUpload(AddAMSUploadRequest request)
        {
            Response <IEnumerable <AMSUpload> > response = new Response <IEnumerable <AMSUpload> >();

            if (request == null || request.amsUpload == null || !request.amsUpload.Any())
            {
                ArgumentNullException ex = new ArgumentNullException("AddAMSUpload request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                response.Result    = accessor.AddAttachments(request.amsUpload);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 新增顺丰下单返回明细
        /// </summary>
        public IEnumerable <WMS_SFDetail> AddWMS_SFDetail(IEnumerable <WMS_SFDetail> sfDetailList)
        {
            if (sfDetailList == null || !sfDetailList.Any())
            {
                ArgumentNullException ex = new ArgumentNullException("AddWMS_SFDetail request");
                LogError(ex);
                return(null);
            }
            AMSUploadAccessor accessor = new AMSUploadAccessor();

            try
            {
                return(accessor.AddWMS_SFDetail(sfDetailList));
            }
            catch (Exception ex)
            {
                LogError(ex);
            }

            return(null);
        }
Exemplo n.º 7
0
        public Response <AMSUpload> GetAttachmentByID(GetAMSUPLOADByIDRequest request)
        {
            Response <AMSUpload> response = new Response <AMSUpload>();

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("GetAttachmentByID request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                AMSUploadAccessor accessor = new AMSUploadAccessor();
                response.Result = accessor.GetAmsUploadByID(request.ID);
                if (response.Result.ID == 0)
                {
                    response.IsSuccess = false;
                    response.ErrorCode = ErrorCode.Argument;
                }
                else
                {
                    response.IsSuccess = true;
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }