Ejemplo n.º 1
0
 public S2CRes(SerialFormat format, double execTime, ErrorCodes res, object objectToSerialize) 
     : this(format, execTime, res)
 {
     this.m_objectToSerialize = objectToSerialize;
     Data = objectToSerialize;
     ContentType = S2CContentType.Obj;
 }
 public CustomErrorActionResult(HttpRequestMessage request, string message, ErrorCodes errorCode, HttpStatusCode status)
 {
     this.Request = request;
     this.Message = message;
     this.ErrorCode = errorCode;
     this.Status = status;
 }
Ejemplo n.º 3
0
 protected TimeOutException(ErrorCodes code, string message, ConsistencyLevel consistencyLevel, int received, int blockFor)
         : base(code, message)
 {
     ConsistencyLevel = consistencyLevel;
     Received = received;
     BlockFor = blockFor;
 }
        public static void ThrowError(ErrorCodes code, params object[] args)
        {
            switch (code)
            {
                // <Native>
                case ErrorCodes.AlreadyLoaded:
                    throw new AlreadyLoadedException(code, args);
                case ErrorCodes.SteamInitializeFailed:
                    throw new SteamInitializeFailedException(code, args);
                case ErrorCodes.SteamInterfaceInitializeFailed:
                    throw new SteamInterfaceInitializeFailedException(code, args);
                // </Native>

                // <Managed>
                case ErrorCodes.InvalidInterfaceVersion:
                    throw new InvalidInterfaceVersionException(code, args);
                case ErrorCodes.UsageAfterAPIShutdown:
                    throw new UsageAfterAPIShutdownException(code, args);
                case ErrorCodes.CallbackStructSizeMissmatch:
                    throw new CallbackStructSizeMismatchException(code, args);
                // </Managed>
            }

            if (code >= ErrorCodes.StartOfNativeErrors && code <= ErrorCodes.EndOfNativeErrors)
            {
                throw new NativeException(code);
            }
            if (code >= ErrorCodes.StartOfManagedErrors && code <= ErrorCodes.EndOfManagedErrors)
            {
                throw new ManagedException(code);
            }
            throw new UnexpectedException(code);
        }
Ejemplo n.º 5
0
        protected void ReadScanData(ErrorCodes errorCode, CallbackType callbackType, object callbackData)
        {
            int availableSamples = (int)callbackData;

            double[,] scanData;

            try
            {
                scanData = Device.ReadScanData(availableSamples, 0);

                int channels = scanData.GetLength(0);
                int samples = scanData.GetLength(1);

                DataDisplay = String.Empty;

                for (int i = 0; i < Math.Min(100, samples); i++)
                {
                    for (int j = 0; j < channels; j++)
                    {
                        DataDisplay += scanData[j, i].ToString("F03") + " ";
                    }

                    DataDisplay += Environment.NewLine;
                }

                ScanDataTextBox.Text = DataDisplay;
            }
            catch (Exception ex)
            {
                Stop = true;
                statusLabel.Text = ex.Message;
            }
        }
Ejemplo n.º 6
0
        public Fail(ErrorCodes errorCode, string formatString, params object[] args)
        {
            if (formatString == null) throw new ArgumentNullException(nameof(formatString));

            ErrorCode = errorCode;
            ErrorMessage = string.Format(formatString, (object[])args);
        }
Ejemplo n.º 7
0
 internal DaqException(string errorMessage, ErrorCodes errorCode)
     : base(errorMessage)
 {
     m_errorCode = errorCode;
     m_level = ErrorLevel.Error;
     m_lastResponse = null;
 }
		/// <summary>
		/// Prints the message and the stack trace of the exception on the standard
		/// error output stream.
		/// </summary>
		/// <param name="message">The error message.</param>
		/// <param name="e">The exception.</param>
		/// <param name="errorCode">The internal error code.</param>
		public void Error(string message, Exception e, ErrorCodes errorCode) 
		{ 
			if (m_firstTime) 
			{
				m_firstTime = false;
				LogLog.Error("[" + m_prefix + "] " + message, e);
			}
		}
Ejemplo n.º 9
0
 /// <summary>
 /// Initialises a new instance of the ErrorData class.
 /// </summary>
 /// <param name="errorCode">
 /// Error code. Must be defined in <see cref="ErrorCodes"/>.
 /// </param>
 public ErrorData(ushort errorCode)
 {
     if (!Enum.IsDefined(typeof(ErrorCodes), (int)errorCode))
     {
         throw new Exception("Invalid error code.");
     }
     ErrorCode = (ErrorCodes)errorCode;
 }
 private static string SafeGetString(ErrorCodes id)
 {
     if (errorStrings.ContainsKey(id))
     {
         return errorStrings[id];
     }
     return id.ToString();
 }
Ejemplo n.º 11
0
        public ApiException(ErrorCodes code, string message, string devMessage = null, HttpStatusCode statusCode = HttpStatusCode.InternalServerError, Exception innerException = null, string correlationId = null, object details = null)
            : base(string.Format("{0}. {1}", code, message), innerException)
        {
            FaultCode = code;
            StatusCode = statusCode;
            CorrelationId = correlationId ?? Guid.NewGuid().ToString("N");
            Details = details;

            DeveloperMessage = BuildDevMsg(InnerException, devMessage);
        }
Ejemplo n.º 12
0
		internal static string GetMessage(ErrorCodes code)
		{
			switch (code)
			{
				case ErrorCodes.UserExist:
					return @"User with specified username already exist";
				case ErrorCodes.UsernameEmpty:
					return @"Empty username is not allowed";
			}

			return null;
		}
