This commit is contained in:
2020-06-25 23:00:06 +00:00
parent 8af5e44231
commit 8ebab2de70

View File

@@ -131,16 +131,19 @@ namespace AyaNova.Biz
{
Translation t = new Translation();
t.Name = (string)o["Name"];
string newUniqueName = string.Empty;
var proposedName = (string)o["Name"];
string newUniqueName = proposedName;
bool NotUnique = true;
long l = 1;
do
{
newUniqueName = Util.StringUtil.UniqueNameBuilder(t.Name, l++, 255);
NotUnique = await ct.Translation.AnyAsync(z => z.Name == newUniqueName);
if (NotUnique)
newUniqueName = Util.StringUtil.UniqueNameBuilder(proposedName, l++, 255);
} while (NotUnique);
t.Name = newUniqueName;
t.CjkIndex = (bool)o["CjkIndex"];
t.Stock = false;