Click or drag to resize

ProjectOperationsAdvanceCalendar Method (AdvanceCalendarServiceArguments)

Run the Advance Calendar.

Namespace:  Cobra.WebService.ClientAPI.Application.Files
Assembly:  Cobra.WebService.ClientAPI (in Cobra.WebService.ClientAPI.dll) Version: 8.4.717.3176 (8.4.0717.3176)
Syntax
C#
public ServiceResult AdvanceCalendar(
	AdvanceCalendarServiceArguments advanceCalendarServiceArguments
)

Parameters

advanceCalendarServiceArguments
Type: Cobra.Model.WebServiceAdvanceCalendarServiceArguments
An instance of AdvanceCalendarServiceArguments class that contains the options to run the Advance Calendar.

Return Value

Type: ServiceResult
The result of running Advance Calendar.
Exceptions
ExceptionCondition
InvalidOperationExceptionThrown when state of the instance of the CobraServices that generated the current ProjectOperations is not in opened state.
Examples
This sample shows how to run the Advance Calendar.
C#
using Cobra.Model.WebService;
using Cobra.WebService.ClientAPI;
using Cobra.WebService.ClientAPI.Application.Files;
using Cobra.WebService.ClientAPI.Client;
using AdvanceCalendarServiceArguments = Cobra.Model.WebService.AdvanceCalendarServiceArguments;

.
.
.

CobraServices cobraServices = new CobraServices();
cobraServices.ServiceIdentityData.Username = "SYSADMIN";
cobraServices.ServiceIdentityData.SecurePassword = new SecurePassword();
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('P');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('A');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('S');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('W');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('O');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('R');
cobraServices.ServiceIdentityData.SecurePassword.AppendChar('D');
cobraServices.ServiceIdentityData.DataSourceKey = "COBRA";

LoginResult loginResult = cobraServices.Login();
if (!loginResult.Success) {
    Console.WriteLine("Login failed.");
    return;
}

Console.WriteLine("Login Success.");

ProjectOperations projectOperations = cobraServices.CreateServiceOperations<ProjectOperations>();
AdvanceCalendarServiceArguments advanceCalendarServiceArguments = projectOperations.CreateProjectOperationsServiceArguments<AdvanceCalendarServiceArguments>();
advanceCalendarServiceArguments.Project = "Demo Advanced";
advanceCalendarServiceArguments.UseStatusDateAsActualStartDateForLoE = true;
advanceCalendarServiceArguments.IncludeForecastInUpdateTotals = false;
advanceCalendarServiceArguments.Log.LogComment = "Advance Calendar";
advanceCalendarServiceArguments.Log.ChangeNumber = "1";
advanceCalendarServiceArguments.Log.Significant = false;

Console.WriteLine("Running Advance Calendar...");
ServiceResult advanceCalendarResult = projectOperations.AdvanceCalendar(advanceCalendarServiceArguments);
if (advanceCalendarResult.Success)
    Console.WriteLine("Advance Calendar process completed successfully.");
else
    Console.WriteLine("Advance Calendar process did not completed successfully.");

cobraServices.Logout();
See Also