Beispiel #1
0
        public bool Equals(ErrorType toCompare)
        {
            if (id == toCompare.id)
                return true;

            return false;
        }
Beispiel #2
0
        public bool addType( List<ErrorType> errorTypes )
        {
            if (errorType != null) return true;

            foreach (ErrorType aErrorType in errorTypes)
            {
                if (aErrorType.Equals(this))
                {
                    errorType = aErrorType;
                    return true;
                }
            }

            return false;
        }
Beispiel #3
0
        private bool getErrorTypes( List<ErrorType> toExpand )
        {
            int maxID= 0;

            foreach( ErrorType errorType in toExpand )
                if( errorType.getID() > maxID )
                    maxID = errorType.getID();

            StringBuilder htmlOutput = new StringBuilder("");

            DB db = new DB();
            db.setOutput(htmlOutput);

            db.getErrors(maxID);

            ErrorTypesReturn jsonReturn = JsonConvert.DeserializeObject<ErrorTypesReturn>(htmlOutput.ToString());

            if( jsonReturn.status.status.ToLower() != "success" ) return false;

            for (int i = 0; i < jsonReturn.maxI; i++){
                ErrorType tempErrorType = new ErrorType(jsonReturn.errors[i]);
                if (!toExpand.Contains(tempErrorType))
                    toExpand.Add(tempErrorType);
            }

            return true;
        }