This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user