Ejemplo n.º 13
0
 internal DaqException(DaqDevice device, string errorMessage, ErrorCodes errorCode, ErrorLevel level, DaqResponse lastResponse)
     : base(errorMessage)
 {
     m_errorCode = errorCode;
     m_level = level;
     m_lastResponse = lastResponse;
     m_inputScanStatus = device.DriverInterface.InputScanStatus.ToString();
     m_inputScanCount = device.DriverInterface.InputScanCount;
     m_inputScanIndex = device.DriverInterface.InputScanIndex;
     m_outputScanStatus = device.DriverInterface.OutputScanState.ToString();
     m_outputScanCount = device.DriverInterface.OutputScanCount;
     m_outputScanIndex = device.DriverInterface.OutputScanIndex;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Main entry point for the application
        /// </summary>
        /// <param name="args">Commandline arguments. see /help for documentation</param>
        /// <returns>0 if sucseed, otherwise a value below 0. see error codes in documentation</returns>
        public static int Main(string[] args)
        {            
            ConsoleAdapter.TryAttach();
            int returnCode = 0;

            try
            {
                new ProgramHandler().DoApplication(args);
            }
            catch (RegAddinException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = exception.ReturnCode;
            }
            catch (UnauthorizedAccessException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("UnauthorizedAccess");
            }
            catch (System.Security.SecurityException exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("MissingPermissions");
            }
            catch (Exception exception)
            {
                new ExceptionPresenter().ShowError(exception);
                returnCode = new ErrorCodes().SetLastError(exception).CodeFromName("UnexpectedError");
            }
            
            if (SingletonSettings.Alert == SingletonSettings.AlertMode.On || 
                SingletonSettings.Alert == SingletonSettings.AlertMode.Error && returnCode != 0)
            {
                if (returnCode == 0)
                    Alert.Window.ShowSucceedMessage();
                else
                    Alert.Window.ShowError(new ErrorCodes().MessageDetailsFromCode(returnCode));
            }
            
            return returnCode;
        }
Ejemplo n.º 15
0
 private void DoLastFMError(Exception ex)
 {
     _lastFMStart = DateTime.Now;
     this.BeginDispatch(() =>
         {
             _lastError = ErrorCodes.ERROR_GETTING_SESSION;
             //ShowError(_lastError, ex);
             _loadingPage.UpdateStatus("Error Fetching Last.FM Session");
         });
     while ((DateTime.Now - _lastFMStart).TotalMilliseconds < 3000) Thread.Sleep(10);
     this.BeginDispatch(() => transitionControl.ShowPage(_settingsPage));
     _lastFMAuth = false;
 }
Ejemplo n.º 16
0
 private void _player_ConnectionEvent(object sender, bool state, ErrorCodes code)
 {
     if (state)
     {
         if (_config.Fields.Pandora_AutoPlay)
         {
             Station s = null;
             if (StartupStation != null)
                 s = _player.GetStationFromString(StartupStation);
             if (s == null)
             {
                 s = _player.GetStationFromID(_config.Fields.Pandora_LastStationID);
             }
             if (s != null)
             {
                 _loadingPage.UpdateStatus("Loading Station:" + Environment.NewLine + s.Name);
                 _player.PlayStation(s);
             }
             else
             {
                 ShowStationList();
             }
         }
         else
         {
             this.BeginDispatch(ShowStationList);
         }
     }
     else
     {
         transitionControl.ShowPage(_loginPage);
     }
 }
Ejemplo n.º 17
0
        private void ShowErrorPage(ErrorCodes code, Exception ex)
        {
            if (!_showingError)
            {
                _showingError = true;

                _prevPage = transitionControl.CurrentPage;
                _errorPage.SetError(Errors.GetErrorMessage(code), Errors.IsHardFail(code), ex);
                transitionControl.ShowPage(_errorPage);
            }
        }
Ejemplo n.º 18
0
        /**
         * Handle spawning of the RPCUtility with parameters
         */
        public static bool RunRPCUtilty(string RPCCommand, bool bIsSilent = false)
        {
            string     CommandLine        = "";
            string     WorkingFolder      = "";
            string     DisplayCommandLine = "";
            string     TempKeychain       = "$HOME/Library/Keychains/UE4TempKeychain.keychain";
            string     Certificate        = "XcodeSupportFiles/" + MacSigningIdentityFilename;
            string     LoginKeychain      = "$HOME/Library/Keychains/login.keychain";
            ErrorCodes Error = ErrorCodes.Error_Unknown;

            switch (RPCCommand.ToLowerInvariant())
            {
            case "deletemacstagingfiles":
                Program.Log(" ... deleting staging files on the Mac");
                DisplayCommandLine = "rm -rf Payload";
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "ensureprovisiondirexists":
                Program.Log(" ... creating provisioning profiles directory");

                DisplayCommandLine = String.Format("mkdir -p ~/Library/MobileDevice/Provisioning\\ Profiles");

                CommandLine   = "\"" + MacXcodeStagingDir + "\" " + DisplayCommandLine;
                WorkingFolder = "\"" + MacXcodeStagingDir + "\"";
                break;

            case "installprovision":
                // Note: The provision must have already been copied over to the Mac
                Program.Log(" ... installing .mobileprovision");

                DisplayCommandLine = String.Format("cp -f {0} ~/Library/MobileDevice/Provisioning\\ Profiles", MacMobileProvisionFilename);

                CommandLine   = "\"" + MacXcodeStagingDir + "\" " + DisplayCommandLine;
                WorkingFolder = "\"" + MacXcodeStagingDir + "\"";
                break;

            case "removeprovision":
                Program.Log(" ... removing .mobileprovision");
                DisplayCommandLine = String.Format("rm -f ~/Library/MobileDevice/Provisioning\\ Profiles/{0}", MacMobileProvisionFilename);
                CommandLine        = "\"" + MacXcodeStagingDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacXcodeStagingDir + "\"";
                break;

            case "setexec":
                // Note: The executable must have already been copied over
                Program.Log(" ... setting executable bit");
                DisplayCommandLine = "chmod a+x \'" + RemoteExecutablePath + "\'";
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "prepackage":
                Program.Log(" ... running prepackage script remotely ");
                DisplayCommandLine = String.Format("sh prepackage.sh {0} " + Config.OSString + " {1} {2}", Program.GameName, Program.GameConfiguration, Program.Architecture);
                CommandLine        = "\"" + MacXcodeStagingDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacXcodeStagingDir + "\"";
                break;

            case "makeapp":
                Program.Log(" ... making application (codesign, etc...)");
                Program.Log("  Using signing identity '{0}'", Config.CodeSigningIdentity);
                DisplayCommandLine = "security -v unlock-keychain -p \"A\" \"" + TempKeychain + "\" && " + CurrentBaseXCodeCommandLine;
                CommandLine        = "\"" + MacXcodeStagingDir + "/..\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacXcodeStagingDir + "/..\"";
                Error = ErrorCodes.Error_RemoteCertificatesNotFound;
                break;

            case "createkeychain":
                Program.Log(" ... creating temporary key chain with signing certificate");
                Program.Log("  Using signing identity '{0}'", Config.CodeSigningIdentity);
                if (Config.bAutomaticSigning)
                {
                    DisplayCommandLine = "security dump-keychain -i login.keychain && security create-keychain -p \"A\" \"" + TempKeychain + "\" && security list-keychains -s \"" + TempKeychain + "\" && security list-keychains && security set-keychain-settings -t 3600 -l  \"" + TempKeychain + "\" && security -v unlock-keychain -p \"A\" \"" + TempKeychain + "\" && security default-keychain -s \"" + TempKeychain + "\" && security import login.keychain -P \"A\" -T /usr/bin/codesign";                            //&& security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k \"A\" -t private " + TempKeychain;
                }
                else
                {
                    DisplayCommandLine = "security create-keychain -p \"A\" \"" + TempKeychain + "\" && security list-keychains -s \"" + TempKeychain + "\" && security list-keychains && security set-keychain-settings -t 3600 -l  \"" + TempKeychain + "\" && security -v unlock-keychain -p \"A\" \"" + TempKeychain + "\" && security import " + Certificate + " -k \"" + TempKeychain + "\" -P \"A\" -T /usr/bin/codesign -T /usr/bin/security -t agg && CERT_IDENTITY=$(security find-identity -v -p codesigning \"" + TempKeychain + "\" | head -1 | grep '\"' | sed -e 's/[^\"]*\"//' -e 's/\".*//') && security default-keychain -s \"" + TempKeychain + "\" && security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k \"A\" -D \"$CERT_IDENTITY\" -t private " + TempKeychain;
                }
                CommandLine   = "\"" + MacXcodeStagingDir + "/..\" " + DisplayCommandLine;
                WorkingFolder = "\"" + MacXcodeStagingDir + "/..\"";
                break;

            case "deletekeychain":
                Program.Log(" ... remove temporary key chain");
                Program.Log("  Using signing identity '{0}'", Config.CodeSigningIdentity);
                DisplayCommandLine = "security list-keychains -s \"" + LoginKeychain + "\" && security delete-keychain \"" + TempKeychain + "\"";
                CommandLine        = "\"" + MacXcodeStagingDir + "/..\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacXcodeStagingDir + "/..\"";
                break;

            case "validation":
                Program.Log(" ... validating distribution package");
                DisplayCommandLine = XcodeDeveloperDir + "Platforms/iPhoneOS.platform/Developer/usr/bin/Validation " + RemoteAppDirectory;
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "deleteipa":
                Program.Log(" ... deleting IPA on Mac");
                DisplayCommandLine = "rm -f " + Config.IPAFilenameOnMac;
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "kill":
                Program.Log(" ... killing");
                DisplayCommandLine = "killall " + Program.GameName;
                CommandLine        = ". " + DisplayCommandLine;
                WorkingFolder      = ".";
                break;

            case "strip":
                Program.Log(" ... stripping");
                DisplayCommandLine = "/usr/bin/xcrun strip '" + RemoteExecutablePath + "'";
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "resign":
                Program.Log("... resigning");
                DisplayCommandLine = "bash -c '" + "chmod a+x ResignScript" + ";" + "./ResignScript" + "'";
                CommandLine        = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder      = "\"" + MacStagingRootDir + "\"";
                break;

            case "zip":
                Program.Log(" ... zipping");

                // NOTE: -y preserves symbolic links which is needed for iOS distro builds
                // -x excludes a file (excluding the dSYM keeps sizes smaller, and it shouldn't be in the IPA anyways)
                string dSYMName = "Payload/" + Program.GameName + Program.Architecture + ".app.dSYM";
                DisplayCommandLine = String.Format("zip -q -r -y -{0} -T {1} Payload iTunesArtwork -x {2}/ -x {2}/* " +
                                                   "-x {2}/Contents/ -x {2}/Contents/* -x {2}/Contents/Resources/ -x {2}/Contents/Resources/* " +
                                                   " -x {2}/Contents/Resources/DWARF/ -x {2}/Contents/Resources/DWARF/*",
                                                   (int)Config.RecompressionSetting,
                                                   Config.IPAFilenameOnMac,
                                                   dSYMName);

                CommandLine   = "\"" + MacStagingRootDir + "\" " + DisplayCommandLine;
                WorkingFolder = "\"" + MacStagingRootDir + "\"";
                break;

            case "gendsym":
                Program.Log(" ... generating DSYM");

                string ExePath  = "Payload/" + Program.GameName + ".app/" + Program.GameName;
                string dSYMPath = Program.GameName + ".app.dSYM";
                DisplayCommandLine = String.Format("dsymutil -o {0} {1}", dSYMPath, ExePath);

                CommandLine   = "\"" + MacStagingRootDir + "\"" + DisplayCommandLine;
                WorkingFolder = "\"" + MacStagingRootDir + "\"";
                break;

            default:
                Program.Error("Unrecognized RPC command");
                return(false);
            }

            Program.Log(" ... working folder: " + WorkingFolder);
            Program.Log(" ... " + DisplayCommandLine);
            Program.Log(" ... full command: " + MacName + " " + CommandLine);

            bool bSuccess = false;

            if (Config.bUseRPCUtil)
            {
                Program.Log("Running RPC on " + MacName + " ... ");

                Process RPCUtil = new Process();
                RPCUtil.StartInfo.FileName               = @"..\RPCUtility.exe";
                RPCUtil.StartInfo.UseShellExecute        = false;
                RPCUtil.StartInfo.Arguments              = MacName + " " + CommandLine;
                RPCUtil.StartInfo.RedirectStandardOutput = true;
                RPCUtil.StartInfo.RedirectStandardError  = true;
                RPCUtil.OutputDataReceived              += new DataReceivedEventHandler(OutputReceivedRemoteProcessCall);
                RPCUtil.ErrorDataReceived += new DataReceivedEventHandler(OutputReceivedRemoteProcessCall);

                RPCUtil.Start();

                RPCUtil.BeginOutputReadLine();
                RPCUtil.BeginErrorReadLine();

                RPCUtil.WaitForExit();

                bSuccess = (RPCUtil.ExitCode == 0);
                if (bSuccess == false && !bIsSilent)
                {
                    Program.Error("RPCCommand {0} failed with return code {1}", RPCCommand, RPCUtil.ExitCode);
                    switch (RPCCommand.ToLowerInvariant())
                    {
                    case "installprovision":
                        Program.Error("Ensure your access permissions for '~/Library/MobileDevice/Provisioning Profiles' are set correctly.");
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                Program.Log("Running SSH on " + MacName + " ... ");
                bSuccess = SSHCommandHelper.Command(MacName, DisplayCommandLine, WorkingFolder);
                if (bSuccess == false && !bIsSilent)
                {
                    Program.Error("RPCCommand {0} failed with return code {1}", RPCCommand, Error);
                    Program.ReturnCode = (int)Error;
                }
            }


            return(bSuccess);
        }
Ejemplo n.º 19
0
 public void OnError(ErrorCodes errorCode)
 {
     ErrorEvent?.Invoke(this, errorCode);
 }
Ejemplo n.º 20
0
 public MagicException(string Message, params object[] Arguments) : base(string.Format(Message, Arguments))
 {
     LastError = (ErrorCodes)Marshal.GetLastWin32Error();
 }
Ejemplo n.º 21
0
        public TrackingModule(IDataStore dataStore, TrackingUsers trackingUsers, TrackingSessions trackingSessions, ErrorCodes errorCodes)
            : base("/tracking", dataStore, trackingUsers, errorCodes)
        {
            Before += ctx =>
            {
                var user = Context.CurrentUser as UserIdentity;
                return(user == null
                        ? ErrorResponse(HttpStatusCode.Unauthorized, "Invalid access token! Please login to obtain a new access token.")
                        : null);
            };

            _trackingSessions   = trackingSessions;
            Get["/{sessionid}"] = parameters =>
            {
                var user = Context.CurrentUser as UserIdentity;

                string sessionId = parameters.sessionId;
                if (sessionId == null)
                {
                    return(ErrorResponse(HttpStatusCode.NotFound));
                }
                var trackingSession = _trackingSessions.Get(sessionId);
                if (trackingSession == null)
                {
                    return(ErrorResponse(HttpStatusCode.NotFound));
                }
                if (user == null || trackingSession.UserId != user.UserId)
                {
                    return(ErrorResponse(HttpStatusCode.Unauthorized));
                }
                if (trackingSession.Expires <= DateTime.Now)
                {
                    return(ErrorResponse(HttpStatusCode.Forbidden, "Session has expired!"));
                }

                return(Response.AsJson(trackingSession));
            };
            Post["/"] = parameters =>
            {
                var user = Context.CurrentUser as UserIdentity;
                if (user == null)
                {
                    return(ErrorResponse(HttpStatusCode.Unauthorized));
                }

                Response response;
                if (!CheckSaveRetention(SessionCache, out response))
                {
                    return(response);
                }

                var trackingSession = this.Bind <TrackingSession>();
                trackingSession.UserId = user.UserId;
                _trackingSessions.Add(trackingSession);

                return(Response.AsJson(trackingSession));
            };
            Put["/{sessionid}"] = parameters =>
            {
                var user = Context.CurrentUser as UserIdentity;
                if (user == null)
                {
                    return(ErrorResponse(HttpStatusCode.Unauthorized));
                }

                Response response;
                if (!CheckSaveRetention(SessionCache, out response))
                {
                    return(response);
                }

                string sessionId = parameters.sessionId;
                if (sessionId == null)
                {
                    return(ErrorResponse(HttpStatusCode.NotFound));
                }

                var trackingSession = this.Bind <TrackingSession>();
                trackingSession.Id     = sessionId;
                trackingSession.UserId = user.UserId;

                _trackingSessions.Update(trackingSession);

                return(Response.AsJson(trackingSession));
            };
            Delete["/{sessionid}"] = parameters =>
            {
                var user = Context.CurrentUser as UserIdentity;
                if (user == null)
                {
                    return(ErrorResponse(HttpStatusCode.Unauthorized));
                }

                string sessionId = parameters.sessionId;
                if (sessionId != null)
                {
                    var trackingSession = _trackingSessions.Get(sessionId);
                    if (trackingSession == null)
                    {
                        return(ErrorResponse(HttpStatusCode.NotFound));
                    }
                    if (trackingSession.UserId != user.UserId)
                    {
                        return(ErrorResponse(HttpStatusCode.Unauthorized));
                    }

                    _trackingSessions.Delete(sessionId);
                    return(ErrorResponse(HttpStatusCode.OK,
                                         string.Format("Tracking session '{0}' including all its positions is removed.", sessionId)));
                }
                return(ErrorResponse(HttpStatusCode.BadRequest));
            };
        }
        private void ValidateRecord(AAccountingPeriodRow ARow, Boolean ACheckGapToPrevious, Boolean ACheckGapToNext)
        {
            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;
            DataColumn ValidationColumn;
            TValidationControlsData ValidationControlsData;
            TVerificationResult     VerificationResult = null;
            AAccountingPeriodRow    OtherRow;
            DataRow OtherDataRow;

            string CurrentDateRangeErrorCode;

            if (FDuringSave)
            {
                CurrentDateRangeErrorCode = PetraErrorCodes.ERR_PERIOD_DATE_RANGE;
            }
            else
            {
                CurrentDateRangeErrorCode = PetraErrorCodes.ERR_PERIOD_DATE_RANGE_WARNING;
            }

            // first run through general checks related to the current AccountingPeriod row
            TSharedFinanceValidation_GLSetup.ValidateAccountingPeriod(this, ARow, ref VerificationResultCollection,
                                                                      FPetraUtilsObject.ValidationControlsDict);

            // the following checks need to be done in this ManualCode file as they involve other rows on the screen:

            // check that there is no gap to previous accounting period
            if (ACheckGapToPrevious)
            {
                ValidationColumn = ARow.Table.Columns[AAccountingPeriodTable.ColumnPeriodStartDateId];

                if (FPetraUtilsObject.ValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
                {
                    if (!ARow.IsPeriodStartDateNull() &&
                        (ARow.PeriodStartDate != DateTime.MinValue))
                    {
                        OtherDataRow = FMainDS.AAccountingPeriod.Rows.Find(
                            new string[] { FLedgerNumber.ToString(), (ARow.AccountingPeriodNumber - 1).ToString() });

                        if (OtherDataRow != null)
                        {
                            OtherRow = (AAccountingPeriodRow)OtherDataRow;

                            if (OtherRow.PeriodEndDate != ARow.PeriodStartDate.Date.AddDays(-1))
                            {
                                VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                           ErrorCodes.GetErrorInfo(CurrentDateRangeErrorCode,
                                                                                                                                   new string[] { (ARow.AccountingPeriodNumber - 1).ToString() })),
                                                                                   ValidationColumn, ValidationControlsData.ValidationControl);
                            }
                            else
                            {
                                VerificationResult = null;
                            }

                            // Handle addition/removal to/from TVerificationResultCollection
                            VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
                        }
                    }
                }
            }

            // check that there is no gap to next accounting period
            if (ACheckGapToNext)
            {
                ValidationColumn = ARow.Table.Columns[AAccountingPeriodTable.ColumnPeriodEndDateId];

                if (FPetraUtilsObject.ValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
                {
                    if (!ARow.IsPeriodEndDateNull() &&
                        (ARow.PeriodEndDate != DateTime.MinValue))
                    {
                        OtherDataRow = FMainDS.AAccountingPeriod.Rows.Find(
                            new string[] { FLedgerNumber.ToString(), (ARow.AccountingPeriodNumber + 1).ToString() });

                        if (OtherDataRow != null)
                        {
                            OtherRow = (AAccountingPeriodRow)OtherDataRow;

                            if (OtherRow.PeriodStartDate != ARow.PeriodEndDate.Date.AddDays(1))
                            {
                                VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                           ErrorCodes.GetErrorInfo(CurrentDateRangeErrorCode,
                                                                                                                                   new string[] { (ARow.AccountingPeriodNumber).ToString() })),
                                                                                   ValidationColumn, ValidationControlsData.ValidationControl);
                            }
                            else
                            {
                                VerificationResult = null;
                            }

                            // Handle addition/removal to/from TVerificationResultCollection
                            VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
                        }
                    }
                }
            }
        }
        private void ValidateDataManual(PSubscriptionRow ARow)
        {
            DataColumn ValidationColumn;
            TValidationControlsData ValidationControlsData;
            TVerificationResult     VerificationResult = null;
            bool NoClearingOfVerificationResult        = false;

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;

            if (!chkChangeReasonSubsGivenCode.Checked)
            {
                if (VerificationResultCollection.Contains(ARow.Table.Columns[PSubscriptionTable.ColumnReasonSubsGivenCodeId]))
                {
                    VerificationResultCollection.Remove(ARow.Table.Columns[PSubscriptionTable.ColumnReasonSubsGivenCodeId]);
                }
            }

            if (!chkChangeStartDate.Checked)
            {
                if (VerificationResultCollection.Contains(ARow.Table.Columns[PSubscriptionTable.ColumnStartDateId]))
                {
                    VerificationResultCollection.Remove(ARow.Table.Columns[PSubscriptionTable.ColumnStartDateId]);
                }
            }

            // if 'SubscriptionStatus' is CANCELLED or EXPIRED then 'Reason Ended' and 'End Date' must be set
            ValidationColumn = ARow.Table.Columns[PSubscriptionTable.ColumnSubscriptionStatusId];

            if (FPetraUtilsObject.ValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
            {
                if ((!ARow.IsSubscriptionStatusNull()) &&
                    ((ARow.SubscriptionStatus == "CANCELLED") ||
                     (ARow.SubscriptionStatus == "EXPIRED")))
                {
                    if (ARow.IsReasonSubsCancelledCodeNull() ||
                        (ARow.ReasonSubsCancelledCode == String.Empty))
                    {
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                   ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_REASONENDEDMANDATORY_WHEN_EXPIRED)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);
                    }
                    else if (ARow.IsDateCancelledNull())
                    {
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                   ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_DATEENDEDMANDATORY_WHEN_EXPIRED)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);
                    }
                }
                else
                {
                    // if 'SubscriptionStatus' is not CANCELLED or EXPIRED then 'Reason Ended' and 'End Date' must NOT be set
                    if (chkChangeReasonSubsCancelledCode.Checked)
                    {
                        if ((ARow.IsReasonSubsCancelledCodeNull()) ||
                            (ARow.ReasonSubsCancelledCode == String.Empty))
                        {
                            VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                       ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_REASONENDEDSET_WHEN_ACTIVE)),
                                                                               ValidationColumn, ValidationControlsData.ValidationControl);
                        }
                    }
                    else if (!chkChangeReasonSubsCancelledCode.Checked)
                    {
                        if (ARow.SubscriptionStatus != String.Empty)
                        {
                            VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                       ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_REASONENDEDSET_WHEN_ACTIVE)),
                                                                               ValidationColumn, ValidationControlsData.ValidationControl);

                            VerificationResult.OverrideResultText(Catalog.GetString(
                                                                      "Reason Ended must be cleared when a Subscription is made active."));

                            NoClearingOfVerificationResult = true;
                        }
                    }

                    if ((!ARow.IsReasonSubsCancelledCodeNull()) &&
                        (ARow.ReasonSubsCancelledCode != String.Empty))
                    {
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                   ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_REASONENDEDSET_WHEN_ACTIVE)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);
                    }
                    else if (!ARow.IsDateCancelledNull())
                    {
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                   ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_DATEENDEDSET_WHEN_ACTIVE)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);
                    }
                    else if (!chkChangeDateCancelled.Checked)
                    {
                        if (ARow.SubscriptionStatus != String.Empty)
                        {
                            VerificationResult = new TScreenVerificationResult(new TVerificationResult(this,
                                                                                                       ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_SUBSCRIPTION_DATEENDEDSET_WHEN_ACTIVE)),
                                                                               ValidationColumn, ValidationControlsData.ValidationControl);

                            VerificationResult.OverrideResultText(Catalog.GetString("Date Ended must be cleared when a Subscription is made active."));
                        }
                    }
                    else
                    {
                        if (!NoClearingOfVerificationResult)
                        {
                            VerificationResult = null;
                        }
                    }
                }

                // Handle addition/removal to/from TVerificationResultCollection
                VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
            }
        }
