This commit is contained in:
2018-09-04 17:00:16 +00:00
parent f1ce2baa63
commit a15e02db54
10 changed files with 70 additions and 16 deletions

View File

@@ -28,6 +28,7 @@ namespace AyaNova.Biz
//get a db and logger
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("PrimeData");
User u = new User();
u.Active=true;
u.Name = "AyaNova Administrator";
u.Salt = Hasher.GenerateSalt();
u.Login = "manager";

View File

@@ -70,8 +70,8 @@ namespace AyaNova.Biz
inObj = System.Text.RegularExpressions.Regex.Replace(inObj, "-+", "-");
//Ensure doesn't start or end with a dash
inObj = inObj.Trim('-');
//No longer than 35 characters
inObj = StringUtil.MaxLength(inObj, 35);
//No longer than 255 characters
inObj = StringUtil.MaxLength(inObj, 255);
return inObj;
}
@@ -212,9 +212,9 @@ namespace AyaNova.Biz
if (string.IsNullOrWhiteSpace(inObj))
AddError(ValidationErrorType.RequiredPropertyEmpty, "Name");
//Name must be less than 35 characters
if (inObj.Length > 35)
AddError(ValidationErrorType.LengthExceeded, "Name", "35 char max");
//Name must be less than 255 characters
if (inObj.Length > 255)
AddError(ValidationErrorType.LengthExceeded, "Name", "255 char max");
//Name must be unique
if (ct.Tag.Where(m => m.Name == inObj).FirstOrDefault() != null)

View File

@@ -147,9 +147,9 @@ namespace AyaNova.Biz
// if (string.IsNullOrWhiteSpace(inObj))
// AddError(ValidationErrorType.RequiredPropertyEmpty, "Name");
// //Name must be less than 35 characters
// if (inObj.Length > 35)
// AddError(ValidationErrorType.LengthExceeded, "Name", "35 char max");
// //Name must be less than 255 characters
// if (inObj.Length > 255)
// AddError(ValidationErrorType.LengthExceeded, "Name", "255 char max");
return;
}