Esempio n. 1
0
        private void searchFlowerMainMenuBtn_Click(object sender, EventArgs e)
        {
            bool      res1 = false;
            bool      res2 = false;
            bool      res3 = false;
            SearchGUI test = new SearchGUI(userAcctType);

            // hides the Main Menu GUI
            //this.Hide();
            this.Visible = false;

            // brings up the Search Flower GUI
            //test.Show();
            test.ShowDialog();


            if ((test.egn_name != null && test.egn_name != "") ||
                (test.latin_word != null && test.latin_word != "") ||
                (test.botanical != null && test.botanical != "") ||
                (test.note_keywords != null && test.note_keywords != ""))
            {
                Word_Search word = new Word_Search(test.egn_name, test.latin_word, test.botanical, test.note_keywords);
                word.Search();
                ResultsCtrl results = new ResultsCtrl(word.Get_results()[0].id, word.Get_results()[1].id, word.Get_results()[2].id);
                results.Run(ref res1, ref res2, ref res3);
                ResultsGUI resultgui = new ResultsGUI(results.id, results.flowers, results.notes, results.images1, userAcctType);
                if (!res1)
                {
                    resultgui.Result1btn.Enabled = false;
                    MessageBox.Show("No results were found");
                }
                if (!res2)
                {
                    resultgui.Result2btn.Enabled = false;
                }
                if (!res3)
                {
                    resultgui.Result3btn.Enabled = false;
                }
                if (res1)
                {
                    resultgui.ShowDialog(this);
                }

                //This is to exit application if user X's out of resultGUI, couldn't get any other way to work for some reason.
                if (resultgui.exit == true)
                {
                    new MainMenu(userAcctType).Show();
                }
            }
            else
            {
                new MainMenu(userAcctType).Show();
            }
        }
        private void SearchFlowersButton_Click(object sender, EventArgs e)
        {
            Word_Search word;

            if (EnglishSearchBox.Text != "" ||
                LatinSearchBox.Text != "" ||
                BotanicalSearchBox.Text != "" ||
                NoteSearchBox.Text != "")
            {
                word = new Word_Search(EnglishSearchBox.Text, LatinSearchBox.Text, BotanicalSearchBox.Text, NoteSearchBox.Text);
                word.Search();
            }
            if (SearchFlowerExt != null && SearchFlowerExt != "")
            {
                //TODO: When image search is fixed and improved, add image search here
            }
        }