public void dodaj_wezel(Wezel wezel) { Console.WriteLine("JESTEM"); try { dataGridView1.Invoke(new Action(delegate () { dataGridView1.Rows.Add(wezel.getID(), wezel.getstan()); })); comboBox1.Invoke(new Action(delegate () { comboBox1.Items.Add(wezel.getID()); })); } catch(Exception) { } }
public void zmien_stan_operacyjny(Wezel wezel) { try { dataGridView1.Invoke(new Action(delegate () { foreach (DataGridViewRow a in dataGridView1.Rows) { if (a.Cells[0].Value.Equals(wezel.getID())) { a.Cells[1].Value = wezel.getstan(); break; } } })); } catch(Exception) { Console.WriteLine("BŁĄD KRYTYCZNY"); } }