Пример #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         string[]    dd    = comboBox1.SelectedItem.ToString().Split(',');
         int         dersk = Convert.ToInt32(dd[0]);
         int         ogrno = Convert.ToInt32(textBox3.Text);
         devamsizlik d     = (from x in bs.devamsizliks where x.ogrNo == ogrno && x.ders_kodu == dersk select x).FirstOrDefault();
         d.devamsiz = Convert.ToInt32(textBox4.Text);
         bs.SaveChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Пример #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         devamsizlik d = new devamsizlik();
         d.ogrNo    = Convert.ToInt32(textBox1.Text);
         d.devamsiz = Convert.ToInt32(textBox2.Text);
         string[] dd    = comboBox1.SelectedItem.ToString().Split(',');
         int      dersk = Convert.ToInt32(dd[0]);
         d.ders_kodu = dersk;
         bs.devamsizliks.Add(d);
         bs.SaveChanges();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }