コード例 #1
0
ファイル: CRMService.cs プロジェクト: ChainSong/WMS
        public Response <CRMInfo> GetCRMInfoByID(GetCRMInfoRequest request)
        {
            Response <CRMInfo> response = new Response <CRMInfo>();

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

            try
            {
                CRMInfoAccessor CRMAccessor = new CRMInfoAccessor();
                response.Result    = CRMAccessor.GetCRMInfoByID(request.ID);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.IsSuccess = false;
                response.Exception = ex;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
コード例 #2
0
ファイル: CRMService.cs プロジェクト: ChainSong/WMS
        /// <summary>
        /// 获取crm信息
        /// </summary>
        /// <param name="Sqlwhere"></param>
        /// <returns></returns>
        public Response <GetCRMInfoRequest> GetCRMInfo(GetCRMInfoRequest request)
        {
            Response <GetCRMInfoRequest> response = new Response <GetCRMInfoRequest>()
            {
                Result = new GetCRMInfoRequest()
            };

            if (request == null)
            {
                ArgumentNullException ex = new ArgumentNullException("GetCRMInfoByID request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }
            try
            {
                CRMInfoAccessor CRMAccessor = new CRMInfoAccessor();
                int             Rowcount;
                response.Result.IEnumerableCRMInfo = CRMAccessor.GetCRMInfo(request.CRMInfo, 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.Exception = ex;
                response.ErrorCode = ErrorCode.Technical;
            }
            return(response);
        }