This commit is contained in:
2018-08-28 20:12:51 +00:00
parent ecb6b3d7c6
commit 5cd914767d
17 changed files with 62 additions and 53 deletions

View File

@@ -119,6 +119,7 @@ namespace AyaNova.Util
//2000 widgets
GenSeedWidget(2000, ct);
//GenSeedWidget(100, ct);
break;
//this is a large corporation with multiple branches in multiple locations all in the same country
@@ -257,14 +258,13 @@ namespace AyaNova.Util
//
public static void GenSeedWidget(int count, AyContext ct)
{
var s="blah";
for (int x = 0; x < count; x++)
{
Widget o = new Widget();
var f = new Bogus.Faker();
o.Name = f.Commerce.ProductName();
o.Active = f.Random.Bool();
o.StartDate = f.Date.Between(DateTime.Now, DateTime.Now.AddMinutes(60));
o.EndDate = f.Date.Between(DateTime.Now.AddMinutes(90), DateTime.Now.AddHours(5));
@@ -273,9 +273,13 @@ namespace AyaNova.Util
//this is nonsense but just to test an enum
o.Roles = AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited;
ct.Widget.Add(o);
ct.SaveChanges();
EventLogProcessor.AddEntry(new Event(o.OwnerId, o.Id, AyaType.Widget, AyaEvent.Created), ct);
// ct.SaveChanges();
//Log
EventLogProcessor.AddEntryNoSave(new Event(o.OwnerId, o.Id, AyaType.Widget, AyaEvent.Created), ct);
}
ct.SaveChanges();
var v=s;
}