[ObsoleteAttribute("Этот метод вскоре будет удалён", true)] [BrowsableAttribute(false)] public ProjectTask CreateTask( Project project, string subject, User executor, DateTime startDate, DateTime endDate, bool addExecutorToProject )
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, bool addExecutorToProject )
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
Executor. Object. Access path: PublicAPI.Portal.Security.User
- startDate
- Type: System DateTime
Start date
- endDate
- Type: System DateTime
End date
- addExecutorToProject
- Type: System Boolean
Add an executor to the project, if they are not in it
Return Value
Type: ProjectTaskProject 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 var addExecutorToProject = true; //add a task executor to the project, if they are not in it (yes or no) //create a project task var projectTask = PublicAPI.Projects.ProjectTask.CreateTask(project, subject, executor, startDate, endDate, addExecutorToProject); //projectTask - created project task, included in the plan, not saved in the database
See Also