Ejemplo n.º 24
0
 public BaseModule(string modulePath, IDataStore dataStore, TrackingUsers trackingUsers, ErrorCodes errorCodes)
     : base(modulePath)
 {
     ErrorCodes     = errorCodes;
     _dataStore     = dataStore;
     _trackingUsers = trackingUsers;
 }
Ejemplo n.º 25
0
 public BaseModule(IDataStore dataStore, ErrorCodes errorCodes)
 {
     ErrorCodes = errorCodes;
     _dataStore = dataStore;
 }
Ejemplo n.º 26
0
 /// <inheritdoc />
 internal RemoteBadRequest(ErrorCodes code) : base(code, null)
 {
 }
Ejemplo n.º 27
0
 //==================================================================
 /// <summary>
 /// Clears the error code - typically used for staring scans
 /// </summary>
 //==================================================================
 internal void ClearInputScanError()
 {
     m_inputScanErrorCode = ErrorCodes.NoErrors;
 }
Ejemplo n.º 28
0
        /// <summary>
        /// Checks whether the date is within a specified date range. Null values are accepted.
        /// </summary>
        /// <remarks>This Method is capable of returning varying<see cref="TVerificationResult" /> objects! The objects
        /// returned are determined by the values specified for <paramref name="ALowerRangeCheckType" /> and
        ///  <paramref name="AUpperRangeCheckType" />!</remarks>
        /// <param name="ADate">Date to check.</param>
        /// <param name="ALowerDateRangeEnd">Lower end of the valid Date Range.</param>
        /// <param name="AUpperDateRangeEnd">Upper end of the valid Date Range.</param>
        /// <param name="ADescription">Name of the date value.</param>
        /// <param name="ALowerRangeCheckType">Type of Date Check: lower end of the valid Date Range (defaults to <see cref="TDateBetweenDatesCheckType.dbdctUnspecific" />).</param>
        /// <param name="AUpperRangeCheckType">Type of Date Check: upper end of the valid Date Range (defaults to <see cref="TDateBetweenDatesCheckType.dbdctUnspecific" />).</param>
        /// <param name="AResultContext">Context of verification (can be null).</param>
        /// <param name="AResultColumn">Which <see cref="System.Data.DataColumn" /> failed (can be null).</param>
        /// <param name="AResultControl">Which <see cref="System.Windows.Forms.Control" /> is involved (can be null).</param>
        /// <returns>Null if the date <paramref name="ADate" /> is between the lower and the upper end of the Date Range specified
        /// (lower and upper end dates are included), otherwise a verification result with a message that uses
        /// <paramref name="ADescription" />.
        /// </returns>
        public static TVerificationResult IsDateBetweenDates(DateTime?ADate, DateTime?ALowerDateRangeEnd, DateTime?AUpperDateRangeEnd,
                                                             String ADescription,
                                                             TDateBetweenDatesCheckType ALowerRangeCheckType = TDateBetweenDatesCheckType.dbdctUnspecific,
                                                             TDateBetweenDatesCheckType AUpperRangeCheckType = TDateBetweenDatesCheckType.dbdctUnspecific,
                                                             object AResultContext = null, System.Data.DataColumn AResultColumn = null, System.Windows.Forms.Control AResultControl = null)
        {
            TVerificationResult ReturnValue           = null;
            DateTime            TheDate               = TSaveConvert.ObjectToDate(ADate);
            DateTime            LowerDateRangeEndDate = TSaveConvert.ObjectToDate(ALowerDateRangeEnd);
            DateTime            UpperDateRangeEndDate = TSaveConvert.ObjectToDate(AUpperDateRangeEnd);
            String Description = THelper.NiceValueDescription(ADescription);

            if ((!ADate.HasValue) ||
                (!ALowerDateRangeEnd.HasValue) ||
                (!AUpperDateRangeEnd.HasValue))
            {
                return(null);
            }

            // Check
            if ((TheDate < LowerDateRangeEndDate) ||
                (TheDate > UpperDateRangeEndDate))
            {
                if ((ALowerRangeCheckType == TDateBetweenDatesCheckType.dbdctUnspecific) &&
                    (AUpperRangeCheckType == TDateBetweenDatesCheckType.dbdctUnspecific))
                {
                    ReturnValue = GetUnspecificDateRangeCheckVerificationResult(LowerDateRangeEndDate,
                                                                                UpperDateRangeEndDate,
                                                                                Description,
                                                                                AResultContext);
                }
                else if (TheDate < LowerDateRangeEndDate)
                {
                    if (ALowerRangeCheckType == TDateBetweenDatesCheckType.dbdctNoPastDate)
                    {
                        ReturnValue = new TVerificationResult(AResultContext,
                                                              ErrorCodes.GetErrorInfo(CommonErrorCodes.ERR_NOPASTDATE, CommonResourcestrings.StrInvalidDateEntered +
                                                                                      Environment.NewLine +
                                                                                      StrDateMustNotBePastDate, new string[] { Description }));
                    }
                    else if (ALowerRangeCheckType == TDateBetweenDatesCheckType.dbdctUnrealisticDate)
                    {
                        ReturnValue = new TVerificationResult(AResultContext,
                                                              ErrorCodes.GetErrorInfo(CommonErrorCodes.ERR_UNREALISTICDATE_ERROR, CommonResourcestrings.StrInvalidDateEntered +
                                                                                      Environment.NewLine +
                                                                                      StrDateNotSensible, new string[] { Description }));
                    }
                    else
                    {
                        ReturnValue = GetUnspecificDateRangeCheckVerificationResult(LowerDateRangeEndDate,
                                                                                    UpperDateRangeEndDate,
                                                                                    Description,
                                                                                    AResultContext);
                    }
                }
                else if (TheDate > UpperDateRangeEndDate)
                {
                    if (AUpperRangeCheckType == TDateBetweenDatesCheckType.dbdctNoFutureDate)
                    {
                        ReturnValue = new TVerificationResult(AResultContext,
                                                              ErrorCodes.GetErrorInfo(CommonErrorCodes.ERR_NOFUTUREDATE, CommonResourcestrings.StrInvalidDateEntered +
                                                                                      Environment.NewLine +
                                                                                      StrDateMustNotBeFutureDate, new string[] { Description }));
                    }
                    else if (AUpperRangeCheckType == TDateBetweenDatesCheckType.dbdctUnrealisticDate)
                    {
                        ReturnValue = new TVerificationResult(AResultContext,
                                                              ErrorCodes.GetErrorInfo(CommonErrorCodes.ERR_UNREALISTICDATE_ERROR, CommonResourcestrings.StrInvalidDateEntered +
                                                                                      Environment.NewLine +
                                                                                      StrDateNotSensible, new string[] { Description }));
                    }
                    else
                    {
                        ReturnValue = GetUnspecificDateRangeCheckVerificationResult(LowerDateRangeEndDate,
                                                                                    UpperDateRangeEndDate,
                                                                                    Description,
                                                                                    AResultContext);
                    }
                }

                if (AResultColumn != null)
                {
                    ReturnValue = new TScreenVerificationResult(ReturnValue, AResultColumn, AResultControl);
                }
            }
            else
            {
                ReturnValue = null;
            }

            return(ReturnValue);
        }
