Ejemplo n.º 1
0
        private void monoFlat_Button1_Click(object sender, EventArgs e)
        {
            string gelenDeger;

            SelectClass     select  = new SelectClass();
            SimilarityClass similar = new SimilarityClass();
            QueryExecute    execute = new QueryExecute();
            DbConnect       con     = new DbConnect();
            TableColControl control;

            select.regexContol(similar.editQuery(queryTxt.Text.Trim().ToLower()));
            gelenDeger = ResultClass.getResult();
            DataTable table = new DataTable();


            try
            {
                execute.executeAdapter(gelenDeger).Fill(table);
                dataGridView1.DataSource = table;
                ResultClass.setResult("");
                con.dbConnection().Close();
            }
            catch (Exception)
            {
                SimilarityClass similar2 = new SimilarityClass();
                control = new TableColControl();
                string sorgu = similar2.editQuery(queryTxt.Text.Trim().ToLower());
                MessageBox.Show(gelenDeger, "HATALI SORGU", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                ResultClass.setResult("");
            }
        }
Ejemplo n.º 2
0
        private void monoFlat_Button1_Click_1(object sender, EventArgs e)
        {
            string          gelenDeger;
            DbConnect       con     = new DbConnect();
            SelectClass     select  = new SelectClass();
            SimilarityClass similar = new SimilarityClass();
            QueryExecute    execute = new QueryExecute();
            TableColControl control;

            select.regexContol(similar.editQuery(queryTxt.Text.Trim().ToLower()));
            gelenDeger = ResultClass.getResult();
            DataTable table      = new DataTable();
            DataTable sorguTable = new DataTable();

            dataGridView1.DataSource = null;
            dataGridView1.Refresh();


            try
            {
                execute.executeAdapter(gelenDeger).Fill(table);
                execute.executeAdapter(gelenCevap).Fill(sorguTable);
                if (!execute.AreTablesTheSame(table, sorguTable))
                {
                    dataGridView1.DataSource = table;
                    label1.Visible           = true;
                    label1.Text       = "Sorgu Yapısı Doğru; Fakat Sorgunuz Cevap Ile Uyuşmuyor !";
                    button1.Enabled   = false;
                    button1.BackColor = Color.LightGray;
                    gelenDeger        = "";
                    ResultClass.setResult("");
                }
                else
                {
                    dataGridView1.DataSource = table;
                    ResultClass.setResult("");
                    button1.Enabled   = true;
                    button1.BackColor = Color.ForestGreen;
                    label1.Visible    = false;
                }


                con.dbConnection().Close();
            }
            catch (Exception)
            {
                SimilarityClass similar2 = new SimilarityClass();
                control = new TableColControl();
                string sorgu = similar2.editQuery(queryTxt.Text.Trim().ToLower());
                // MessageBox.Show(gelenDeger, "HATALI SORGU", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                label1.Visible = true;
                label1.Text    = gelenDeger;
                ResultClass.setResult("");
            }
        }