Tasks 184281, 184799, 184800, 184801 and 184802
Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
This commit is contained in:
@ -1,48 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.DirectoryServices.AccountManagement;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
using Fab2ApprovalSystem.Models;
|
||||
|
||||
namespace Fab2ApprovalSystem.Utilities
|
||||
{
|
||||
public class UserUtilities
|
||||
{
|
||||
public List<AllUserModel> GetMesaUsers()
|
||||
{
|
||||
PrincipalContext ctx = new PrincipalContext(ContextType.Domain,
|
||||
"infineon.com",
|
||||
"DC=infineon,DC=com",
|
||||
"MESfisharepoint",
|
||||
"GaN2020=BestWafers!");
|
||||
namespace Fab2ApprovalSystem.Utilities;
|
||||
|
||||
GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx,
|
||||
IdentityType.Name,
|
||||
"MES-IFX-Employees-Mesa");
|
||||
List<AllUserModel> MesaUsers = new List<AllUserModel>();
|
||||
if (grp != null)
|
||||
{
|
||||
foreach (Principal p in grp.GetMembers(true))
|
||||
{
|
||||
MesaUsers.Add(new AllUserModel
|
||||
{
|
||||
UserName = p.Name,
|
||||
DisplayName = p.DisplayName
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
//Console.WriteLine(p.Name);
|
||||
}
|
||||
grp.Dispose();
|
||||
public class UserUtilities {
|
||||
|
||||
public static List<AllUserModel> GetMesaUsers() {
|
||||
PrincipalContext ctx = new(ContextType.Domain,
|
||||
"infineon.com",
|
||||
"DC=infineon,DC=com",
|
||||
"MESfisharepoint",
|
||||
"GaN2020=BestWafers!");
|
||||
|
||||
GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx,
|
||||
IdentityType.Name,
|
||||
"MES-IFX-Employees-Mesa");
|
||||
List<AllUserModel> MesaUsers = new();
|
||||
if (grp != null) {
|
||||
foreach (Principal p in grp.GetMembers(true)) {
|
||||
MesaUsers.Add(new AllUserModel {
|
||||
UserName = p.Name,
|
||||
DisplayName = p.DisplayName
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
ctx.Dispose();
|
||||
MesaUsers = (from a in MesaUsers orderby a.DisplayName ascending select a).ToList();
|
||||
|
||||
return MesaUsers;
|
||||
grp.Dispose();
|
||||
}
|
||||
|
||||
ctx.Dispose();
|
||||
MesaUsers = (from a in MesaUsers orderby a.DisplayName ascending select a).ToList();
|
||||
|
||||
return MesaUsers;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user