// GET: UserManage
        public ActionResult Index()
        {
            List<UserManageModels> user = new List<UserManageModels>();

            foreach (var item in db.Users.ToList())
            {
                UserManageModels manage = new UserManageModels();
                manage.User = item;
                var rolename = UserManager.GetRoles(item.Id).FirstOrDefault();
                if (rolename != null)
                {
                    manage.Roles = RoleManager.FindByName(rolename);
                }
                user.Add(manage);
            }
            return View(user);
        }
        public async Task<ActionResult> Delete(string id)
        {
            if (id == null)
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            UserManageModels manage = new UserManageModels();
            manage.User = await UserManager.FindByIdAsync(id);
            var rolename = UserManager.GetRoles(id).FirstOrDefault();
            if (rolename != null)
            {
                var roleofuser = RoleManager.FindByName(rolename);
                manage.Roles = roleofuser;
            }

            if (manage == null)
            {
                return HttpNotFound();
            }
            return View(manage);
        }
        public async Task<ActionResult> Edit(UserManageModels manage)
        {
            if (ModelState.IsValid)
            {
                ApplicationUser appuser = UserManager.FindById(manage.User.Id);
                appuser.UserName = manage.User.UserName;
                //appuser.Roles = manage.User.Roles;
                await UserManager.UpdateAsync(appuser);

                await UserManager.RemoveFromRoleAsync(manage.User.Id, "Employee");
                await UserManager.RemoveFromRoleAsync(manage.User.Id, "Admin");
                await UserManager.AddToRoleAsync(manage.User.Id, manage.Roles.Name);
                return RedirectToAction("Index");
            }
            return View(manage);
        }