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

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

Parameters

parentTask
Type: ProjectTask
Parent task, the subtask is created for. Object. Access path: PublicAPI.Projects.ProjectTask
subject
Type: System String
Task subject
executor
Type: User
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 subtask
Examples

//load the necessary data 
var parentTask = PublicAPI.Projects.ProjectTask.Load(3); //load the project task 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 subtask 
var projectSubTask = PublicAPI.Projects.ProjectTask.CreateSubTask(parentTask, subject, executor, startDate, endDate);

//projectSubTask - created project subtask for the parentTask, 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