public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //ApplicationUser applicationUser = db.ApplicationUsers.Find(id);
            userManager = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>();
            ApplicationUser appUser = userManager.FindById(id);

            if (appUser == null)
            {
                return(HttpNotFound());
            }

            var roleMgr    = new LogicLayer.ERoleManager();
            var allRoles   = roleMgr.RetrieveAllERoles();
            var allRoleIds = new List <string>();

            foreach (var role1 in allRoles)
            {
                allRoleIds.Add(role1.ERoleID);
            }

            var roles   = userManager.GetRoles(id);
            var noRoles = allRoleIds.Except(roles);

            ViewBag.Roles   = roles;
            ViewBag.NoRoles = noRoles;

            return(View(appUser));
        }
        /// <summary>
        /// Updater: Zach Behrensmeyer
        /// Updated: 4/21/2020
        /// Update: Added Identity System Logic
        /// </summary>
        /// <param name="context"></param>
        protected override void Seed(WPFPresentation.Models.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method
            //  to avoid creating duplicate seed data.

            var userStore   = new UserStore <ApplicationUser>(context);
            var userManager = new UserManager <ApplicationUser>(userStore);

            const string admin         = "*****@*****.**";
            const string adminPassword = "******";

            LogicLayer.UserManager  usermgr = new LogicLayer.UserManager();
            LogicLayer.ERoleManager rolemgr = new LogicLayer.ERoleManager();
            var           roles             = rolemgr.RetrieveAllERoles();
            List <string> RoleNames         = new List <string>();

            foreach (var role in roles)
            {
                RoleNames.Add(role.ERoleID);
            }

            foreach (var role in RoleNames)
            {
                context.Roles.AddOrUpdate(r => r.Name, new IdentityRole()
                {
                    Name = role
                });
            }
            if (!RoleNames.Contains("Administrator"))
            {
                context.Roles.AddOrUpdate(r => r.Name, new IdentityRole()
                {
                    Name = "Administrator"
                });
            }

            if (!context.Users.Any(u => u.UserName == admin))
            {
                var user = new ApplicationUser()
                {
                    UserName   = admin,
                    Email      = admin,
                    GivenName  = "PUAdmin",
                    FamilyName = "Company"
                };

                IdentityResult result = userManager.Create(user, adminPassword);
                context.SaveChanges();

                if (result.Succeeded)
                {
                    userManager.AddToRole(user.Id, "Administrator");
                    context.SaveChanges();
                }
            }
        }