public void enableAccount(ApplicationUser entity) { var userManager = new MujZavod.Data.Identity.ApplicationUserManager( new Microsoft.AspNet.Identity.EntityFramework.UserStore <MujZavod.Data.Identity.ApplicationUser>(Context)); userManager.SetLockoutEnabled(entity.Id, false); }
public override void Remove(ApplicationUser entity, bool saveChanges) { var userManager = new MujZavod.Data.Identity.ApplicationUserManager( new Microsoft.AspNet.Identity.EntityFramework.UserStore <MujZavod.Data.Identity.ApplicationUser>(Context)); /* * userManager.SetLockoutEnabled(entity.Id, true); * userManager.SetLockoutEndDate(entity.Id, new DateTime(3000, 1, 1)); */ userManager.Delete(entity); }
public void Create(ApplicationUser entity, string[] roles) { var userManager = new MujZavod.Data.Identity.ApplicationUserManager( new Microsoft.AspNet.Identity.EntityFramework.UserStore <MujZavod.Data.Identity.ApplicationUser>(Context)); var result = userManager.Create(entity); result = userManager.SetLockoutEnabled(entity.Id, false); var rolesForUser = userManager.GetRoles(entity.Id); foreach (string role in roles) { if (!rolesForUser.Contains(role)) { var res = userManager.AddToRole(entity.Id, role); } } }