private void combobox_zakaz object sender EventArgs try List string ne

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
private void combobox_zakaz(object sender, EventArgs e)
{
try
{
List<string> m = new List<string>();
foreach( var com_box in name_panel1.Controls.OfType<ComboBox>())
{
m.Add(com_box.Text);
}
m[0] = m[0] != "" ? " and employess.N = '" + m[0] + "'" : m[0];
m[1] = m[1] != "" ? " and employess.O = = '" + m[1] + "'" : m[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" + m[0] + m[1] + ";"); /*and employess.N = '" + имя_comboBox2.Text + "'and employess.O = '" + Фамилия_comboBox1.Text + "';");*/
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}