private void button1_Click(object sender, EventArgs e) { try { VisibleReserv vc = new VisibleReserv(); Mapping.Metrezerv d = new Mapping.Metrezerv(); string[] str = comboBox1.Items[comboBox1.SelectedIndex].ToString().Split(new char[] { ' ' }); d.Edit(Program.Pole.id, Convert.ToInt32(str[0]), Convert.ToInt32(numericUpDown1.Value)); this.Close(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); } catch { MessageBox.Show("Error"); } }
private void button1_Click(object sender, EventArgs e) { try { VisibleReserv vc = new VisibleReserv(); Mapping.Metrezerv d = new Mapping.Metrezerv(); var linq = from n in dbdopuslugi.veshi where n.nazvanie == comboBox1.Items[comboBox1.SelectedIndex].ToString() select n; foreach (var i in linq) { d.ADD(i.id, Convert.ToInt32(numericUpDown1.Value)); break; } this.Close(); } catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); } catch { MessageBox.Show("Error"); } }
private void toolStripMenurezerv_Click(object sender, EventArgs e) { vnesenieinfBD.veshi.Reserv.VisibleReserv visibleclient = new vnesenieinfBD.veshi.Reserv.VisibleReserv(); visibleclient.ShowDialog(); }