本文整理匯總了C#中Catalog.GetEmployee方法的典型用法代碼示例。如果您正苦於以下問題:C# Catalog.GetEmployee方法的具體用法?C# Catalog.GetEmployee怎麽用?C# Catalog.GetEmployee使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Catalog
的用法示例。
在下文中一共展示了Catalog.GetEmployee方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: LookupInternal
public static LPHSUser LookupInternal(string ntid)
{
using (new LogScope("LPHSUser.LookupInternal"))
{
try
{
SouthernIdentity ident = null;
Authenticator.AppLogin(ref ident);
using (Catalog cat = new Catalog(ident.SecurityToken))
{
using (var employee = cat.GetEmployee(ntid, Catalog.ValueType.cecNTID))
{
if (employee == null)
{
throw new Exception(string.Format("Employee '{0}' not found.", ntid.ToUpper()));
}
else
{
return new LPHSUser
{
Name = employee.GetValue("EMPNET_ID"),
EmailAddress = employee.GetValue("EMAIL_ADDR"),
Sid = employee.GetValue("USER_SID"),
DisplayName = employee.GetValue("EMP_NAME").Replace(",", ", ")
};
}
}
}
}
catch (Exception ex)
{
Log.Write(ex, Log.Mask.Failure);
return null;
}
}
}