Exemplo n.º 1
0
        //Select button is clicked
        private void bSelect_Click(object sender, EventArgs e)
        {
            List <string>[] list;
            list = dbConnect.Select();

            dgDisplay.Rows.Clear();
            for (int i = 0; i < list[0].Count; i++)
            {
                int number = dgDisplay.Rows.Add();
                dgDisplay.Rows[number].Cells[0].Value = list[0][i];
                dgDisplay.Rows[number].Cells[1].Value = list[1][i];
                dgDisplay.Rows[number].Cells[2].Value = list[2][i];
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (wybor == 0 && textBox1.Text == "")
            {
                MessageBox.Show("Wybierz jak chcesz szukac i co chcesz szukac");
            }
            else if (wybor == 0)
            {
                MessageBox.Show("Wpisz jak chcesz szukac");
            }
            else if (textBox1.Text == "")
            {
                MessageBox.Show("Wpisz co cchesz szukac");
            }
            else
            {
                //textBox1.Text = tekst;
                tekst = textBox1.Text;
                //wynosimy co chcemy szukac i jakie nasze kryterium
                // User.search_resources(wybor, tekst);
                // wyswietlamy nasze wyniki wyszukiwan
                List <string>[] list;
                string[]        tablica = new string[2];

                tablica = User.search_resources(wybor, tekst);

                list = dbConnect.Select(tablica[0], tablica[1]);
                // list = dbConnect.Select("wybor", tekst);
                //dbConnect.Select("a","b");
                // Select("autor", "aa");
                Console.WriteLine(list[0].Count);
                Console.ReadLine();
                dgDisplay.Rows.Clear();
                for (int i = 0; i < list[0].Count; i++)
                {
                    int number = dgDisplay.Rows.Add();
                    dgDisplay.Rows[number].Cells[0].Value = list[0][i];
                    dgDisplay.Rows[number].Cells[1].Value = list[1][i];
                    dgDisplay.Rows[number].Cells[2].Value = list[2][i];
                    dgDisplay.Rows[number].Cells[3].Value = list[3][i];
                    dgDisplay.Rows[number].Cells[4].Value = list[4][i];
                    dgDisplay.Rows[number].Cells[5].Value = list[5][i];
                }
                MessageBox.Show("Znaleziono " + list[0].Count + " wyników");
            }
        }