Esempio n. 1
0
        private void listBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                return;
            }

            string item = listBox1.SelectedItem.ToString();

            if (selectedItem == item)
            {
                return;
            }

            selectedItem = item;
            if (!controller.loadTable(selectedItem, null))
            {
                MessageBox.Show("Can't load table " + selectedItem);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string request = " WHERE ";

            foreach (Control item in listOfControls)
            {
                if (item is TextBox)
                {
                    request += DB.getByType(item.Text).Substring(3) + " ";
                }
                else
                {
                    if (item.Text == "")
                    {
                        MessageBox.Show("Fill in all the fields!");
                        return;
                    }
                    request += item.Text + " ";
                }
            }
            controller.loadTable(table, request);
        }