Ejemplo n.º 29
0
 internal CassandraException(ErrorCodes code, string message)
         : base(message)
 {
     Code = code;
 }
        private void ValidateDataManual(PcConferenceRow ARow)
        {
            PcDiscountTable DiscountTable = FMainDS.PcDiscount;

            TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection;
            TValidationControlsData       ValidationControlsData;
            TScreenVerificationResult     VerificationResult = null;
            DataColumn ValidationColumn;

            List <string> CriteriaCodesUsed = new List <string>();

            foreach (PcDiscountRow Row in DiscountTable.Rows)
            {
                if ((Row.RowState != DataRowState.Deleted) && (Row.DiscountCriteriaCode != "CHILD"))
                {
                    if (Row.Discount > 100)
                    {
                        ValidationColumn = Row.Table.Columns[PcDiscountTable.ColumnDiscountId];

                        // displays a warning message
                        VerificationResult = new TScreenVerificationResult(new TVerificationResult(this, ErrorCodes.GetErrorInfo(
                                                                                                       PetraErrorCodes.ERR_DISCOUNT_PERCENTAGE_GREATER_THAN_100)),
                                                                           ValidationColumn, ValidationControlsData.ValidationControl);

                        // Handle addition to/removal from TVerificationResultCollection
                        VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
                    }

                    if (!CriteriaCodesUsed.Exists(element => element == Row.DiscountCriteriaCode))
                    {
                        CriteriaCodesUsed.Add(Row.DiscountCriteriaCode);
                    }
                }
            }

            string[] CriteriaCodesUsedArray = CriteriaCodesUsed.ToArray();

            if (!TRemote.MConference.Conference.WebConnectors.CheckDiscountCriteriaCodeExists(CriteriaCodesUsedArray))
            {
                ValidationColumn = DiscountTable.Columns[PcDiscountTable.ColumnDiscountCriteriaCodeId];

                // displays a warning message
                VerificationResult = new TScreenVerificationResult(new TVerificationResult(this, ErrorCodes.GetErrorInfo(
                                                                                               PetraErrorCodes.ERR_DISCOUNT_CRITERIA_CODE_DOES_NOT_EXIST)),
                                                                   ValidationColumn, ValidationControlsData.ValidationControl);

                // Handle addition to/removal from TVerificationResultCollection
                VerificationResultCollection.Auto_Add_Or_AddOrRemove(this, VerificationResult, ValidationColumn);
            }
        }
