/// <summary> /// Gets all the Roles from SDK and sets them in the String Role Array /// </summary> /// <returns>String Role Array</returns> public override string[] GetAllRoles() { string[] roles = new string[500]; int count = 0; Account account = new Account(); account.GetAllAdminGroups(); foreach (ClientPersonnelAdminGroups groups in account.AdminGroup) { roles[count] = groups.GroupName.ToString(); count++; } return roles; }
public ActionResult Register(Account user) { if (ModelState.IsValid) { if (user.Register()) { ModelState.Clear(); try { user.LoginResultDetails.User = new AquariumUserManagement.User(); user.GetAllTitles(); user.GetAllClientOffices(); user.GetAllAdminGroups(); } catch (Exception ex) { throw ex; } } } return View(user); }
public ActionResult Register() { Account user = new Account(); try { user.GetAllTitles(); user.GetAllClientOffices(); user.GetAllAdminGroups(); } catch (Exception ex) { throw ex; } return View(user); }
/// <summary> /// Search User in Role and return the RoleName. Used to compare User with Role /// </summary> /// <param name="username">The username to search</param> /// <returns>RoleName(s)</returns> public override string[] GetRolesForUser(string username) { int count = 0; LoggedOnUserResult user = SDKHelper.GetUserSession<AquariumUserManagement.LoggedOnUserResult>("User"); Account account = new Account(); account.GetAllAdminGroups(); List<ClientPersonnelAdminGroups> roles = account.AdminGroup.FindAll(delegate(ClientPersonnelAdminGroups adrole) { if (adrole.ClientPersonnelAdminGroupID == user.User.ClientPersonnelAdminGroupID) { return true; } else { return false; } }); string[] roleslist = new string[roles.Count]; foreach (ClientPersonnelAdminGroups groups in roles) { roleslist[count] = groups.GroupName; } return roleslist; }