фамилия private void comboBox1_SelectedIn dexChanged object sender Eve

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//фамилия
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;
}
}