diff --git a/Project-Unite/Controllers/AdminController.cs b/Project-Unite/Controllers/AdminController.cs index 9ec9a81..c5d54a7 100644 --- a/Project-Unite/Controllers/AdminController.cs +++ b/Project-Unite/Controllers/AdminController.cs @@ -40,6 +40,8 @@ public ActionResult AddUserToRole(string id) Text = converted.Name, Value = converted.Name }); + if (converted.Id == id) + model.RoleId = converted.Name; } model.Users = new List(); foreach(var u in db.Users.OrderBy(x => x.DisplayName).ToArray()) @@ -50,7 +52,7 @@ public ActionResult AddUserToRole(string id) Value = u.Id }); } - model.RoleId = id; + model.Username = db.Users.First().Id; return View(model); }