This commit is contained in:
@@ -343,7 +343,7 @@ namespace AyaNova
|
||||
context.Request.HttpContext.Items["AY_USER_ID"] = u.id;
|
||||
context.Request.HttpContext.Items["AY_LOCALE_ID"] = u.localeId;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
await next.Invoke();
|
||||
@@ -405,7 +405,8 @@ namespace AyaNova
|
||||
if (TESTING_REFRESH_DB)
|
||||
{
|
||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _log);
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet);
|
||||
//Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet);
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.LargeCorporateMultiRegionalTrialDataSet);
|
||||
}
|
||||
//TESTING
|
||||
#endif
|
||||
|
||||
@@ -241,6 +241,7 @@ namespace AyaNova.Util
|
||||
|
||||
public async static void GenSeedUser(ILogger log, int count, AuthorizationRoles roles, UserType userType, bool active = true, string login = null, string password = null)
|
||||
{
|
||||
log.LogInformation($"Seeding {count.ToString()} user(s)");
|
||||
UserBiz Biz = UserBiz.GetBizInternal(ServiceProviderProvider.DBContext);
|
||||
//allow creation of not entirely ready users (missing client id or subcontractor vendor id etc)
|
||||
Biz.SeedOrImportRelaxedRulesMode = true;
|
||||
@@ -281,7 +282,7 @@ namespace AyaNova.Util
|
||||
throw new System.Exception("Seeder::GenSeedUser error creating user\r\n" + Biz.GetErrorsAsString());
|
||||
}
|
||||
}
|
||||
|
||||
log.LogInformation("User seeding completed");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
@@ -289,6 +290,7 @@ namespace AyaNova.Util
|
||||
//
|
||||
public static async void GenSeedWidget(ILogger log, int count)
|
||||
{
|
||||
log.LogInformation($"Seeding {count.ToString()} Widget(s)");
|
||||
//get a context just for this op to save memory on changetracking
|
||||
//AyContext ct = ServiceProviderProvider.DBContext;
|
||||
WidgetBiz Biz = WidgetBiz.GetBizInternal(ServiceProviderProvider.DBContext);
|
||||
@@ -296,7 +298,7 @@ namespace AyaNova.Util
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
Widget o = new Widget();
|
||||
o.Name = f.Commerce.ProductName();
|
||||
o.Name = f.Commerce.ProductName() + x.ToString();
|
||||
o.Active = true;
|
||||
o.StartDate = f.Date.Between(DateTime.Now, DateTime.Now.AddMinutes(60));
|
||||
o.EndDate = f.Date.Between(DateTime.Now.AddMinutes(90), DateTime.Now.AddHours(5));
|
||||
@@ -312,6 +314,7 @@ namespace AyaNova.Util
|
||||
throw new System.Exception("Seeder::GenSeedWidget error creating widget\r\n" + Biz.GetErrorsAsString());
|
||||
}
|
||||
}
|
||||
log.LogInformation("Widget seeding completed");
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
Reference in New Issue
Block a user