PublicAPI.Projects.ProjectELMA API Documentation
Project
Access path: PublicAPI.Projects.Project
Methods

  NameDescription
Public methodAddUserToProject
Add a user to the list of project participants, if the user is not added yet
Public methodChangeProjectManager(Project, User)
Change the project manager
Public methodChangeProjectManager(Project, User, String)
Change the project manager
Public methodChangeProjectStage
Change the project stage
Public methodCloseProject(Project)
Close project (send to archive)
Public methodCloseProject(Project, WorkflowInstance)
Close project (send to archive)
Public methodCount 
Returns the total number of objects of this type
Public methodCount(IEntityFilter)
Get Total Number of Objects by Filter
Public methodCreate 
Create New Entity (without a Database entry)
Public methodCreate(ProjectMetadataHead)Obsolete.
Create a new project by its type settings. Entity is not saved to the database! Only general information is copied from the template: project name, start date, end date, manager.
Public methodCreate(String, ProjectMetadataHead, DateTime, DateTime, User)
Create a project. Entity is saved to the database
Public methodCreate(String, ProjectMetadataHead, DateTime, DateTime, User, Folder)
Create a project. Entity is saved to the database
Public methodCreatePhase(Project, String)
Create a new project phase
Public methodCreatePhase(Project, String, String)
Create a new project phase
Public methodCreatePhase(Project, String, String, Int64)
Create a new project phase
Public methodCreateProjectObsolete.
Create a project
Public methodCreateProjectPhase(ProjectMetadataHead, String)Obsolete.
Create a new phase in the project budget. Creates an object, without saving in the database
Public methodCreateProjectPhase(ProjectMetadataHead, String, String)Obsolete.
Create a new phase in the project budget. Creates an object, without saving in the database
Public methodDelete
Delete Object
Public methodFilter
Creates an assistant for working with the "Base Project Type" object filter
Public methodFind(FetchOptions)
Find objects according to fetch options
Public methodFind(String)
Find objects according to the filter in the EQL language
Public methodFind(IEntityFilter, FetchOptions)
Fing objects according to fetch options and filter
Public methodFindByIdArray
Find All Objects by Array IDs
Public methodGetDraftProjectPlans
Get all the project plan drafts. If there are none, returns the clone of the current published plan
Public methodIsDirty
Check, if there are unsaved changes in the object
Public methodIsNew
Check, if the object is new (not saved in the database)
Public methodLoad(Guid)
Load by UID. If not found, an exception is invoked
Public methodLoad(Int64)
Load by ID. If not found, an exception is invoked
Public methodLoadOrCreate(Guid)
Load by ID. If not found, the new object is returned
Public methodLoadOrCreate(Int64)
Load by ID. If not found, the new object is returned
Public methodLoadOrNull(Guid)
Load by UID. If not found, null is returned
Public methodLoadOrNull(Int64)
Load by ID. If not found, null is returned
Public methodPublishProject
Publish the project
Public methodRefresh
Refresh (read over) Object from Database
Public methodReOpenProject
Reopen project (extract from archive)
Public methodSave
Saves the project.
Public methodSaveNewObsolete.
Saves the new project, copying the necessary data from the template.
Public methodSendMessageToInfoChannel
Send a message to the project channel
Public methodSetLimitPlanWorkLogObsolete.
Enable or disable submitting time reports
Public methodSetPlanWorkLog
Set the project time limit (minutes)
Public methodSetPlanWorkLogDays
Set the project time limit (days)
Public methodSetPlanWorkLogHours
Set the project time limit (hours)
Public methodSetPlanWorkLogMinutes
Set the project time limit (minutes)
Back to Top
Properties

  NameDescription
Public propertyTypeUid
Returns the unique object identifier "Base Project Type"
Back to Top
Remarks

Section containing methods for managing projects
Examples

Create a project to work with

//create a project template to create a project 
var projectTemplate = PublicAPI.Projects.ProjectTemplate.Load(1);
//project name 
var name = "New test project";
//project manager 
var manager = context.UserProjectManager;
//create a project 
var myProject = PublicAPI.Projects.Project.CreateProject(name, projectTemplate, DateTime.Now, DateTime.Now.AddMonths(1), manager);

Enable submission of project time report

PublicAPI.Projects.Project.SetLimitPlanWorkLog(myProject, true);

define the limit of working days

//load the occupation by ID 
var worklogActivity = PublicAPI.Portal.Objects.Tasks.WorkLogActivity.Load(3);
//define the working time limit
PublicAPI.Projects.Project.SetPlanWorkLogDays(myProject, worklogActivity, 5);

change the working-time approver for the project

PublicAPI.Projects.Project.ChangeHarmonizator(myProject, context.NewHarmonizator);

When project roles and project tasks are created, publish the project

PublicAPI.Projects.Project.PublishProject(myProject);

Change the project manager

PublicAPI.Projects.Project.ChangeProjectManager(myProject, context.UserNewManager, "The project manager is changed");

Send a message to the project channel

//message texr 
var text = "Please note! The project manager is changed";
//message subject 
var subject = "Changing project manager";
PublicAPI.Projects.Project.SendMessageToInfoChannel(myProject, text, subject, context.CurrentUser);

After work with the project's budget and risks, close the project

PublicAPI.Projects.Project.CloseProject(myProject);

See Also