Ejemplo n.º 31
0
 public RoomJoin(ErrorCodes err)
     : base((ushort)Enums.Packets.RoomJoin)
 {
     Append((uint)err);
 }
Ejemplo n.º 32
0
 void _player_ExceptionEvent(object sender, ErrorCodes code, Exception ex)
 {
     ShowWait(false);
 }
Ejemplo n.º 33
0
        public static void ThrowIfError(this ErrorCodes code, params object[] args)
        {
            switch (code)
            {
            case ErrorCodes.Ok:
                return;

            case ErrorCodes.UnknownServerError:
                throw new InvalidOperationException(LocalizedStrings.UnknownServerError);

            // auth error codes
            case ErrorCodes.InvalidCredentials:
                throw new InvalidOperationException(LocalizedStrings.WrongLoginOrPassword);

            case ErrorCodes.ClientNotExist:
                throw new InvalidOperationException(LocalizedStrings.AccountNotFound);

            case ErrorCodes.SessionNotExist:
                throw new InvalidOperationException(LocalizedStrings.SessionExpired);

            case ErrorCodes.TimeOut:
                throw new InvalidOperationException(LocalizedStrings.Str24);

            case ErrorCodes.Locked:
                throw new InvalidOperationException(LocalizedStrings.UserBlocked);

            // reg error codes
            case ErrorCodes.InvalidEmail:
                throw new InvalidOperationException(LocalizedStrings.EmailIncorrect);

            case ErrorCodes.InvalidLogin:
                throw new InvalidOperationException(LocalizedStrings.LoginIncorrect);

            case ErrorCodes.InvalidPhone:
                throw new InvalidOperationException(LocalizedStrings.PhoneIncorrect);

            case ErrorCodes.InvalidPassword:
                throw new InvalidOperationException(LocalizedStrings.PasswordNotCriteria);

            case ErrorCodes.DuplicateEmail:
                throw new InvalidOperationException(LocalizedStrings.EmailAlreadyUse);

            case ErrorCodes.DuplicatePhone:
                throw new InvalidOperationException(LocalizedStrings.PhoneAlreadyUse);

            case ErrorCodes.DuplicateLogin:
                throw new InvalidOperationException(LocalizedStrings.LoginAlreadyUse);

            case ErrorCodes.InvalidEmailCode:
                throw new InvalidOperationException(LocalizedStrings.IncorrectVerificationCode);

            case ErrorCodes.InvalidSmsCode:
                throw new InvalidOperationException(LocalizedStrings.IncorrectSmsCode);

            // notify error codes
            case ErrorCodes.SmsNotEnought:
                throw new InvalidOperationException(LocalizedStrings.SmsNotEnough);

            case ErrorCodes.EmailNotEnought:
                throw new InvalidOperationException(LocalizedStrings.EmailNotEnough);

            case ErrorCodes.PhoneNotExist:
                throw new InvalidOperationException(LocalizedStrings.PhoneNotSpecified);

            // license error codes
            case ErrorCodes.LicenseRejected:
                throw new InvalidOperationException(LocalizedStrings.LicenseRevoked);

            case ErrorCodes.LicenseMaxRenew:
                throw new InvalidOperationException(LocalizedStrings.LicenseMaxRenew);

            case ErrorCodes.ClientNotApproved:
                throw new InvalidOperationException(LocalizedStrings.SmsActivationFailed);

            case ErrorCodes.TooMuchFrequency:
                throw new InvalidOperationException(LocalizedStrings.MaxLicensePerMin);

            case ErrorCodes.StrategyRemoved:
                throw new InvalidOperationException(LocalizedStrings.StrategyRemoved.Put(args));

            case ErrorCodes.StrategyNotExist:
                throw new InvalidOperationException(LocalizedStrings.StrategyNotExist.Put(args));

            case ErrorCodes.StrategyPriceTypeCannotChange:
                throw new InvalidOperationException(LocalizedStrings.StrategyPriceTypeCannotChange.Put(args));

            case ErrorCodes.StrategyContentTypeCannotChange:
                throw new InvalidOperationException(LocalizedStrings.StrategyContentTypeCannotChange.Put(args));

            case ErrorCodes.StrategyOwnSubscribe:
                throw new InvalidOperationException(LocalizedStrings.OwnStrategySubscription);

            case ErrorCodes.TooMuchPrice:
                throw new InvalidOperationException(LocalizedStrings.TooMuchPrice);

            case ErrorCodes.NotEnoughBalance:
                throw new InvalidOperationException(LocalizedStrings.NotEnoughBalance.Put(args));

            case ErrorCodes.NotSubscribed:
                throw new InvalidOperationException(LocalizedStrings.NotSubscribed.Put(args));

            case ErrorCodes.CurrencyCannotChange:
                throw new InvalidOperationException(LocalizedStrings.CurrencyCannotChange);

            case ErrorCodes.NotCompleteRegistered:
                throw new InvalidOperationException(LocalizedStrings.NotCompleteRegistered);

            case ErrorCodes.FileNotStarted:
                throw new InvalidOperationException(LocalizedStrings.FileNotStarted);

            case ErrorCodes.FileTooMuch:
                throw new InvalidOperationException(LocalizedStrings.FileTooMuch);

            case ErrorCodes.FileNotExist:
                throw new InvalidOperationException(LocalizedStrings.Str1575);

            default:
                throw new InvalidOperationException(LocalizedStrings.UnknownServerErrorCode.Put(code));
            }
        }
