Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (Program.CheckString(new string[] { textBox1.Text, textBox2.Text }))
     {
         try
         {
             bool        check  = (groupBox1.Enabled) ? true : false;
             var         result = ((Main)Owner).db.users.SingleOrDefault(n => n.id_u == item.id_u);
             StudentForm stud   = new StudentForm();
             stud.EditStudent(item, result, textBox2.Text, textBox1.Text, textBox3.Text, dateTimePicker1.Value, textBox5.Text, textBox6.Text, check);
             ((Main)Owner).usersSheet = ((Main)Owner).db.users.OrderBy(n => n.id_u).ToList();
             ((Main)Owner).db.SaveChanges();
             ((Main)Owner).ученикиToolStripMenuItem_Click(sender, e);
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         MessageBox.Show("Не все поля заполнены!");
     }
 }