public ClassForm(Classes c, Form f)
 {
     this.c = c;
     this.f = (SchoolForm)f;
     InitializeComponent();
     refreshWindow();
 }
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            SchoolForm sf = new SchoolForm(txtName.Text, txtCity.Text);

            sf.MdiParent = parent;
            sf.Show();
            this.Close();
        }
Exemple #3
0
        private void wczytajSzkoleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog sfd = new FolderBrowserDialog();

            if (sfd.ShowDialog() == DialogResult.OK && sfd.SelectedPath != "")
            {
                SchoolFactory sf    = new SchoolFactory(sfd.SelectedPath);
                SchoolForm    sForm = new SchoolForm(sf.Open(), sfd.SelectedPath.Remove(sfd.SelectedPath.LastIndexOf('\\')));
                sForm.MdiParent = this;
                sForm.Show();
            }
            else
            {
                MessageBox.Show("Nie wybrano pliku", "Błąd",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }