コード例 #1
0
 public int CreateTask(CreateTaskDTO dto)
 {
     ProjectUser relation = new ProjectUser();
     PMP.Core.Entities.Task task = ConvertToModel.ConvertToTask(dto);
     task.ProjectId = dto.ProjectId;
     _uWork.TaskRepo.Create(task);
     _uWork.TaskRepo.Save();
     return task.Id;
 }
コード例 #2
0
        public List<UserToAssignDTO> AssignUser(List<int> userIds, int projectId)
        {
            List<User> users = new List<User>();
            foreach (int id in userIds)
            {
                ProjectUser relation = new ProjectUser();
                relation.UserId = id;
                relation.ProjectId = projectId;
                relation.isAdmin = false;
                User user = _uWork.UserRepo.GetById(id);
                users.Add(user);
                _uWork.ProjectUserRepo.Create(relation);
            }
            _uWork.ProjectUserRepo.Save();

            List<UserToAssignDTO> userDto = ConvertToDTO.ConvertToUserToAssingDTO(users);
            return userDto;
        }
コード例 #3
0
        public void CreateProject(CreateProjectDTO dto)
        {
            var project = ConvertToModel.ConvertToProject(dto);
            var user = (User)HttpContext.Current.Session["User"];
            ProjectUser relation = new ProjectUser();
            relation.UserId = user.Id;
            relation.isAdmin = true;
            relation.Project = project;

            _uWork.ProjectUserRepo.Create(relation);
            _uWork.ProjectUserRepo.Save();
        }