del método Resource.ReadResourceAvailabilityForGrid
Este miembro está reservado para uso interno y no debe usarse directamente desde el código. Devuelve un conjunto de datos de disponibilidad de los recursos en una estructura de datos de fase temporal para la Control de cuadrícula JS.
Espacio de nombres: WebSvcResource
Ensamblado: ProjectServerServices (en ProjectServerServices.dll)
Sintaxis
'Declaración
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Resource/ReadResourceAvailabilityForGrid", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Resource/", _
ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Resource/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function ReadResourceAvailabilityForGrid ( _
resUIDs As Guid(), _
startDate As DateTime, _
endDate As DateTime, _
timeScale As Short, _
includeProposedBookings As Boolean _
) As DataSet
'Uso
Dim instance As Resource
Dim resUIDs As Guid()
Dim startDate As DateTime
Dim endDate As DateTime
Dim timeScale As Short
Dim includeProposedBookings As Boolean
Dim returnValue As DataSet
returnValue = instance.ReadResourceAvailabilityForGrid(resUIDs, _
startDate, endDate, timeScale, includeProposedBookings)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Resource/ReadResourceAvailabilityForGrid", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Resource/",
ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Resource/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public DataSet ReadResourceAvailabilityForGrid(
Guid[] resUIDs,
DateTime startDate,
DateTime endDate,
short timeScale,
bool includeProposedBookings
)
Parámetros
resUIDs
Tipo: []Una matriz de los GUID del recurso.
startDate
Tipo: System.DateTimePrincipio del período.
endDate
Tipo: System.DateTimeFinal del período.
timeScale
Tipo: System.Int16Escala deseada de la tabla TimephasedData , en la enumeración TimeScaleClass.TimeScale .
includeProposedBookings
Tipo: System.BooleanIncluir las asignaciones para la que el recurso está programado sólo provisionalmente.
Valor devuelto
Tipo: System.Data.DataSet
Conjunto de datos con una tabla de fechas y una tabla de datos de fase temporal.
Comentarios
El método ReadResourceAvailabilityForGrid se usa internamente con el Control de cuadrícula JS. Para obtener los datos de disponibilidad de recursos, utilice el método ReadResourceAvailability .
Permisos de Project Server
Permiso |
Descripción |
---|---|
Permite al usuario ver los datos de asignación de recursos. Permiso global. |
Ejemplos
The example uses the SvcResource namespace in the ProjectServerServices.dll proxy assembly. The ConfigClientEndpoints method uses an app.config file for setting the WCF binding, behavior, and endpoint. For information about creating a PSI proxy assembly and an app.config file, see Prerequisites for WCF-Based Code Samples.
El método ReadResourceAvailabilityForGrid devuelve el conjunto de datos resourceGridDS. El contenido del conjunto de datos se escribe en ResourceAvailabilityGrid.xml. A continuación se muestra un ejemplo de la estructura TimephasedData desde el resultado real:
Nota
El método ReadResourceAvailabilityForGrid es similar al método ReadResourceAvailability , excepto el método ReadResourceAvailabilityForGrid no devuelva el GUID de recurso o GUID del proyecto en el DataSet. ReadResourceAvailabilityForGrid sólo se utiliza en Project Web App para mostrar los datos en la cuadrícula JS
<TimephasedData>
<AssignmentUID>2ba3b898-3fa7-421b-8643-56f0088e7cae</AssignmentUID>
<ProjectName>Capacity</ProjectName>
<ResourceName>Fourth Coffee </ResourceName>
<RowType>0</RowType>
<Interval0>72000</Interval0>
<Interval1>96000</Interval1>
<Interval2>110400</Interval2>
<Interval3>105600</Interval3>
<Interval4>100800</Interval4>
<Interval5>19200</Interval5>
</TimephasedData>
El código de ejemplo completo se muestra a continuación:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.ServiceModel;
using PSLibrary = Microsoft.Office.Project.Server.Library;
namespace Microsoft.SDK.Project.Samples.Resources
{
class Resources
{
private static SvcResource.ResourceClient resourceClient;
private const string RES_ENDPOINT = "basicHttp_Resource";
private const string OUTPUT_FILES = @"C:\Projects\Samples\Output\";
private static string outFilePathResourcesAvailabilityGrid;
private static string outFilePathResourceAvailability;
static void Main(string[] args)
{
Guid[] resourceID = new Guid[2];
resourceID[0] = new Guid("2a4ba1a7-1d96-4086-8fa5-6dea243ed6b5");
resourceID[1] = new Guid("f6c846fa-b21b-49eb-9921-fe6bdec60242");
DateTime startDate = new DateTime(2010, 1, 10);
DateTime finishDate = new DateTime(2010, 6, 6);
// Configure the end points.
ConfigClientEndpoints(RES_ENDPOINT);
// If directory does not exist,create it.
if (!Directory.Exists(OUTPUT_FILES))
{
Directory.CreateDirectory(OUTPUT_FILES);
}
// Assign the path where the output XML file will be saved.
outFilePathResourcesAvailabilityGrid = OUTPUT_FILES + "ResourcesAvailabilityGrid.xml";
outFilePathResourceAvailability = OUTPUT_FILES + "ResourceAvailability.xml";
// Read the resource availability.
System.Data.DataSet resourceGridDS = resourceClient.ReadResourceAvailabilityForGrid(
resourceID, startDate, finishDate, (short)PSLibrary.Resource.TimeScale.Months, true);
// Write the contents of the DataSet to an XML file.
resourceGridDS.WriteXml(outFilePathResourcesAvailabilityGrid);
Console.WriteLine("\nSee XML output of the DataSet at {0}",
outFilePathResourcesAvailabilityGrid);
// Read the resource availability for grid.
System.Data.DataSet resourceDS = resourceClient.ReadResourceAvailability(
resourceID, startDate, finishDate, (short)PSLibrary.Resource.TimeScale.Months, true);
// Write the DataSet contents to an XML file.
resourceDS.WriteXml(outFilePathResourceAvailability);
Console.WriteLine("\nSee XML output of Resource Dataset at {0}",
outFilePathResourceAvailability);
Console.ReadKey();
}
// Configure the custom field client end points.
public static void ConfigClientEndpoints(string endpt)
{
resourceClient = new SvcResource.ResourceClient(endpt);
}
}
}