using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ETSStariGrad
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void frmGlavna_Load(object sender, EventArgs e)
        {
            MessageBox.Show("Ovo je pocetni dogadjaj");
        }

        private void frmGlavna_Closing(object sender, FormClosingEventArgs e)
        {
            MessageBox.Show("Ovo je zavrsni dogadjaj");
        }

        private void radSaStudentimaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            postaviAktivnu(new frmStudent(bsStudenti));
        }

        private void radSaNastavnicimaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            postaviAktivnu(new frmNastavnik());
        }


        private void postaviAktivnu(Form frm)
        {
            frm.MdiParent = this;
            frm.Show();
        }

        private async void asyncToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new Task(() =>
            {
                Thread.Sleep(5000);
                MessageBox.Show("Ovo je async dogadjaj");
            }).Start();
        }
    }
}
