public override ValidationResult Validate() { ValidationResult result = base.Validate(); result.AddErrorIf(DataSource == default(IDataSource), "Please select a Data Source", nameof(DataSource)); result.AddErrorIf(ValueField == default(DataTableField), "Please select a Value Field", nameof(ValueField)); result.AddErrorIf(LookupCriteria == default(BindingList <LookupCriteria>) || LookupCriteria.Count == 0, "Please add at least one Selection Criteria", nameof(LookupCriteria)); return(result); }
/// <summary> /// Validates the Connection. /// </summary> /// <returns>The ValidationResult.</returns> public virtual ValidationResult Validate() { ValidationResult result = new ValidationResult(); try { result.AddErrorIf(Parent == default(Project), Properties.Resources.ConnectionValidateParentProject, nameof(Parent)); } catch (Exception ex) { result.AddErrorIf(true, ex.Message); } return(result); }
public override ScottLane.DataTidy.Core.ValidationResult Validate() { ScottLane.DataTidy.Core.ValidationResult result = base.Validate(); result.AddErrorIf(Solution == default(Dynamics365Solution), "Please select a Solution", nameof(Solution)); result.AddErrorIf(NamingConvention == default(NamingConventionType), "Please select a Naming Convention", nameof(NamingConvention)); if (NamingConvention != default(NamingConventionType)) { result.AddErrorIf(NamingConvention == NamingConventionType.Custom && string.IsNullOrEmpty(OutputPath), "Please specify the Output Path", nameof(OutputPath)); result.AddErrorIf(NamingConvention != NamingConventionType.Custom && string.IsNullOrEmpty(OutputDirectory), "Please specify the Output Directory", nameof(OutputDirectory)); } return(result); }
public override ValidationResult Validate() { ValidationResult result = new ValidationResult(); try { result.AddErrorIf(DataSource == default(IDataSource), "Please select a Data Source", nameof(DataSource)); } catch (Exception ex) { result.AddErrorIf(true, ex.Message); } return(result); }
/// <summary> /// Validates the class properties. /// </summary> /// <returns>The ValidationResult.</returns> public override ValidationResult Validate() { ValidationResult result = base.Validate(); result.AddErrorIf(SourceField == default(DataTableField), "Please select a Source Field", nameof(SourceField)); return(result); }
/// <summary> /// Validates the field value properties. /// </summary> /// <returns>The validation result.</returns> public virtual ValidationResult Validate() { ValidationResult result = new ValidationResult(); result.AddErrorIf(DestinationField == default(Field), "Please select a Destination Field", nameof(DestinationField)); return(result); }
/// <summary> /// Validates the data source. /// </summary> public override ValidationResult Validate() { ValidationResult result = new ValidationResult(); try { result.AddErrorIf(DataSource == default(IDataSource), Properties.Resources.DuplicateDataSourceValidateDataSource, nameof(DataSource)); result.AddErrorIf(keyFields.Count == 0, Properties.Resources.DuplicateDataSourceValidateKeyFields, nameof(KeyFields)); } catch (Exception ex) { result.AddErrorIf(true, ex.Message); } return(result); }
/// <summary> /// Validates the data source. /// </summary> public override ValidationResult Validate() { ValidationResult result = new ValidationResult(); try { result.AddErrorIf(SourceData == default(IDataSource), Properties.Resources.ComparisonDataSourceValidateSourceData, nameof(SourceData)); result.AddErrorIf(ComparisonData == default(IDataSource), Properties.Resources.ComparisonDataSourceValidateComparisonData); result.AddErrorIf(KeyMappings.Count == 0, Properties.Resources.ComparisonDataSourceValidateKeyMappings); } catch (Exception ex) { result.AddErrorIf(true, ex.Message); } return(result); }
/// <summary> /// Validates the DataSource. /// </summary> /// <returns>The ValidationResult.</returns> public virtual ValidationResult Validate() { ValidationResult result = new ValidationResult(); try { result.AddErrorIf(Parent == default(IConnection), Properties.Resources.DataSourceValidateParentConnection, nameof(Parent)); if (Parent != default(IConnection)) { result.Errors.AddRange(Parent.Validate().Errors); } } catch (Exception ex) { result.AddErrorIf(true, ex.Message); } return(result); }
/// <summary> /// Validates the project and all child Batch objects. /// </summary> /// <returns>The ValidationResult.</returns> public ValidationResult Validate() { ValidationResult projectResult = new ValidationResult(); projectResult.AddErrorIf(Batches.Count == 0, "There are no batches in the project"); foreach (Batch batch in Batches) { ValidationResult batchResult = batch.Validate(); projectResult.Errors.AddRange(batchResult.Errors); } return(projectResult); }
/// <summary> /// Validates the Batch. /// </summary> /// <returns>True if the Batch is valid, false otherwise.</returns> public ValidationResult Validate() { ValidationResult batchResult = new ValidationResult(); batchResult.AddErrorIf(Operations.Count == 0, Properties.Resources.BatchValidateNoOperations); foreach (IOperation operation in Operations) { ValidationResult operationResult = operation.Validate(); batchResult.Errors.AddRange(operationResult.Errors); } return(batchResult); }