Exemple #1
0
            public override void Logging(Query message)
            {
                var systemInfoDto = _systemInfoHelper.InitializeSystemInfo();

                message.Result.SystemInfo = Mapper.Map <SystemInfo>(systemInfoDto);
                _systemInfoHelper.LoggingSystemInfo(systemInfoDto, message.LogAction);
            }
Exemple #2
0
            public override void Validate(Query message)
            {
                var argumentSystemInfo = Mapper.Map <SystemInfoDto>(message.Argument.SystemInfo);
                var resultSystemInfo   = _systemInfoHelper.InitializeSystemInfo(argumentSystemInfo);

                message.Result.SystemInfo = Mapper.Map <SystemInfo>(resultSystemInfo);

                var systemInfoError =
                    _systemInfoHelper.GetValidationSystemInfoError(argumentSystemInfo, resultSystemInfo,
                                                                   message.LogAction);

                if (!string.IsNullOrEmpty(systemInfoError))
                {
                    throw new Exception(systemInfoError);
                }
                if (string.IsNullOrEmpty(message.Argument.XIN) || message.Argument.XIN.Length != 12)
                {
                    throw new Exception("Некорректный ИИН/БИН");
                }
                if (message.Argument.DocumentType == null || message.Argument.PatentType == null ||
                    string.IsNullOrEmpty(message.Argument.XIN))
                {
                    throw new Exception("Неверные входные данные");
                }
            }
            public override void Validate(Query message)
            {
                var argumentSystemInfo = Mapper.Map <SystemInfoDto>(message.Argument.SystemInfo);
                var resultSystemInfo   = _systemInfoHelper.InitializeSystemInfo(argumentSystemInfo);

                message.Result.SystemInfo = Mapper.Map <SystemInfo>(resultSystemInfo);

                var systemInfoError =
                    _systemInfoHelper.GetValidationSystemInfoError(argumentSystemInfo, resultSystemInfo,
                                                                   message.LogAction);

                if (!string.IsNullOrEmpty(systemInfoError))
                {
                    throw new Exception(systemInfoError);
                }
            }
Exemple #4
0
            public override void Validate(Command message)
            {
                var argumentSystemInfo = Mapper.Map <SystemInfoDto>(message.Argument.SystemInfo);
                var resultSystemInfo   = _systemInfoHelper.InitializeSystemInfo(argumentSystemInfo);

                message.Result.SystemInfo = Mapper.Map <SystemInfo>(resultSystemInfo);

                var systemInfoError =
                    _systemInfoHelper.GetValidationSystemInfoError(argumentSystemInfo, resultSystemInfo,
                                                                   message.LogAction);

                if (!string.IsNullOrEmpty(systemInfoError))
                {
                    throw new Exception(systemInfoError);
                }
                var error = _validateMessageSendArgument.GetValidationErrors(message.Argument);

                if (!string.IsNullOrEmpty(error))
                {
                    throw new Exception($"Ошибка валидации: {error}");
                }
            }
            public override void Validate(Query message)
            {
                var argumentSystemInfo = Mapper.Map <SystemInfoDto>(message.Request);
                var resultSystemInfo   = _systemInfoHelper.InitializeSystemInfo(argumentSystemInfo);
                var systemInfo         = Mapper.Map <SystemInfo>(resultSystemInfo);

                message.Responce.StatusInfo = systemInfo.StatusInfo;
                message.Responce.SenderInfo = systemInfo.SenderInfo;

                var systemInfoError = _systemInfoHelper.GetValidationSystemInfoError(argumentSystemInfo, resultSystemInfo, message.LogAction);

                if (!string.IsNullOrEmpty(systemInfoError))
                {
                    throw new Exception(systemInfoError);
                }

                //var error = _validateGetPaySum.GetValidationErrors(message.Request);
                //if (!string.IsNullOrEmpty(error))
                //{
                //    throw new Exception($"Ошибка валидации: {error}");
                //}
            }