Ejemplo n.º 34
0
        private void _pandora_ConnectionEvent(object sender, bool state, ErrorCodes code)
        {
            LoggedIn = state;

            if (ConnectionEvent != null)
                ConnectionEvent(this, state, code);

            if (state)
                _cqman.SendStatusUpdate(QueryStatusValue.Connected);
            else
                _cqman.SendStatusUpdate(QueryStatusValue.Error);
        }
Ejemplo n.º 35
0
 private void OnLockError(Lock @lock, ErrorCodes error)
 {
     LockError?.Invoke(@lock, error);
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Gets the description associated with the specified WITSML error code.
 /// </summary>
 /// <param name="errorCode">The error code.</param>
 /// <returns>The description for the error code.</returns>
 public static string GetDescription(this ErrorCodes errorCode)
 {
     return(Resources.ResourceManager.GetString(errorCode.ToString(), Resources.Culture));
 }
 /// <summary>
 /// Creates a new instance of a <see cref="PusherException"/> class.
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="code">The Pusher error code.</param>
 public PusherException(string message, ErrorCodes code)
     : base(message)
 {
     PusherCode = code;
 }
Ejemplo n.º 38
0
 public Authorization(ErrorCodes errorCode) : base((ushort)Enums.Packets.Authorization)
 {
     Append((uint)errorCode);
 }
Ejemplo n.º 39
0
		public void Normal(ErrorCodes errorCode, double xc, double yc, double zc)
		{
			var point3D = new KompasPoint3D(xc, yc, zc);
			Assert.AreEqual(point3D.LastErrorCode, errorCode);
		}
 /// <summary>
 /// Creates a new instance of a <see cref="PusherException"/> class.
 /// </summary>
 /// <param name="message">The exception message.</param>
 /// <param name="code">The Pusher error code.</param>
 /// <param name="innerException">The exception that is the cause of the current exception.</param>
 public PusherException(string message, ErrorCodes code, Exception innerException)
     : base(message, innerException)
 {
     PusherCode = code;
 }
Ejemplo n.º 41
0
 void _player_ExceptionEvent(object sender, ErrorCodes code, Exception ex)
 {
     ShowWait(false);
 }
 static string GetErrorMessage(ErrorCodes errorCode)
 {
     return String.Format("Request failed with error: {0}", errorCode.GetDescription());
 }
Ejemplo n.º 43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ErrorCodeExceptionTranslator"/> class.
 /// </summary>
 /// <param name="provider">The data provider.</param>
 /// <param name="ec">The error code collection.</param>
 public ErrorCodeExceptionTranslator(IDbProvider provider, ErrorCodes ec)
 {
     DbProvider = provider;
     errorCodes = ec;
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageErrorContext"/> class.
 /// </summary>
 /// <param name="name">The message name (or tag).</param>
 /// <param name="controlNumber">The message control number.</param>
 /// <param name="errorCode">The syntax error code.</param>
 public MessageErrorContext(string name, string controlNumber, ErrorCodes errorCode)
     : this(name, controlNumber)
 {
     _codes.Add(errorCode);
 }
 public RequestFailedException(ErrorCodes errorCode)
     : base(GetErrorMessage(errorCode))
 {
 }
Ejemplo n.º 46
0
 /// <inheritdoc />
 public InvalidSyntax(ErrorCodes errorCode, string message) : base(errorCode, "Syntax error: " + message)
 {
 }
Ejemplo n.º 47
0
        private void SendPandoraError(ErrorCodes code, Exception ex)
        {
            if (ExceptionEvent != null)
                ExceptionEvent(this, code, ex);

            _cqman.SendStatusUpdate(QueryStatusValue.Error);
        }
Ejemplo n.º 48
0
        /**
         * Test scenario implementation.
         * @param testId        Test id.
         * @param threadId      Thread id.
         * @return              True is test successful, otherwise false.
         */
        static bool runTest(int testId, int threadId)
        {
            SudokuSolver s;
            int          sol;
            int          solNum;
            int          solUnq;
            int          solvingState;
            int          boardState;

            int[,] solution;
            int[,] puzzle;
            bool solCorr;
            bool testResult = true;

            switch (testId)
            {
            case 0:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    s      = new SudokuSolver(example);
                    solNum = s.findAllSolutions();
                    ErrorCodes.consolePrintlnIfError(solNum);
                    if (solNum != 1)
                    {
                        testResult = false;
                    }
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", findAllSolutions, example: " + example + ", solutions: " + solNum + ", time: " + s.getComputingTime() + " s.");
                }
                break;

            case 1:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    s      = new SudokuSolver(example);
                    solUnq = s.checkIfUniqueSolution();
                    ErrorCodes.consolePrintlnIfError(solUnq);
                    if (solUnq != SudokuSolver.SOLUTION_UNIQUE)
                    {
                        testResult = false;
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: " + example + ", is solution unique: NO, time: " + s.getComputingTime() + " s.");
                    }
                    else
                    {
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: " + example + ", is solution unique: YES, time: " + s.getComputingTime() + " s.");
                    }
                }
                break;

            case 2:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    s   = new SudokuSolver(example);
                    sol = s.solve();
                    ErrorCodes.consolePrintlnIfError(sol);
                    solution = s.getSolvedBoard();
                    solCorr  = SudokuStore.checkSolvedBoard(solution);
                    if (solCorr != true)
                    {
                        testResult = false;
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: " + example + ", is solution correct: NO, time: " + s.getComputingTime() + " s.");
                    }
                    else
                    {
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: " + example + ", is solution correct: YES, time: " + s.getComputingTime() + " s.");
                    }
                }
                break;

            case 3:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuStore.getPuzzleExample(example));
                    s      = new SudokuSolver(puzzle);
                    solNum = s.findAllSolutions();
                    ErrorCodes.consolePrintlnIfError(solNum);
                    if (solNum != 1)
                    {
                        testResult = false;
                    }
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + findAllSolutions, example: " + example + ", solutions: " + solNum + ", time: " + s.getComputingTime() + " s.");
                }
                break;

            case 4:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuStore.getPuzzleExample(example));
                    s      = new SudokuSolver(puzzle);
                    solUnq = s.checkIfUniqueSolution();
                    ErrorCodes.consolePrintlnIfError(solUnq);
                    if (solUnq != SudokuSolver.SOLUTION_UNIQUE)
                    {
                        testResult = false;
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + checkIfUniqueSolution, example: " + example + ", is solution unique: NO, time: " + s.getComputingTime() + " s.");
                    }
                    else
                    {
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + checkIfUniqueSolution, example: " + example + ", is solution unique: YES, time: " + s.getComputingTime() + " s.");
                    }
                }
                break;

            case 5:
                for (int example = 0; example < SudokuPuzzles.NUMBER_OF_PUZZLE_EXAMPLES; example++)
                {
                    puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuStore.getPuzzleExample(example));
                    s      = new SudokuSolver(puzzle);
                    sol    = s.solve();
                    ErrorCodes.consolePrintlnIfError(sol);
                    solution = s.getSolvedBoard();
                    solCorr  = SudokuStore.checkSolvedBoard(solution);
                    if (solCorr != true)
                    {
                        testResult = false;
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + solve, example: " + example + ", is solution correct: NO, time: " + s.getComputingTime() + " s.");
                    }
                    else
                    {
                        SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + solve, example: " + example + ", is solution correct: YES, time: " + s.getComputingTime() + " s.");
                    }
                }
                break;

            case 6:
                s      = new SudokuSolver(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                solNum = s.findAllSolutions();
                ErrorCodes.consolePrintlnIfError(solNum);
                if (solNum <= 1)
                {
                    testResult = false;
                }
                SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", findAllSolutions, example: non unique, solutions: " + solNum + ", time: " + s.getComputingTime() + " s.");
                break;

            case 7:
                s      = new SudokuSolver(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                solUnq = s.checkIfUniqueSolution();
                ErrorCodes.consolePrintlnIfError(solUnq);
                if (solUnq != SudokuSolver.SOLUTION_NON_UNIQUE)
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: non unique, is solution unique: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: non unique, is solution unique: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 8:
                s   = new SudokuSolver(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                sol = s.solve();
                ErrorCodes.consolePrintlnIfError(sol);
                solution = s.getSolvedBoard();
                solCorr  = SudokuStore.checkSolvedBoard(solution);
                if (solCorr != true)
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: non unique, is solution correct: NO, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: non unique, is solution correct: YES, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 9:
                puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                s      = new SudokuSolver(puzzle);
                solNum = s.findAllSolutions();
                ErrorCodes.consolePrintlnIfError(solNum);
                if (solNum <= 1)
                {
                    testResult = false;
                }
                SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + findAllSolutions, example: non unique, solutions: " + solNum + ", time: " + s.getComputingTime() + " s.");
                break;

            case 10:
                puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                s      = new SudokuSolver(puzzle);
                solUnq = s.checkIfUniqueSolution();
                ErrorCodes.consolePrintlnIfError(solUnq);
                if (solUnq != SudokuSolver.SOLUTION_NON_UNIQUE)
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + checkIfUniqueSolution, example: non unique, is solution unique: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + checkIfUniqueSolution, example: non unique, is solution unique: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 11:
                puzzle = SudokuStore.seqOfRandomBoardTransf(SudokuPuzzles.PUZZLE_NON_UNIQUE_SOLUTION);
                s      = new SudokuSolver(puzzle);
                sol    = s.solve();
                ErrorCodes.consolePrintlnIfError(sol);
                solution = s.getSolvedBoard();
                solCorr  = SudokuStore.checkSolvedBoard(solution);
                if (solCorr != true)
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + solve, example: non unique, is solution correct: NO, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", seqOfRandomBoardTransf + solve, example: non unique, is solution correct: YES, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 12:
                s      = new SudokuSolver(SudokuPuzzles.PUZZLE_NO_SOLUTION);
                solNum = s.findAllSolutions();
                ErrorCodes.consolePrintlnIfError(solNum);
                if (solNum != 0)
                {
                    testResult = false;
                }
                SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", findAllSolutions, example: no solution, solutions: " + solNum + ", time: " + s.getComputingTime() + " s.");
                break;

            case 13:
                s      = new SudokuSolver(SudokuPuzzles.PUZZLE_NO_SOLUTION);
                solUnq = s.checkIfUniqueSolution();
                ErrorCodes.consolePrintlnIfError(solUnq);
                if (solUnq == SudokuSolver.SOLUTION_NOT_EXISTS)
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: no solution, no solutions found: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", checkIfUniqueSolution, example: no solution, no solutions found: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 14:
                s        = new SudokuSolver(SudokuPuzzles.PUZZLE_NO_SOLUTION);
                sol      = s.solve();
                solution = s.getSolvedBoard();
                if (s.getSolvingState() == ErrorCodes.SUDOKUSOLVER_SOLVE_SOLVING_FAILED)
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: no solution, solving failed: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: no solution, solving failed: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 15:
                s            = new SudokuSolver(SudokuPuzzles.PUZZLE_ERROR);
                solvingState = s.solve();
                boardState   = s.getBoardState();
                if ((boardState == SudokuBoard.BOARD_STATE_ERROR) && (solvingState == ErrorCodes.SUDOKUSOLVER_SOLVE_SOLVING_NOT_STARTED))
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: board with error, board state error and solving not started: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: board with error, board state error and solving not started: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 16:
                s   = new SudokuSolver(SudokuPuzzles.PUZZLE_REGTESTS);
                sol = s.solve();
                ErrorCodes.consolePrintlnIfError(sol);
                if (SudokuStore.boardsAreEqual(s.getSolvedBoard(), SudokuPuzzles.PUZZLE_REGTESTS_SOLUTION))
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: with solution, solutions are equal: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: with solution, solutions are equal: NO, time: " + s.getComputingTime() + " s.");
                }
                break;

            case 17:
                s      = new SudokuSolver(SudokuPuzzles.PUZZLE_EMPTY);
                sol    = s.solve();
                solUnq = s.checkIfUniqueSolution();
                ErrorCodes.consolePrintlnIfError(sol);
                ErrorCodes.consolePrintlnIfError(solUnq);
                if ((SudokuStore.checkSolvedBoard(s.getSolvedBoard()) == true) & (solUnq == SudokuSolver.SOLUTION_NON_UNIQUE))
                {
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: empty puzzle, found solution and solution non unique: YES, time: " + s.getComputingTime() + " s.");
                }
                else
                {
                    testResult = false;
                    SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + ", solve, example: empty puzzle, found solution and solution non unique: NO, time: " + s.getComputingTime() + " s.");
                }
                break;
            }
            if (testResult == true)
            {
                SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + " >>>>>>>>>>>>>>>>>>>>>> SudokuSolver, result: OK");
            }
            else
            {
                SudokuStore.consolePrintln("(Thread: " + threadId + ") " + "Test: " + testId + " >>>>>>>>>>>>>>>>>>>>>> SudokuSolver, result: ERROR");
            }
            return(testResult);
        }
