//фамилия
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (Фамилия_comboBox1.SelectedIndex != -1 && имя_comboBox2.SelectedIndex != -1)
{
dataGridView1.DataSource = mysql.get_Table("select employess.N as 'Имя', employess.O as 'Отчество',tables.description as 'Столик',data as 'Дата заказа', time as 'Время заказа', made as 'Выполнен (YES) / Не выполнен (NO)',order_amount as 'Сумма заказа'from orders, `tables`,employess where orders.`table` = tables.code_table and employess.id_employess = orders.the_waiter and employess.O = '" + Фамилия_comboBox1.Text + "'and employess.N ='" + имя_comboBox2.Text +"';");
}
else
{
dataGridView1.DataSource = mysql.get_Table("select employess.N as 'Имя', employess.O as 'Отчество',tables.description as 'Столик',data as 'Дата заказа', time as 'Время заказа', made as 'Выполнен (YES) / Не выполнен (NO)',order_amount as 'Сумма заказа'from orders, `tables`,employess where orders.`table` = tables.code_table and employess.id_employess = orders.the_waiter and employess.O = '" + Фамилия_comboBox1.Text + "';");
}
if (имя_comboBox2.SelectedIndex != -1 && Фамилия_comboBox1.SelectedIndex != -1)
{
столик_comboBox3.Enabled = true;
}
}
// имя
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if(имя_comboBox2.SelectedIndex != -1 && Фамилия_comboBox1.SelectedIndex != -1)
{
dataGridView1.DataSource = mysql.get_Table("select employess.N as 'Имя', employess.O as 'Отчество',tables.description as 'Столик',data as 'Дата заказа', time as 'Время заказа', made as 'Выполнен (YES) / Не выполнен (NO)',order_amount as 'Сумма заказа'from orders, `tables`,employess where orders.`table` = tables.code_table and employess.id_employess = orders.the_waiter and employess.N = '" + имя_comboBox2.Text + "'and employess.O = '" +Фамилия_comboBox1.Text + "';");
}
else
{
dataGridView1.DataSource = mysql.get_Table("select employess.N as 'Имя', employess.O as 'Отчество',tables.description as 'Столик',data as 'Дата заказа', time as 'Время заказа', made as 'Выполнен (YES) / Не выполнен (NO)',order_amount as 'Сумма заказа'from orders, `tables`,employess where orders.`table` = tables.code_table and employess.id_employess = orders.the_waiter and employess.N = '" + имя_comboBox2.Text + "';");
}
if (имя_comboBox2.SelectedIndex != -1 && Фамилия_comboBox1.SelectedIndex != -1)
{
столик_comboBox3.Enabled = true;
}
}