Ejemplo n.º 1
0
        public Response <bool> DeleteCRMShipperCooperation(CRMShipperOperationRequest request)
        {
            Response <bool> response = new Response <bool> {
                Result = false
            };

            if (request == null || !request.CRMShipperCooperationID.HasValue || request.CRMShipperCooperationID.Value == 0)
            {
                ArgumentNullException ex = new ArgumentNullException("GetCRMShipper request CRMShipperCooperationID");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                ShipperManagementAccessor accessor = new ShipperManagementAccessor();
                accessor.DeleteCRMShipperCooperation(request.CRMShipperCooperationID.Value);
                response.Result    = true;
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.Exception = ex;
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
Ejemplo n.º 2
0
        public Response <IEnumerable <CRMShipperTransportationLine> > GetCRMShipperTransportationLines(CRMShipperOperationRequest request)
        {
            Response <IEnumerable <CRMShipperTransportationLine> > response = new Response <IEnumerable <CRMShipperTransportationLine> >();

            if (request == null || !request.CRMShipperID.HasValue || request.CRMShipperID.Value == 0)
            {
                ArgumentNullException ex = new ArgumentNullException("GetCRMShipper request CRMShipperID");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                ShipperManagementAccessor accessor = new ShipperManagementAccessor();
                response.Result    = accessor.GetCRMShipperTransportationLinesByCRMShipperID(request.CRMShipperID.Value);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.Exception = ex;
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }