Exemple #1
0
        public string GetErrorMessage(EnumErrorCodes errorCode)
        {
            switch (errorCode)
            {
            case EnumErrorCodes.FatalError:
                return("An unknown error has occurred.");

            case EnumErrorCodes.DocumentScannerNull:
                return("There is no avaiable scanner.");

            case EnumErrorCodes.UnknownError:
                return("An unknown error has occurred.");

            case EnumErrorCodes.FingerprintNull:
                return("fingerprint_Template can not be null.");

            case EnumErrorCodes.SmartCardReaderNull:
                return("SmartCardReader is not connected.");

            case EnumErrorCodes.UserNameNull:
                return("UserName can not be null.");

            case EnumErrorCodes.NRICNull:
                return("NRIC can not be null.");

            default:
                break;
            }
            return("Unknown error.");
        }
Exemple #2
0
 public ErrorResponse(object id, string message, EnumErrorCodes code, IEnumerable <string> errors)
 {
     Code    = code;
     Message = message;
     Id      = id ?? Guid.NewGuid();
     Errors  = errors ?? new List <string>();
 }
Exemple #3
0
 public bool Suspend()
 {
     errorCode = EnumErrorCodes.NO_ERROR;
     if (scheduler == null)
     {
         MessageBox.Show("Can Not Suspend a suspended or non-existent scheduler");
         return(false);
     }
     if (!scheduler.Suspend())
     {
         MessageBox.Show("An error occurred while suspending the scheduler");
         return(false);
     }
     return(true);
 }
Exemple #4
0
 /// <summary>
 /// This function is called to start the operating system
 /// </summary>
 /// <returns> whether any errors occurred during execution</returns>
 public bool Start()
 {
     errorCode = EnumErrorCodes.NO_ERROR;
     if (scheduler == null)
     {
         SchedulerFlags?flags = CreateSchedulerFlags();
         if (flags == null)
         {
             MessageBox.Show("Could not start scheduler invalid flags");
             return(false);
         }
         scheduler = new Scheduler(flags.Value);
     }
     SetClockSpeed();
     if (!scheduler.Start())
     {
         MessageBox.Show("An error occurred while running the scheduler");
         return(false);
     }
     return(true);
 }
 private void ThrowError(EnumErrorCodes errorCode, string errorMessage)
 {
     MessageBox.Show("Compile Error: " + errorCode.ToString() + " " + errorMessage);
 }
Exemple #6
0
 /// <summary>
 /// This function creates an error message to display
 /// in a message box to the user indicating what type
 /// of error occurred
 /// </summary>
 /// <param name="enumErrorCodes"> the error code that identifies the error</param>
 /// <param name="expectedToken"> the expected token</param>
 private void ThrowError(EnumErrorCodes enumErrorCodes, string expectedToken)
 {
     error = "Error: " + enumErrorCodes + " " + expectedToken;
 }
Exemple #7
0
 public ErrorInfo(EnumErrorCodes errorCode)
 {
     _errorCode = errorCode;
 }
Exemple #8
0
 public ErrorResponse(object id, string message, EnumErrorCodes code)
     : this(id, message, code, errors : null)
 {
 }
Exemple #9
0
 public ErrorResponse(string message, EnumErrorCodes code)
     : this(id : null, message, code, errors : null)
 {
 }