示例#1
0
        public void InsertTask(TaskCreationDto task)
        {
            Task insertTask = new Task(task.Id, task.Name, task.Description);

            insertTask.Deleted   = false;
            insertTask.Completed = false;
            Project project = this.projectsService.GetById(task.ProjectId);

            insertTask.Project = project;
            taskRepository.InsertTask(insertTask);
            foreach (Guid id in task.Employees)
            {
                Employee     employee     = applicationUserService.GetEmployee(id);
                EmployeeTask employeeTask = new EmployeeTask();
                employeeTask.EmployeeId = employee.Id;
                employeeTask.Task       = insertTask;
                employee.Deleted        = false;
                employeeTaskRepository.Insert(employeeTask);
            }
        }