Ejemplo n.º 49
0
        private void ShowError(ErrorCodes code, Exception ex, bool showLast = false)
        {
            if (transitionControl.CurrentPage != _errorPage)
            {
                if(showLast && _lastError != ErrorCodes.SUCCESS)
                {
                    ShowErrorPage(_lastError, _lastException);
                }
                else if (code != ErrorCodes.SUCCESS && ex != null)
                {
                    if(Errors.IsHardFail(code))
                    {
                        ShowErrorPage(code, ex);
                    }
                    else
                    {
                        _lastError = code;
                        _lastException = ex;
                        mainBar.ShowError(Errors.GetErrorMessage(code));

                        if (transitionControl.CurrentPage == _loadingPage && !_lastFMAuth)
                        {
                            _loginPage.LoginFailed = true;
                            transitionControl.ShowPage(_loginPage);
                        }
                    }
                }
            }
        }
Ejemplo n.º 50
0
 public ApiException(string message, ErrorCodes errorCode = ErrorCodes.General) : base(message)
 {
     ErrorCode = errorCode;
 }
Ejemplo n.º 51
0
 private void _errorPage_ErrorClose(bool hardFail)
 {
     if (hardFail || _prevPage == null)
         Close();
     else
     {
         _lastError = ErrorCodes.SUCCESS;
         _lastException = null;
         RestorePrevPage();
         _showingError = false;
     }
 }
