public async Task <SortedSet <SelectListItem> > IncludeProjectManagersDropdown([Optional] ApplicationUser projectM) { if (projectM != null) { SelectListItem currentProjectM = new SelectListItem() { Value = projectM.Id, Text = projectM.FullName, Selected = true }; if (projectM != null) { var projectManagersToUpdate = await Dropdown.GenereteDropDownUsers(db, RoleName.ProjectManager); projectManagersToUpdate.Remove(projectManagersToUpdate.Single(x => x.Value == projectM.Id)); projectManagersToUpdate.Add(currentProjectM); SelectListItem noneForUpdate = new SelectListItem() { Value = "None", Text = "None", Selected = false }; projectManagersToUpdate.Add(noneForUpdate); return(projectManagersToUpdate); } var projectManagers = await Dropdown.GenereteDropDownUsers(db, RoleName.ProjectManager); return(projectManagers); } var projectManagersIfNone = await Dropdown.GenereteDropDownUsers(db, RoleName.ProjectManager); SelectListItem none = Dropdown.CreateNoneForDropdown(); projectManagersIfNone.Add(none); return(projectManagersIfNone); }
public async Task <Tuple <SortedSet <SelectListItem>, SortedSet <SelectListItem> > > IncludeProjectManagersAndDevelopersDropdown() { var developers = await Dropdown.GenereteDropDownUsers(db, RoleName.Developer); var none = Dropdown.CreateNoneForDropdown(); developers.Add(none); var projectManagers = await Dropdown.GenereteDropDownUsers(db, RoleName.ProjectManager); Tuple <SortedSet <SelectListItem>, SortedSet <SelectListItem> > tuple = new Tuple <SortedSet <SelectListItem>, SortedSet <SelectListItem> >(developers, projectManagers); return(tuple); }