/// <summary> /// Runs validation rules on each sheet and updates the Errors collection /// on each sheet. /// </summary> ///<param name="errorRowIdx">excel sheet = ErrorRowIndexBase.RowTwo, datasets = ErrorRowIndexBase.RowOne </param> public void Validate(ErrorRowIndexBase errorRowIdx, ICOBieValidationTemplate ValidationTemplate = null, Action <int> progressCallback = null) //default for excel row index's on error rows { // Enumerates the sheets and validates each foreach (var sheet in this) { if (sheet.SheetName != Constants.WORKSHEET_PICKLISTS) //skip validation on pick list { if (ValidationTemplate != null) { sheet.Validate(this, errorRowIdx, ValidationTemplate.Sheet[sheet.SheetName]); } else { sheet.Validate(this, errorRowIdx, null); } } // Progress bar support if (progressCallback != null) { // Call-back with the index of the last processed sheet progressCallback(this.IndexOf(sheet)); } } }
/// <summary> /// Validate the sheet /// </summary> /// <param name="workbook"></param> public void Validate(COBieWorkbook workbook, ErrorRowIndexBase errorRowIdx, ICOBieSheetValidationTemplate SheetValidator) { _errorRowIdx = errorRowIdx; //set the index for error reporting on rows _errors.Clear(); ValidatePrimaryKeysUnique(SheetValidator); ValidateFields(SheetValidator); ValidateForeignKeys(workbook, SheetValidator); }
/// <summary> /// Constructor /// </summary> /// <param name="progressHandler">Report Delegate</param> public FederateCOBie(ReportProgressDelegate progressHandler = null) { if (progressHandler != null) { _progress = progressHandler; this.ProgressStatus += progressHandler; } cOBieProgress = new COBieProgress(this); ErrorRowStartIndex = ErrorRowIndexBase.RowTwo; //default for excel sheet }
public COBieContext() { RunDate = DateTime.Now.ToString(Constants.DATE_FORMAT); RunDateTime = DateTime.Now.ToString(Constants.DATETIME_FORMAT); EMails = new Dictionary <long, string>(); Model = null; //if no IfcZones or no IfcSpace property names of "ZoneName" then if DepartmentsUsedAsZones is true we will list //any IfcSpace property names "Department" in the Zone sheet and remove the "Department" property from the attribute sheet DepartmentsUsedAsZones = false; Exclude = new FilterValues(); ExcludeFromPickList = false; //set the row index to report error rows on ErrorRowStartIndex = ErrorRowIndexBase.RowTwo; //default for excel sheet MapMergeRoles = new Dictionary <XbimModel, COBieMergeRoles>(); }
public COBieContext() { RunDate = DateTime.Now.ToString(Constants.DATE_FORMAT); RunDateTime = DateTime.Now.ToString(Constants.DATETIME_FORMAT); RunDateManuallySet = false; EMails = new Dictionary<long, string>(); Model = null; //if no IfcZones or no IfcSpace property names of "ZoneName" then if DepartmentsUsedAsZones is true we will list //any IfcSpace property names "Department" in the Zone sheet and remove the "Department" property from the attribute sheet DepartmentsUsedAsZones = false; Exclude = new FilterValues(); ExcludeFromPickList = false; //set the row index to report error rows on ErrorRowStartIndex = ErrorRowIndexBase.RowTwo; //default for excel sheet MapMergeRoles = new Dictionary<XbimModel, COBieMergeRoles>(); }