Пример #1
0
 private void AddTeacher(object sender, EventArgs e)
 {
     try
     {
         Logs.GetInfo("Click button Create in Teacher");
         AddTeacher t = new AddTeacher();
         t.Show();
     }
     catch (Exception ex)
     {
         Logs.GetError(ex);
     }
 }
Пример #2
0
 private void Update(object sender, EventArgs e)
 {
     if (DG.SelectedRows.Count == 1)
     {
         DataRow    Row      = ((DataRowView)DG.SelectedRows[0].DataBoundItem).Row;
         MTeacher   mTeacher = new MTeacher((string)Row["FullName"], (string)Row["Note"], (string)Row["Departament"], (string)Row["MetodicalDays"], (string)Row["Windows"], (string)Row["Weekends"]);
         AddTeacher add      = new AddTeacher(mTeacher);
         add.Owner = this;
         add.ShowDialog();
     }
     else
     {
         MessageBox.Show("Для изменения выделите только одну строку!");
     }
 }
Пример #3
0
 private void Update(object sender, EventArgs e)
 {
     try
     {
         Logs.GetInfo("Click button Change is Teacher");
         if (DG.SelectedRows.Count == 1)
         {
             DataRow  Row      = ((DataRowView)DG.SelectedRows[0].DataBoundItem).Row;
             String[] fullName = ((string)Row["FullName"]).Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
             MTeacher mTeacher;
             if (fullName.Length == 3)
             {
                 mTeacher = new MTeacher(fullName[1], fullName[0], fullName[2], (string)Row["AcademicDegree"], (string)Row["AcademicTitle"], (string)Row["Departament"], (string)Row["MetodicalDays"], (string)Row["Windows"], (string)Row["Weekends"]);
             }
             else
             {
                 mTeacher = new MTeacher(fullName[1], fullName[0], "", (string)Row["AcademicDegree"], (string)Row["AcademicTitle"], (string)Row["Departament"], (string)Row["MetodicalDays"], (string)Row["Windows"], (string)Row["Weekends"]);
             }
             AddTeacher add = new AddTeacher(mTeacher);
             add.Owner = this;
             add.ShowDialog();
         }
         else if (DG.SelectedRows.Count > 1)
         {
             MessageBox.Show("Для изменения выделите только одну строку!");
         }
         else
         {
             MessageBox.Show("Для изменения выделите хотя бы одну строку !");
         }
     }
     catch (Exception ex)
     {
         Logs.GetError(ex);
     }
 }
Пример #4
0
        private void Open_Teacher_Click(object sender, EventArgs e)
        {
            AddTeacher addTeacher = new AddTeacher();

            addTeacher.Show();
        }
Пример #5
0
        private void AddTeacher(object sender, EventArgs e)
        {
            AddTeacher t = new AddTeacher();

            t.ShowDialog();
        }