internal static MessageStateCode ToMessageStateCode(this LahetaViestiResponseStateCode code)
        {
            var exists = Enum.IsDefined(typeof(MessageStateCode), (MessageStateCode)code);

            if (!exists)
            {
                throw new ClientFaultException(new Exception("Unknown LahetaViestiResponseStateCode"));
            }
            return((MessageStateCode)code);
        }
Пример #2
0
        internal static bool HandleResponseStateCode(LahetaViestiResponseStateCode code)
        {
            switch (code)
            {
            case LahetaViestiResponseStateCode.SuccessButInProcess: return(true);

            case LahetaViestiResponseStateCode.FalseDataError: throw new FalseDataException();

            case LahetaViestiResponseStateCode.WrongAuthError: throw new AuthorizationException();

            case LahetaViestiResponseStateCode.NotMatchingIdsError: throw new NotMatchingIdsException();

            case LahetaViestiResponseStateCode.NotAllowedError: throw new ActionNotAllowedException();

            case LahetaViestiResponseStateCode.FalseSignatureError: throw new FalseSignatureException();

            case LahetaViestiResponseStateCode.OtherError: throw new OtherException();

            case LahetaViestiResponseStateCode.ConnectionError: throw new ConnectionException();
            }
            return(true);
        }