Exemple #1
0
        public FormMain()
        {
            InitializeComponent();
            FormLogin loginWindow = new FormLogin();

            loginWindow.ShowDialog();
            if (loginWindow.DialogResult == DialogResult.Cancel)
            {
                Environment.Exit(0);
            }

            FormProject projectSelect = new FormProject();

            projectSelect.ShowDialog();
            if (projectSelect.DialogResult == DialogResult.Cancel)
            {
                Environment.Exit(0);
            }
            else
            {
                FakePreferenceRepository ReferenceRepo = new FakePreferenceRepository();
                Text = "Main - " + FormProject.selectedProjectName;
                Update();
            }
        }
Exemple #2
0
        private void buttonSelect_Click(object sender, EventArgs e)
        {
            if (Projects.SelectedItem != null)
            {
                FakePreferenceRepository PrefRepo = new FakePreferenceRepository();
                Preference Selection = new Preference();

                Selection.UserName = "******";
                string   SelectedItem = Projects.SelectedItem.ToString();
                string[] ListedString = SelectedItem.Split('-');
                Selection.Value = ListedString[0].Trim();
                Selection.Name  = ListedString[1].Trim();

                PrefRepo.SetPreference(Selection.UserName, Selection.Name, Selection.Value);

                selectedProjectName = Selection.Name;
                numOfSelects++;
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                //Environment.Exit(0);
            }
        }
Exemple #3
0
        private void removeProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormRemoveProject removeProject = new FormRemoveProject();

            removeProject.ShowDialog();

            if (removeProject.DialogResult == DialogResult.Cancel)
            {
                removeProject.Close();
            }
            else
            {
                FakePreferenceRepository ReferenceRepo = new FakePreferenceRepository();
            }
        }
Exemple #4
0
        private void selectProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormProject projectSelect = new FormProject();

            projectSelect.ShowDialog();

            if (projectSelect.DialogResult == DialogResult.Cancel && projectSelect.numOfSelects == 0)
            {
                Environment.Exit(0);
            }
            else if (projectSelect.DialogResult == DialogResult.Cancel && projectSelect.numOfSelects != 0)
            {
                projectSelect.Close();
            }
            else
            {
                FakePreferenceRepository ReferenceRepo = new FakePreferenceRepository();
            }
        }