R
Ricardo Marques
Hello, I'm trying to do a simple Project Server API evaluation, my purpuse is
to import my company holidays from a XML file and update the project server
enterprise calendar.
But my problem, starts with reading the calendar exceptions.. here's my very
simple code:
PSLibrary.Filter filter = new PSLibrary.Filter();
CalendarDataSet dsCalendars = new
WebSvcCalendar.CalendarDataSet();
filter.FilterTableName = dsCalendars.Calendars.TableName;
filter.Fields.Add(new PSLibrary.Filter.Field(
filter.FilterTableName,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
PSLibrary.Filter.SortOrderTypeEnum.Asc));
filter.Criteria = new PSLibrary.Filter.FieldOperator(
PSLibrary.Filter.FieldOperationType.Equal,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
"Padrão");
dsCalendars = wsCal.ReadCalendars(filter.GetXml(), false);
foreach (CalendarDataSet.CalendarsRow calRow in
dsCalendars.Calendars.Rows)
{
Console.Out.WriteLine(calRow.CAL_NAME + " (" +
calRow.CAL_UID.ToString() + ")");
if (calRow.GetCalendarExceptionsRows().Length > 0)
{
Console.Out.WriteLine("Exceptions:");
foreach (CalendarDataSet.CalendarExceptionsRow
calException in calRow.GetCalendarExceptionsRows())
{
Console.Out.WriteLine(calException.Name);
}
}
}
Problem here is that GetCalendarExceptionsRows returns me an empty array,
and it's weird because i have 100% sure that are exceptions on the calendar,
i can see them on project professional.
I think the way I'm using to access the data may not be the correct one, but
haven't found many docs about it.
PS: I've tried the ListCalendars() and the result is the same.
to import my company holidays from a XML file and update the project server
enterprise calendar.
But my problem, starts with reading the calendar exceptions.. here's my very
simple code:
PSLibrary.Filter filter = new PSLibrary.Filter();
CalendarDataSet dsCalendars = new
WebSvcCalendar.CalendarDataSet();
filter.FilterTableName = dsCalendars.Calendars.TableName;
filter.Fields.Add(new PSLibrary.Filter.Field(
filter.FilterTableName,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
PSLibrary.Filter.SortOrderTypeEnum.Asc));
filter.Criteria = new PSLibrary.Filter.FieldOperator(
PSLibrary.Filter.FieldOperationType.Equal,
dsCalendars.Calendars.CAL_NAMEColumn.ColumnName,
"Padrão");
dsCalendars = wsCal.ReadCalendars(filter.GetXml(), false);
foreach (CalendarDataSet.CalendarsRow calRow in
dsCalendars.Calendars.Rows)
{
Console.Out.WriteLine(calRow.CAL_NAME + " (" +
calRow.CAL_UID.ToString() + ")");
if (calRow.GetCalendarExceptionsRows().Length > 0)
{
Console.Out.WriteLine("Exceptions:");
foreach (CalendarDataSet.CalendarExceptionsRow
calException in calRow.GetCalendarExceptionsRows())
{
Console.Out.WriteLine(calException.Name);
}
}
}
Problem here is that GetCalendarExceptionsRows returns me an empty array,
and it's weird because i have 100% sure that are exceptions on the calendar,
i can see them on project professional.
I think the way I'm using to access the data may not be the correct one, but
haven't found many docs about it.
PS: I've tried the ListCalendars() and the result is the same.