Пример #1
0
        private void SefForma_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Control && e.KeyCode == Keys.P)
            {
                Uvid uv = new Uvid();
                uv.Show();
            }
            else if (e.KeyCode == Keys.Control && e.KeyCode == Keys.T)
            {
                try
                {
                    Parking parking = new Parking();
                    Vozilo  vozilo  = new Vozilo();

                    parking.TrenutnoStanje();

                    int BrojSlobodnih = parking.BrojMesta - vozilo.IzbrojVozila();

                    textBoxBrojSlobodnih.Text = BrojSlobodnih.ToString();

                    textBoxBrojVozila.Text = vozilo.IzbrojVozila().ToString();

                    label2.Visible = true;
                    label3.Visible = true;

                    textBoxBrojSlobodnih.Visible = true;
                    textBoxBrojVozila.Visible    = true;
                }
                catch (Exception ex)
                {
                    if (ex is SystemException ||
                        ex is NotSupportedException ||
                        ex is UnauthorizedAccessException ||
                        ex is FormatException ||
                        ex is IndexOutOfRangeException ||
                        ex is InsufficientMemoryException ||
                        ex is EntryPointNotFoundException ||
                        ex is EntryPointNotFoundException ||
                        ex is EvaluateException ||
                        ex is InvalidCastException ||
                        ex is InvalidProgramException)
                    {
                        MessageBox.Show(ex.Message, "Greska");
                    }
                    else
                    {
                        MessageBox.Show(ex.Message, "Greska");
                    }
                }
            }
        }
Пример #2
0
        private void izmeniBrojMestaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IzmenaMesta zime = new IzmenaMesta();

            zime.ShowDialog();

            Parking parking = new Parking();
            Vozilo  vozilo  = new Vozilo();

            parking.TrenutnoStanje();

            int BrojSlobodnih = parking.BrojMesta - vozilo.IzbrojVozila();

            textBoxBrojSlobodnih.Text = BrojSlobodnih.ToString();

            textBoxBrojVozila.Text = vozilo.IzbrojVozila().ToString();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Naplata naplata = new Naplata();
                naplata.Radnik = logRadnik;
                naplata.ShowDialog();

                textBoxRadnik.Text = logRadnik.Ime;
                Parking parking = new Parking();
                Vozilo  vozilo  = new Vozilo();

                parking.TrenutnoStanje();

                BrojSlobodnih = parking.BrojMesta - vozilo.IzbrojVozila();

                textBoxBrojSlobodnih.Text = BrojSlobodnih.ToString();

                textBoxBrojVozila.Text = vozilo.IzbrojVozila().ToString();
            }
            catch (Exception ex)
            {
                if (ex is SystemException ||
                    ex is OleDbException ||
                    ex is NotSupportedException ||
                    ex is UnauthorizedAccessException ||
                    ex is FormatException ||
                    ex is IndexOutOfRangeException ||
                    ex is InsufficientMemoryException ||
                    ex is EntryPointNotFoundException ||
                    ex is EntryPointNotFoundException ||
                    ex is EvaluateException ||
                    ex is InvalidCastException ||
                    ex is AccessViolationException ||
                    ex is InvalidProgramException)
                {
                    MessageBox.Show(ex.Message, "GRESKA");
                }
                else
                {
                    MessageBox.Show(ex.Message, "GRESKA");
                }
            }
        }