/// <summary> /// Initializes a new instance of the <see cref="ProjectSelection"/> class. /// </summary> public ProjectSelection() { ProjectController projRepo = new ProjectController(); foreach (var project in projRepo.GetProjects()) { this.Items.Add (new ListItem (project.ProjectName , project.ProjectId.ToString(CultureInfo.InvariantCulture))); } this.DataTextField = "ProjectName"; this.DataValueField = "ProjectId"; }
/// <summary> /// Initializes a new instance of the <see cref="ProjectFilter"/> class. /// </summary> public ProjectFilter() { string allProjectsText = string.Format (CultureInfo.CurrentCulture , "- {0} -" , Resources.Phrases.AllProjects); this.Items.Add(new ListItem(allProjectsText, string.Empty)); ProjectController projRepo = new ProjectController(); foreach (var project in projRepo.GetProjects()) { this.Items.Add (new ListItem (project.ProjectName , project.ProjectId.ToString(CultureInfo.InvariantCulture))); } this.AutoPostBack = true; this.DataTextField = "ProjectName"; this.DataValueField = "ProjectId"; }