private void btChangeDirection_Click(object sender, EventArgs e)
 {
     if (dgDirectionOfPreparation.SelectedRows.Count == 1)
     {
         DataRow Row = ((DataRowView)dgDirectionOfPreparation.SelectedRows[0].DataBoundItem).Row;
         MDirectionOfPreparation   Direction = new MDirectionOfPreparation((string)Row["CodeOfDP"], (string)Row["NameOfDP"], (ushort)Row["PeriodOfStudy"], (string)Row["InstituteShortName"]);
         AddDirectionOfPreparation add       = new AddDirectionOfPreparation(Direction);
         add.Owner = this;
         add.Show();
     }
     else
     {
         MessageBox.Show("Для изменения выделите только одну строку!");
     }
 }
        private void btAddDirection_Click(object sender, EventArgs e)
        {
            AddDirectionOfPreparation d = new AddDirectionOfPreparation();

            d.Show();
        }