// Get the GUID for a Project Server account name. public static Guid GetResourceUid(String accountName) { Guid resourceUid = Guid.Empty; ResourceDataSet resourceDs = new ResourceDataSet(); // Filter for the account name, which can be a // Windows account or Project Server account. PSLib.Filter filter = new PSLib.Filter(); filter.FilterTableName = resourceDs.Resources.TableName; PSLib.Filter.Field accountField = new PSLib.Filter.Field( resourceDs.Resources.TableName, resourceDs.Resources.WRES_ACCOUNTColumn.ColumnName); filter.Fields.Add(accountField); PSLib.Filter.FieldOperator op = new PSLib.Filter.FieldOperator( PSLib.Filter.FieldOperationType.Equal, resourceDs.Resources.WRES_ACCOUNTColumn.ColumnName, accountName); filter.Criteria = op; string filterXml = filter.GetXml(); resourceDs = resourceClient.ReadResources(filterXml, false); // Return the account GUID. if (resourceDs.Resources.Rows.Count > 0) resourceUid = (Guid)resourceDs.Resources.Rows[0]["RES_UID"]; return resourceUid; }
public static ResourceDataSet GetResources() { Console.WriteLine("Get all Resources called"); if (_resourceList == null) _resourceList = resourceClient.ReadUserList(ResourceActiveFilter.All); Console.WriteLine("Get all Resources done successfully"); return _resourceList; }
public ReadResourceListByDepartmentResponse(ResourceDataSet ReadResourceListByDepartmentResult) { this.ReadResourceListByDepartmentResult = ReadResourceListByDepartmentResult; }