Esempio n. 1
0
        /// <summary>
        /// 获取玫琳凯物流跟踪信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <GetMaryKayTrackInfoRequest> GetMaryKayGetTrackInfo(GetMaryKayTrackInfoRequest request)
        {
            Response <GetMaryKayTrackInfoRequest> response = new Response <GetMaryKayTrackInfoRequest>()
            {
                Result = new GetMaryKayTrackInfoRequest()
            };

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

            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();
                int Rowcount;
                response.Result.TrackInfoTable = accessor.GetMaryKayGetTrack(request.SqlWhere, request.PageIndex, request.PageSize, out Rowcount);
                response.Result.PageIndex      = request.PageIndex;
                response.Result.PageCount      = Rowcount % request.PageSize == 0 ? Rowcount / request.PageSize : Rowcount / request.PageSize + 1;
                response.IsSuccess             = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
                response.Exception = ex;
            }

            return(response);
        }
Esempio n. 2
0
        /// <summary>
        /// 导出玫琳凯物流跟踪信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <GetMaryKayTrackInfoRequest> MaryKayExportTrackInfo(GetMaryKayTrackInfoRequest request)
        {
            Response <GetMaryKayTrackInfoRequest> response = new Response <GetMaryKayTrackInfoRequest>()
            {
                Result = new GetMaryKayTrackInfoRequest()
            };

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

            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();

                response.Result.TrackInfoTable = accessor.MaryKayExportTrack(request.SqlWhere);
                response.IsSuccess             = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
                response.Exception = ex;
            }

            return(response);
        }
Esempio n. 3
0
        /// <summary>
        /// 删除物流跟踪信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public bool DeleteOrderNo(GetMaryKayTrackInfoRequest request)
        {
            bool value;

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("DeleteOrderNo request");
                LogError(ex);
            }
            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();

                if (request.ID.IndexOf(",") > -1)
                {
                    value = accessor.DeleteTrackInfoByID(request.ID.Substring(1));  //批量删除
                }
                else
                {
                    value = accessor.DeleteTrackInfoByID(request.ID); //单个删除
                }
            }
            catch (Exception ex)
            {
                LogError(ex);
                value = false;
            }

            return(value);
        }
Esempio n. 4
0
        /// <summary>
        /// 更新物流跟踪信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <GetMaryKayTrackInfoRequest> UpdateMaryKayGetTrackInfo(GetMaryKayTrackInfoRequest request)
        {
            Response <GetMaryKayTrackInfoRequest> response = new Response <GetMaryKayTrackInfoRequest>()
            {
                Result = new GetMaryKayTrackInfoRequest()
            };

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

            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();
                int i = accessor.ExcuteSQL(request.SqlWhere, null, CommandType.Text);
                response.IsSuccess = i > 0 ? true : false;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
                response.Exception = ex;
            }

            return(response);
        }
Esempio n. 5
0
        /// <summary>
        /// 查询物流跟踪信息详情
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public Response <GetMaryKayTrackInfoRequest> GetGetMaryKayGetTrackDetail(GetMaryKayTrackInfoRequest request)
        {
            Response <GetMaryKayTrackInfoRequest> response = new Response <GetMaryKayTrackInfoRequest>()
            {
                Result = new GetMaryKayTrackInfoRequest()
            };

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

            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();

                response.Result.TrackInfoTable = accessor.GetDataSet(request.SqlWhere, null, CommandType.Text).Tables[0];
                response.IsSuccess             = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
                response.Exception = ex;
            }

            return(response);
        }
Esempio n. 6
0
        /// <summary>
        /// 同步运单号信息
        /// </summary>
        /// <param name="strSql"></param>
        public int SynchroLogisticInfo(string strSql)
        {
            int ReturnValue = 0;

            try
            {
                MaryKayBakAccessor accessor = new MaryKayBakAccessor();
                ReturnValue = accessor.ExcuteSQL(strSql, null, CommandType.Text);
            }
            catch (Exception ex)
            {
                LogError(ex);
            }
            return(ReturnValue);
        }