This commit is contained in:
2023-01-09 02:03:14 +00:00
parent 146d17a865
commit 37b0cfa54d
6 changed files with 43 additions and 33 deletions

View File

@@ -50,8 +50,6 @@ namespace Sockeye.Biz
{
await GenerateKey(newObject);
if (HasErrors) return null;
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
await ct.License.AddAsync(newObject);
await ct.SaveChangesAsync();
@@ -487,22 +485,24 @@ namespace Sockeye.Biz
internal async Task GenerateKey(License l)
{
if(l.CustomerId!=null){
l.CustomerViz=await ct.Customer.AsNoTracking().Where(x => x.Id == l.CustomerId).Select(x => x.Name).FirstOrDefaultAsync();
if (l.CustomerId != null)
{
l.CustomerViz = await ct.Customer.AsNoTracking().Where(x => x.Id == l.CustomerId).Select(x => x.Name).FirstOrDefaultAsync();
}
switch(l.PGroup){
case ProductGroup.RavenPerpetual:
switch (l.PGroup)
{
case ProductGroup.RavenPerpetual:
case ProductGroup.RavenSubscription:
{
RavenKeyFactory.GenerateAndSetRavenKey(l);
}
break;
{
RavenKeyFactory.GenerateAndSetRavenKey(l);
}
break;
case ProductGroup.AyaNova7:
{
KeyFactory.GenerateAndSetV7Key(l);
}
break;
{
KeyFactory.GenerateAndSetV7Key(l);
}
break;
}
}