public ProfileRepo() { ctx = new IntegratieDbContext(); }
public ProfileRepo(UnitOfWork uow) { ctx = uow.Context; }
public SubplatformRepo(IntegratieDbContext context) { ctx = context; }
public SubplatformRepo(UnitOfWork uow) { ctx = uow.Context; }
public ItemRepo(UnitOfWork uow) { ctx = uow.Context; }
public SubplatformRepo() { ctx = new IntegratieDbContext(); }
public ItemRepo() { ctx = new IntegratieDbContext(); }
public RecordRepo(UnitOfWork uow) { ctx = uow.Context; }
public DashboardRepo() { ctx = new IntegratieDbContext(); }
public DashboardRepo(UnitOfWork uow) { ctx = uow.Context; }
public AlertRepo(UnitOfWork uow) { ctx = uow.Context; }
public AlertRepo() { ctx = new IntegratieDbContext(); }
public SubplatformManager(IntegratieDbContext context) { SubplatformRepo = new SubplatformRepo(context); }
private void CreateRolesandUsers() { IntegratieDbContext context = store.ReadContext(); var roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(context)); var userManager = new UserManager <Profile>(new UserStore <Profile>(context)); if (!roleManager.RoleExists("SuperAdmin")) { //Create SuperAdmin role var role = new IdentityRole { Name = "SuperAdmin" }; roleManager.Create(role); } //Create Admin role if (!roleManager.RoleExists("Admin")) { var role = new IdentityRole { Name = "Admin" }; roleManager.Create(role); } //Create User role if (!roleManager.RoleExists("User")) { var role = new IdentityRole { Name = "User" }; roleManager.Create(role); } List <Subplatform> subplatforms = context.Subplatforms.Include(s => s.Admins).ToList(); // Create superadmin if (userManager.Users.FirstOrDefault(p => p.UserName.Equals("captain")) is null) { var user = new Profile { UserName = "******", Email = "*****@*****.**", ProfileIcon = @"~/Content/Images/Users/user.png", CreatedOn = DateTime.Now, AdminPlatforms = subplatforms }; user.UserData = new UserData { Profile = user }; user.Settings = new List <UserSetting> { new UserSetting { Profile = user, IsEnabled = true, SettingName = Setting.Account.THEME, Value = "Light", boolValue = false }, new UserSetting { Profile = user, IsEnabled = true, SettingName = Setting.Account.WANTS_ANDROID_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user, IsEnabled = true, SettingName = Setting.Account.WANTS_SITE_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user, IsEnabled = true, SettingName = Setting.Account.WANTS_EMAIL_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user, IsEnabled = true, SettingName = Setting.Account.WANTS_WEEKLY_REVIEW_VIA_MAIL, Value = null, //moet nog boolean worden boolValue = true } }; user.AdminPlatforms.ForEach(s => { if (!s.Admins.Contains(user)) { s.Admins.Add(user); } }); var result = userManager.Create(user, "FliesAway"); if (result.Succeeded) { userManager.AddToRole(user.Id, "SuperAdmin"); } } if (userManager.Users.FirstOrDefault(p => p.UserName.Equals("admin")) is null) { var user2 = new Profile { UserName = "******", Email = "*****@*****.**", ProfileIcon = @"~/Content/Images/Users/user.png", CreatedOn = DateTime.Now, AdminPlatforms = new List <Subplatform>() { subplatforms.FirstOrDefault(s => s.URL.ToLower().Equals("politieke-barometer")) } }; user2.UserData = new UserData { Profile = user2 }; user2.Settings = new List <UserSetting> { new UserSetting { Profile = user2, IsEnabled = true, SettingName = Setting.Account.THEME, Value = "Light", boolValue = false }, new UserSetting { Profile = user2, IsEnabled = true, SettingName = Setting.Account.WANTS_ANDROID_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user2, IsEnabled = true, SettingName = Setting.Account.WANTS_SITE_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user2, IsEnabled = true, SettingName = Setting.Account.WANTS_EMAIL_NOTIFICATIONS, Value = null, //moet nog boolean worden boolValue = true }, new UserSetting { Profile = user2, IsEnabled = true, SettingName = Setting.Account.WANTS_WEEKLY_REVIEW_VIA_MAIL, Value = null, //moet nog boolean worden boolValue = true } }; user2.AdminPlatforms.ForEach(s => { if (!s.Admins.Contains(user2)) { s.Admins.Add(user2); } }); var result = userManager.Create(user2, "Disney2018"); if (result.Succeeded) { userManager.AddToRole(user2.Id, "Admin"); } } }
public ItemRepo(IntegratieDbContext context) { ctx = context; }
public ItemManager(IntegratieDbContext context) { ItemRepo = new ItemRepo(context); }
public RecordRepo() { ctx = new IntegratieDbContext(); }