private void ModifyProject_Load(object sender, EventArgs e) { this.CenterToScreen(); FormSelectProject form = new FormSelectProject(); form.ShowDialog(); if (form.DialogResult != DialogResult.OK) { MessageBox.Show("No project selected.", "Attention"); Close(); } _SelectedProjectId = form._SelectedProjectId; FakePreferenceRepository preferenceRepository = new FakePreferenceRepository(); string preferredProjectId = preferenceRepository.GetPreference(_CurrentAppUser.UserName, FakePreferenceRepository.PREFERENCE_PROJECT_ID); if (_SelectedProjectId.ToString() == preferredProjectId) { MessageBox.Show("Cannot modify your current session project.", "Attention"); Close(); } textBoxProjectName.Text = form._SelectedProjectName; }