/// <summary> /// Modifies project User. /// </summary> /// <returns>True if the user was modified, false otherwise.</returns> public bool ModifyUser(ProjectUser user) { //if (!Users.ContainsKey(user.Id)) // return false; //Users[user.Id] = user; return(true); }
public Project(ProjectType type, string name, Guid id, ProjectUser founder) { Type = type; Name = name; DateCreated = System.DateTime.Now; Id = id; Users = new Dictionary<Guid, ProjectUser>(); //Users[founder.Id] = founder; }
public Project(ProjectType type, string name, Guid id, ProjectUser founder) { Type = type; Name = name; DateCreated = System.DateTime.Now; Id = id; Users = new Dictionary <Guid, ProjectUser>(); //Users[founder.Id] = founder; }
/// <summary> /// Removes user from project /// </summary> public async Task<bool> RemoveUserFromProject(Guid projectId, ProjectUser user) { if (!projects.ContainsKey(projectId)) return false; bool ret = projects[projectId].RemoveUser(user); if (ret) UpdateDatabase(projects[projectId]); return ret; }
/// <summary> /// Adds user to project /// </summary> public bool AddUserToProject(Guid projectId, ProjectUser user) { if (!_projects.ContainsKey(projectId)) return false; bool ret = _projects[projectId].AddUser(user); if(ret) UpdateDatabase(_projects[projectId]); return ret; }
/// <summary> /// Add member to project. /// </summary> /// <returns>True if the user was added, false otherwise.</returns> public bool AddUser(ProjectUser user) { //if (Users.ContainsKey(user.Id)) // return false; //Users[user.Id] = user; return true; }
/// <summary> /// Remove member from project. /// </summary> /// <returns>True if the user was removed, false otherwise.</returns> public bool RemoveUser(ProjectUser user) { //return Users.Remove(user.Id); return false; }
/// <summary> /// Modifies user permissions. /// </summary> /// <remarks /> New permissions are passed insed the ProjectUser public async Task<bool> ModifyUserPermissions(Guid projectId, ProjectUser user) { if (!projects.ContainsKey(projectId)) return false; var ret = projects[projectId].ModifyUser(user); if (ret) UpdateDatabase(projects[projectId]); return ret; }
/// <summary> /// Modifies user permissions /// </summary> /// <remarks /> New permissions are passed insed the ProjectUser public bool ModifyUserPermissions(Guid projectId, ProjectUser user) { if (!_projects.ContainsKey(projectId)) return false; bool ret = _projects[projectId].ModifyUser(user); if (ret) UpdateDatabase(_projects[projectId]); return ret; }
/// <summary> /// Remove member from project. /// </summary> /// <returns>True if the user was removed, false otherwise.</returns> public bool RemoveUser(ProjectUser user) { return Users.Remove(user.Id); }
/// <summary> /// Modifies project User. /// </summary> /// <returns>True if the user was modified, false otherwise.</returns> public bool ModifyUser(ProjectUser user) { if (!Users.ContainsKey(user.Id)) return false; Users[user.Id] = user; return true; }
/// <summary> /// Remove member from project. /// </summary> /// <returns>True if the user was removed, false otherwise.</returns> public bool RemoveUser(ProjectUser user) { //return Users.Remove(user.Id); return(false); }
/// <summary> /// Add project to user list /// </summary> public async Task AddProject(Guid projectId, ProjectUser user) { //ProjectList[projectId] = user; }
/// <summary> /// Add project to user list /// </summary> /// <remarks/> can be used to change user permission level(Owner, member ...) within existing project public void AddProject(Guid projectId, ProjectUser user) { ProjectList[projectId] = user; }