private void zamknijBiezaceOknoToolStripMenuItem_Click(object sender, EventArgs e) { if (this.ActiveMdiChild.Name.Equals("MojeOkno")) { MojeOkno ok = (MojeOkno)this.ActiveMdiChild; ok.Dispose(); } else if (this.ActiveMdiChild.Name.Equals("Okno3")) { Okno3 ok3 = (Okno3)this.ActiveMdiChild; ok3.Dispose(); } }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { MojeOkno ok2 = new MojeOkno(); using (ISession sesja = Program.baza.SessionFactory.OpenSession()) { Klient op1 = sesja.Get <Klient>(1); ok2.ustawDane(op1); } ok2.MdiParent = this; ok2.Show(); }