Ejemplo n.º 52
0
 public BusinessException(ErrorCodes errorCode, string message) : base(message)
 {
     ErrorCode = errorCode;
 }
Ejemplo n.º 53
0
 private void _player_ExceptionEvent(object sender, ErrorCodes code, Exception ex)
 {
     ShowError(code, ex);
 }
Ejemplo n.º 54
0
 internal static bool CanRetry(ErrorCodes errorCode)
 {
     return(_canRetryMap[errorCode]);
 }
Ejemplo n.º 55
0
 //==================================================================
 /// <summary>
 /// Clears the error code - typically used for staring scans
 /// </summary>
 //==================================================================
 internal void ClearError()
 {
     m_errorCode = ErrorCodes.NoErrors;
 }
Ejemplo n.º 56
0
        public static string GiveErrorMessage(ErrorCodes _ErrCode)
        {
            string rv_ErrorMessage = string.Empty;

            switch (_ErrCode)
            {
            case ErrorCodes.AgBaglantisiYok:
                rv_ErrorMessage = string.Format(
                    "Ağ bağlantısı yok. Lütfen ağ bağlantı ayarlarını kontrol edin.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.AgBaglantisiYok).ToString("X4"));
                break;

            case ErrorCodes.VeritabaninaUlasilamiyor:
                rv_ErrorMessage = string.Format(
                    "Veritabanına ulaşılamıyor! Lütfen veritabanı ayarlarınızı kontrol edin ve veritabanı hizmetinin çalışır durumda olduğundan emin olun.{0}Hata Kodu: {1}",
                    Environment.NewLine, "0x" + ((int)ErrorCodes.VeritabaninaUlasilamiyor).ToString("X4"));
                break;

            case ErrorCodes.ComPortKullanimda:
                rv_ErrorMessage = string.Format(
                    "Erişilmeye çalışılan Com Port kullanımda! Lütfen ilgili numaralı Com Port'u kullanan programı kapatarak tekrar deneyin.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.ComPortKullanimda).ToString("X4"));
                break;

            case ErrorCodes.ComPortGenelHata:
                rv_ErrorMessage = string.Format(
                    "Erişilmeye çalışılan Com Port bilgisayar üzerinde bulunmuyor! Lütfen ilgili numaralı Com Port'u kontrol edin.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.ComPortGenelHata).ToString("X4"));
                break;

            case ErrorCodes.QPUUlasilamazDurumda:
                rv_ErrorMessage = string.Format(
                    "Server programı QPU açık değil veya ulaşılmaz durumda! Lütfen QPU'nun çalışıp çalışmadığını, ağ bağlantı ayarlarınızı ve güvenlik duvarı ayarlarınızı kontrol edin.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.QPUUlasilamazDurumda).ToString("X4"));
                break;

            case ErrorCodes.KioskIDHatali:
                rv_ErrorMessage = string.Format(
                    "Kiosk ID değeri hatalı yapılandırılmış! Lütfen Kiosk ID değerini düzeltiniz.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.KioskIDHatali).ToString("X4"));
                break;

            case ErrorCodes.KioskAyariYok:
                rv_ErrorMessage = string.Format(
                    "Kioska ait ayarlar yapılandırılmamış! Lütfen QCU üzerinden kioska ait ayarları yapın. Kiosk programı şimdi kapatılacak.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.KioskAyariYok).ToString("X4"));
                break;

            case ErrorCodes.AnaDisplayUlasilamazDurumda:
                rv_ErrorMessage = string.Format(
                    "Ana Display sistemde mevcut değil! Lütfen kayıt değerlerini ve ana displayin sistemde bulunup bulunmadığını kontrol ediniz.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.AnaDisplayUlasilamazDurumda).ToString("X4"));
                break;

            case ErrorCodes.BiletMakinesiUlasilamazDurumda:
                rv_ErrorMessage = string.Format(
                    "Bilet makinesi sistemde mevcut değil! Lütfen kayıt değerlerini ve bilet makinesinin sistemde bulunup bulunmadığını kontrol ediniz.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.BiletMakinesiUlasilamazDurumda).ToString("X4"));
                break;

            case ErrorCodes.ElTerminaliUlasilamazDurumda:
                rv_ErrorMessage = string.Format(
                    "El terminal cihazı sistemde mevcut değil! Lütfen kayıt değerlerini ve el terminal cihazının sistemde bulunup bulunmadığını kontrol ediniz.{0}Hata Kodu: {1}",
                    Environment.NewLine, ((int)ErrorCodes.ElTerminaliUlasilamazDurumda).ToString("X4"));
                break;

            default:
                rv_ErrorMessage = "Beklenmeyen hata meydana geldi! Hata Kodu: 0x0000";
                break;
            }

            return(rv_ErrorMessage);
        }
Ejemplo n.º 57
0
 //==================================================================
 /// <summary>
 /// Clears the error code - typically used for staring scans
 /// </summary>
 //==================================================================
 internal void ClearOutputScanError()
 {
     m_outputScanErrorCode = ErrorCodes.NoErrors;
 }
Ejemplo n.º 58
0
 protected BaseException(int errorCode, Exception inner, params object[] parameters) : base(string.Format(ErrorCodes.GetMessageByCodeWithCode(errorCode)), inner)
 {
     ErrorCode  = errorCode;
     Parameters = parameters;
 }
Ejemplo n.º 59
0
 //===========================================================================================
 /// <summary>
 /// generates a response based on any errors that occur in one of the Preprocess data methods
 /// </summary>
 /// <param name="errorCode">The error code that was set in the Preprocess data method</param>
 /// <param name="originalResponse">The response before calling the Preprocess data method</param>
 /// <returns>The response</returns>
 //===========================================================================================
 internal virtual string GetPreprocessDataErrorResponse(ErrorCodes errorCode, string originalResponse)
 {
     return originalResponse;
 }
Ejemplo n.º 60
0
 public IdentityException(string error, ErrorCodes errorCode)
     : base(error, errorCode)
 {
 }