Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string[] str2 = dateTimePicker2.Value.ToString().Split(new char[] { ' ' });
         string[] str  = dateTimePicker1.Value.ToString().Split(new char[] { ' ' });
         Met15    m    = new Met15();
         m.Edit(Convert.ToInt32(comboBox2.Items[comboBox2.SelectedIndex]), comboBox1.Items[comboBox1.SelectedIndex].ToString(), str[1], str2[1]);
         this.Close();
     }
     catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); }
     catch { MessageBox.Show("Error"); }
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Met15    m   = new Met15();
         Met11    m2  = new Met11();
         string[] str = comboBox1.Items[comboBox1.SelectedIndex].ToString().Split(new char[] { ' ' });
         m.Delete(Convert.ToInt32(str[0]));
         var ec2 = from n2 in db11.Raspisanie
                   where n2.IDVrem == Convert.ToInt32(str[0])
                   select n2;
         foreach (var i in ec2)
         {
             m2.Delete(i.ID);
         }
         this.Close();
     }
     catch { MessageBox.Show("Error"); }
 }