Ejemplo n.º 1
0
        private string selectAProject()
        {
            string            selectedProject = "";
            FormSelectProject form            = new FormSelectProject();

            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                FakePreferenceRepository preferenceRepository = new FakePreferenceRepository();
                preferenceRepository.SetPreference(_CurrentAppUser.UserName,
                                                   FakePreferenceRepository.PREFERENCE_PROJECT_NAME,
                                                   form._SelectedProjectName);
                int selectedProjectId = form._SelectedProjectId;
                preferenceRepository.SetPreference(_CurrentAppUser.UserName,
                                                   FakePreferenceRepository.PREFERENCE_PROJECT_ID,
                                                   selectedProjectId.ToString());
                this.Text       = "Main - " + form._SelectedProjectName;
                selectedProject = form._SelectedProjectName;
            }
            form.Dispose();
            return(selectedProject);
        }
Ejemplo n.º 2
0
        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;
        }