public Remove_Project(FakeProjectRepository currentRepository, Project current, Project toRemove) { InitializeComponent(); currentProject = current; projectToRemove = toRemove; ProjectRepository = currentRepository; allProjects = ProjectRepository.GetAll(); }
public Modify_Project(FakeProjectRepository currentRepository, Project current, Project toModify) { InitializeComponent(); currentProject = current; projectToModify = toModify; ProjectRepository = currentRepository; allProjects = ProjectRepository.GetAll(); }
private void SelProject_Load(object sender, EventArgs e) { CenterToScreen(); //Gets all projects in newRepository projects = NewRepository.GetAll(); //Load each item into select screen foreach (Project project in projects) { ProjectOptions.Items.Add(project.Id.ToString() + " - " + project.Name); } ProjectOptions.SelectedIndex = 0; }
private void PreferenceSelectProject_Load(object sender, EventArgs e) { this.CenterToParent(); foreach (Project project in _ProjectRepository.GetAll()) { listBoxProjects.Items.Add(project.Id.ToString() + " - " + project.Name); } if (listBoxProjects.Items.Count > 0) { listBoxProjects.SetSelected(0, true); } else { MessageBox.Show("There are no existing projects.", "Attention"); this.DialogResult = DialogResult.Cancel; this.Close(); } }