public static List <SelectListItem> GetStatuses(IRepositary repo) { return(repo.GetStatuses(). Select(s => new SelectListItem { Value = s.ID.ToString(), Text = s.Name }).ToList()); }
public static List<SelectListItem> GetStatuses(IRepositary repo, List<string> itemsToShow) { List<SelectListItem> projectList = new List<SelectListItem>(); var projects = repo.GetStatuses(); foreach (var pro in projects) { if (itemsToShow.IndexOf(pro.Name)>=0) { projectList.Add(new SelectListItem { Value = pro.ID.ToString(), Text = pro.Name }); } } return projectList; }
public static List <SelectListItem> GetStatuses(IRepositary repo, List <string> itemsToShow) { List <SelectListItem> projectList = new List <SelectListItem>(); var projects = repo.GetStatuses(); foreach (var pro in projects) { if (itemsToShow.IndexOf(pro.Name) >= 0) { projectList.Add(new SelectListItem { Value = pro.ID.ToString(), Text = pro.Name }); } } return(projectList); }
public static List<SelectListItem> GetStatuses(IRepositary repo) { return repo.GetStatuses(). Select(s => new SelectListItem { Value = s.ID.ToString(), Text = s.Name }).ToList(); }