public JsonResult GetUserRole() { UserRoleManager userRoleManager = new UserRoleManager(); var result = userRoleManager.GetUserRoles(); return(Json(result, JsonRequestBehavior.AllowGet)); }
private async void Page_Loading(FrameworkElement sender, object args) { UserRoleLoadingProessRing.IsActive = true; UserRoleLoadingProessRing.Visibility = Visibility.Visible; await UserRoleManager.GetUserRoles(UserRoles); UserRoleLoadingProessRing.IsActive = false; UserRoleLoadingProessRing.Visibility = Visibility.Collapsed; }
private async void Page_Loading(FrameworkElement sender, object args) { UserRoleLoadingProessRing.IsActive = true; UserRoleLoadingProessRing.Visibility = Visibility.Visible; var obj = App.Current as App; //AccessToken = obj.AccessToken; UserRoleManager.http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", obj.AccessToken); await UserRoleManager.GetUserRoles(UserRoles); UserRoleLoadingProessRing.IsActive = false; UserRoleLoadingProessRing.Visibility = Visibility.Collapsed; }
public string GetUserRole(string userAccount) { try { DataSet userRoles = manager.GetUserRoles(userAccount); if (userRoles.Tables[0].Rows.Count > 0) { return(userRoles.Tables[0].Rows[0]["RoleName"].ToString()); } else { return(string.Empty); } } catch (Exception ex) { throw ex; } }
public void GetUserRoles() { byte[] password = ASCIIEncoding.ASCII.GetBytes("password"); manager.CreateRole(roleName); manager.CreateRole(roleName + "2"); manager.CreateUser("user1", password); manager.CreateUserRole("user1", roleName); manager.CreateUserRole("user1", roleName + "2"); try { DataSet ds = manager.GetUserRoles("user1"); Assert.AreEqual(2, ds.Tables[0].Rows.Count); } finally { manager.DeleteUserRole("user1", roleName); manager.DeleteUserRole("user1", roleName + "2"); manager.DeleteUser("user1"); manager.DeleteRole(roleName); manager.DeleteRole(roleName + "2"); } }
private void GetUserRolesDelegate(params object[] methodParams) { manager.GetUserRoles((string)methodParams[0]); }