PublicAPI.Projects.ProjectTask.CreateTask ELMA API Documentation
Create a project task. Creates an object, without saving in the database
 
 
Syntax

[ObsoleteAttribute("Этот метод вскоре будет удалён", true)]
[BrowsableAttribute(false)]
public ProjectTask CreateTask(
	Project project,
	string subject,
	User executor,
	DateTime startDate,
	DateTime endDate
)

Parameters

project
Type: Project
Project, the task is created in. Object. Access path: PublicAPI.Projects.Project
subject
Type: System String
Task subject
executor
Type: User
Task executor. Object. Access path: PublicAPI.Portal.Security.User
startDate
Type: System DateTime
Start date
endDate
Type: System DateTime
End date

Return Value

Type: ProjectTask
Project task
Examples

//load the necessary data 
var project = PublicAPI.Projects.Project.Load(3); //load the project by ID 
var subject = "Task name"; //task subject 
var executor = PublicAPI.Portal.Security.User.Load(3); //load the user by ID 
var startDate = DateTime.Now; //task start date 
var endDate = DateTime.Now.AddDays(3); //task end date 

//create a project task 
var projectTask = PublicAPI.Projects.ProjectTask.CreateTask(project, subject, executor, startDate, endDate);

//projectTask - created project task, included in the plan, not saved in the database 
//WARNING!! This method automatically adds the task executor to the project, if they are not in it
See Also