public QAException(QAError error, string operationalDSName, string status) { if (error == null) throw new ArgumentNullException("error", "Cannot pass null QAError to QAException"); if (error.Error == null) throw new ArgumentException("The QAError passed to QAException has no data associated with it", "error"); if (error.Error.Location == null) throw new ArgumentException("The QAError passed to QAException has no location associated with it", "error"); if (status.Equals(DataQualityError.STATUS_EXCEPTION) == false && status.Equals(DataQualityError.STATUS_DEFERRED) == false) throw new ArgumentException("A QAException can only be created with a status of'"+DataQualityError.STATUS_EXCEPTION+"' or '"+DataQualityError.STATUS_DEFERRED+"'", "error"); this._attachment = error.Error.ExtendedData; this._description = error.Error.Description; this._latitude = error.Latitude; this._longitude = error.Longitude; this._operationDSName = operationalDSName; this._status = status; this._testName = error.Error.ErrorType; this._location = error.Error.Location; }
public void StoreError(QAError error) { try { IFeature theFeature = this.StorageFeatureClass.GetFeature(error.ObjectID); this.WriteToFeature(error.Error, theFeature, error.OperationalDatasetName); } catch (Exception ex) { throw new ErrorStorageException("Error raised when storing error in personal geodatabase", ex); } }
private dao.QAError ReadFromFeature(IFeature feature) { int idx; idx = feature.Fields.FindField("QA_TEST_NAME"); string theType = (string)feature.get_Value(idx); idx = feature.Fields.FindField("CAN_DEFER"); bool canDefer = feature.get_Value(idx).ToString().Equals("YES"); idx = feature.Fields.FindField("CAN_EXCEPT"); bool canExcept = feature.get_Value(idx).ToString().Equals("YES"); DataQualityError theDQError = new DataQualityError(theType, canDefer, canExcept); // Shape theDQError.Location = (IPoint)feature.ShapeCopy; // Attributes idx = feature.Fields.FindField("ATTACHMENT"); theDQError.ExtendedData = (string)feature.get_Value(idx); idx = feature.Fields.FindField("DESCRIPTION"); theDQError.Description = (string)feature.get_Value(idx); idx = feature.Fields.FindField("DATA_EXCEPTION_STATUS"); theDQError.Status = (string)feature.get_Value(idx); idx = feature.Fields.FindField("SEVERITY"); theDQError.Severity = (int)feature.get_Value(idx); idx = feature.Fields.FindField("OPERATIONAL_DATASET_NAME"); string operDSName = (string)feature.get_Value(idx); dao.QAError theError = new QAError(feature.OID, theDQError, operDSName); return theError; }
internal void AddException(QAError error, string exceptionalStatus) { QAException theNewException = new QAException(error, this._operationalDSName, exceptionalStatus); theNewException.Store(this._exceptionFC); bool bStored = false; for (int i = 0; i < this._exceptions.Length; i++) { if (this._exceptions[i] == null) { this._exceptions[i] = theNewException; bStored = true; break; } } // Need to grow the array if (!bStored) { QAException[] theNewArray = new QAException[this._exceptions.Length + 10]; for (int j = 0; j < this._exceptions.Length; j++) theNewArray[j] = this._exceptions[j]; theNewArray[this._exceptions.Length] = theNewException; this._exceptions = theNewArray; } }