Exemplo n.º 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");
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            try {
                Parking par = new Parking();
                par.naziv  = textBox1.Text;
                par.adresa = textBox2.Text;

                par.promeni_detalje();
                MessageBox.Show("Uspesno ste izmenili detalje parkinga.");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Greska");
            }
        }
Exemplo n.º 3
0
        private void ucitaj_podatke()
        {
            try
            {
                Parking par = new Parking();
                par.TrenutnoStanje();
                adresa = par.adresa;
                naziv  = par.naziv;

                textBox1.Text = naziv;
                textBox2.Text = adresa;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Greska");
            }
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
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");
                }
            }
        }
Exemplo n.º 6
0
        public void PostaviRacun()
        {
            try
            {
                textBoxTablice.Text      = Tablice;
                textBoxVremeDolaska.Text = Dolazak.ToString();
                textBoxVremeOdlaska.Text = DateTime.Now.ToString();


                TimeSpan span = DateTime.Now.Subtract(Dolazak);
                textBox1.Text = span.TotalMinutes.ToString("#");

                Parking parking = new Parking();

                parking.TrenutnoStanje();

                textBox2.Text = parking.naziv + "," + parking.adresa;

                int c = 0;


                if (span.Hours < 8)
                {
                    cena = parking.CenaPoSatu / 60;

                    cena *= Decimal.Parse(span.TotalMinutes.ToString());

                    textBoxUkupno.Text = cena.ToString("#");
                }
                else
                {
                    c    = span.Hours / 8;
                    cena = parking.CenaPoDanu * c + (span.Hours % 8) * parking.CenaPoSatu;
                    textBoxUkupno.Text = cena.ToString("#");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Greska");
            }
        }