UpdateProject
ProjectServerManager.UpdateProject method (1 of 2)
Updates existing project in Project Server\Project Online instance using default save options. The existing project will be overwritten.
public void UpdateProject(Project project)
Parameter | Type | Description |
---|---|---|
project | Project | The project to save to Project Server\Project Online instance. |
Exceptions
exception | condition |
---|---|
ProjectOnlineException | In case of communication error or error returned by a server. |
Remarks
Project’s property ‘project.Get(Prj.Guid)’ should be a valid guid of a project which exists in Project Server account \ Project Online instance.
Examples
In this example the project is loaded from Project Online account, modified and saved back to Project Online account.
[C#]
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project);
See Also
- class Project
- class ProjectServerManager
- namespace Aspose.Tasks
- assembly Aspose.Tasks
ProjectServerManager.UpdateProject method (2 of 2)
Updates existing project in Project Server\Project Online instance using the specified save options. The existing project will be overwritten.
public void UpdateProject(Project project, ProjectServerSaveOptions saveOptions)
Parameter | Type | Description |
---|---|---|
project | Project | The project to save to Project Server\Project Online instance. |
saveOptions | ProjectServerSaveOptions | Instance of ProjectServerSaveOptions class. |
Exceptions
exception | condition |
---|---|
ProjectOnlineException | In case of communication error or error returned by a server. |
Remarks
saveOptions.ProjectGuid should be set to a guid of a project which exists on Project Server\ Project Online instance.
Examples
In this example the project is loaded from Project Online account, modified and saved back to Project Online account.
[C#]
var credentials = new ProjectServerCredentials("https://xxxxxx.sharepoint.com", "yyyyy@xxxxxxx.onmicrosoft.com", "password");
ProjectServerManager manager = new ProjectServerManager(credentials);
var projectList = manager.GetProjectList();
var projectGuid = projectList.First().Id;
var project = manager.GetProject(projectGuid);
var task = project.RootTask.Children.Add("New task");
manager.UpdateProject(project, new ProjectServerSaveOptions
{
ProjectGuid = projectGuid
});
See Also
- class Project
- class ProjectServerSaveOptions
- class ProjectServerManager
- namespace Aspose.Tasks
- assembly Aspose.Tasks