-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
340 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
Rdmp.Core/CatalogueAnalysisTools/Data/SecondaryConstraint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using Rdmp.Core.Curation.Data; | ||
using Rdmp.Core.MapsDirectlyToDatabaseTable; | ||
using Rdmp.Core.Repositories; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data; | ||
using System.Data.Common; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static Rdmp.Core.CatalogueAnalysisTools.Data.PrimaryContraint; | ||
|
||
namespace Rdmp.Core.CatalogueAnalysisTools.Data | ||
{ | ||
public class SecondaryConstraint: DatabaseEntity | ||
{ | ||
public enum Constraints | ||
{ | ||
BOUND, | ||
BOUNDDATE, | ||
NOTNULL, | ||
PREDICTION, | ||
REFERENTIALINTEGRITYCONSTRAINT, | ||
REGULAREXPRESSION | ||
} | ||
|
||
public enum Consequences | ||
{ | ||
WRONG, | ||
MISSING, | ||
INVALIDATESROW | ||
} | ||
|
||
private DQERepository _DQERepository { get; set; } | ||
private ColumnInfo _columnInfo; | ||
private Constraints _constraint; | ||
private Consequences _consequence; | ||
private SecondaryConstraintArgument[] _arguments; | ||
|
||
public ColumnInfo ColumnInfo { get => _columnInfo; private set => SetField(ref _columnInfo, value); } | ||
public Consequences Consequence { get => _consequence; set => SetField(ref _consequence, value); } | ||
public Constraints Constraint{ get => _constraint; set => SetField(ref _constraint, value); } | ||
|
||
public SecondaryConstraintArgument[] Arguments { get => _arguments; set => SetField(ref _arguments, value); } | ||
|
||
public SecondaryConstraint() { } | ||
|
||
public SecondaryConstraint(DQERepository repository, DbDataReader r) : base(repository, r) | ||
{ | ||
_DQERepository = repository; | ||
_columnInfo = _DQERepository.CatalogueRepository.GetObjectByID<ColumnInfo>(int.Parse(r["ColumnInfo_ID"].ToString())); | ||
_constraint = (Constraints)int.Parse(r["Constraint"].ToString()); | ||
_consequence = (Consequences)int.Parse(r["Consequence"].ToString()); | ||
_arguments = _DQERepository.GetAllObjectsWhere<SecondaryConstraintArgument>("SecondaryConstraint_ID", int.Parse(r["ID"].ToString())); | ||
} | ||
|
||
public SecondaryConstraint(DQERepository repository, ColumnInfo columnInfo, Constraints constraint, Consequences consequence) { | ||
_DQERepository = repository; | ||
_columnInfo = columnInfo; | ||
_consequence = consequence; | ||
_constraint = constraint; | ||
_DQERepository.InsertAndHydrate(this, new Dictionary<string, object> | ||
{ | ||
{ "ColumnInfo_ID", columnInfo.ID }, | ||
{ "Constraint", (int)constraint}, | ||
{ "Consequence", (int)consequence} | ||
}); | ||
|
||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
Rdmp.Core/CatalogueAnalysisTools/Data/SecondaryConstraintArgument.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Rdmp.Core.Curation.Data; | ||
using Rdmp.Core.Repositories; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Data.Common; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Rdmp.Core.CatalogueAnalysisTools.Data | ||
{ | ||
public class SecondaryConstraintArgument: DatabaseEntity | ||
{ | ||
|
||
private string _key; | ||
private string _value; | ||
private DQERepository _repository; | ||
private SecondaryConstraint _constraint; | ||
|
||
public string Key { get => _key; set => SetField(ref _key, value); } | ||
public string Value { get => _value; set => SetField(ref _value, value); } | ||
public SecondaryConstraint Constraint { get => _constraint; private set => SetField(ref _constraint, value); } | ||
|
||
public SecondaryConstraintArgument(DQERepository repository, DbDataReader r): base(repository, r) | ||
{ | ||
_repository = repository; | ||
_key = r["Key"].ToString(); | ||
_value = r["Value"].ToString(); | ||
_constraint = _repository.GetObjectByID<SecondaryConstraint>(int.Parse(r["SecondaryConstraint_ID"].ToString())); | ||
} | ||
|
||
public SecondaryConstraintArgument(DQERepository repository, string key, string value, SecondaryConstraint constraint) | ||
{ | ||
_repository = repository; | ||
_key = key; | ||
_value = value; | ||
_constraint = constraint; | ||
|
||
_repository.InsertAndHydrate(this, new Dictionary<string, object> | ||
{ | ||
{"Key",key }, | ||
{"Value",value }, | ||
{"SecondaryConstraint_ID",constraint.ID } | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 125 additions & 6 deletions
131
Rdmp.UI/CatalogueAnalysisUIs/CatalogueAnalysisExecutionControlUI.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.