Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. ResourceWs.ResourceDataSet resDs = this.PsiInterfaces.PsiResourceService.ReadUserList(ResourceActiveFilter.Active);
  2. ResourceWs.ResourceDataSet.ResourcesRow[] resRow =
  3. (ResourceWs.ResourceDataSet.ResourcesRow[])resDs.Resources.Select(resFilter);
  4.  
  5. if (resRow.Length >= 1)
  6. {
  7. Debug.Assert(resRow.Length == 1, "The resource row must be one only");
  8.  
  9. Log.Instance.Verbose(
  10. string.Format(
  11. "ReadResourceName. RES_UID: '{0}' -> WRES_ACCOUNT: '{1}', RES_NAME: '{2}' (exit)",
  12. resRow[0].RES_UID,
  13. resRow[0].WRES_ACCOUNT,
  14. resRow[0].RES_NAME),
  15. LoggingAreaCategory.EpmAdapter);
  16.  
  17. if (resNameFmt == ResourceNameType.AccountName)
  18. {
  19. return resRow[0].WRES_ACCOUNT;
  20. }
  21. else
  22. {
  23. return resRow[0].RES_NAME;
  24. }
  25. }
  26. else
  27. {
  28. string msg = string.Format("ReadResourceName. Cannot identify resource Uid: '{0}'", resUid);
  29.  
  30. Log.Instance.Warning(
  31. msg,
  32. LoggingAreaCategory.EpmAdapter,
  33. EventID.IdentifyResourceFailure);
  34.  
  35. throw new ArgumentException(msg, "resUid");
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement