|
@@ -2,6 +2,7 @@
|
|
|
using System.Reflection;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using InABox.Core;
|
|
|
+using NPOI.POIFS.FileSystem;
|
|
|
|
|
|
namespace InABox.Database
|
|
|
{
|
|
@@ -502,9 +503,7 @@ namespace InABox.Database
|
|
|
|
|
|
protected virtual void BeforeSave(T entity)
|
|
|
{
|
|
|
- // Process any AutoIncrement Fields before we apply the Unique Code test
|
|
|
- // Thus, if we have a unique autoincrement, it will be populated prior to validation
|
|
|
- CheckAutoIncrement(entity);
|
|
|
+
|
|
|
|
|
|
// Check for (a) blank code fields and (b) duplicate codes
|
|
|
// There may be more than one code on an entity (why would you do this?)
|
|
@@ -570,6 +569,9 @@ namespace InABox.Database
|
|
|
var changes = entity.ChangedValues();
|
|
|
|
|
|
//UpdateInternalLinks(entity);
|
|
|
+ // Process any AutoIncrement Fields before we apply the Unique Code test
|
|
|
+ // Thus, if we have a unique autoincrement, it will be populated prior to validation
|
|
|
+ CheckAutoIncrement(entity);
|
|
|
|
|
|
BeforeSave(entity);
|
|
|
|
|
@@ -674,6 +676,9 @@ namespace InABox.Database
|
|
|
|
|
|
//try
|
|
|
//{
|
|
|
+ // Process any AutoIncrement Fields before we apply the Unique Code test
|
|
|
+ // Thus, if we have a unique autoincrement, it will be populated prior to validation
|
|
|
+ CheckAutoIncrement(entities.ToArray());
|
|
|
|
|
|
var changes = new Dictionary<T, string>();
|
|
|
foreach (var entity in entities)
|