Пример #1
0
        private void dugmeOdustaniBiranjePaketa_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormaGlavna fg = new FormaGlavna(k1);

            fg.Show();
        }
Пример #2
0
        private void dugmeIzmenaProfilaOdustani_Click(object sender, EventArgs e)
        {
            this.Hide();
            FormaGlavna fg = new FormaGlavna(k1);

            fg.Show();
        }
Пример #3
0
        private void DugmeRegistruj_Click(object sender, EventArgs e)
        {
            Korisnik k = new Korisnik();

            k.Ime = tekstImeRegistracija.Text;
            if (k.Ime == "")
            {
                MessageBox.Show("Sva polja su obavezna!");
                tekstImeRegistracija.Focus();
                return;
            }
            k.Prezime = tekstPrezimeRegistracija.Text;
            if (k.Prezime == "")
            {
                MessageBox.Show("Sva polja su obavezna!");
                tekstPrezimeRegistracija.Focus();
                return;
            }
            try
            {
                k.Godiste = Convert.ToInt32(tekstGodisteRegistracija.Text);
            }catch (Exception)
            {
                MessageBox.Show("Nepravilan format godišta!");
                return;
            }

            int trenutnaGodina = DateTime.Now.Year;

            if (!((trenutnaGodina - k.Godiste) > 15))
            {
                MessageBox.Show("Samo stariji od 15 godina mogu da budu članovi teretane!");
                tekstGodisteRegistracija.Focus();
                return;
            }
            k.Pol = tekstPolRegistracija.Text;
            if (!(k.Pol == "M" || k.Pol == "Z"))
            {
                MessageBox.Show("Polje 'Pol' mora da ima vrednost M ili Z");
                tekstPolRegistracija.Focus();
                return;
            }
            k.Grad = komboGradRegistracija.SelectedItem as Grad;


            k = KontrolerKI.RegistrujKorisnika(k);

            if (k == null)
            {
                MessageBox.Show("Došlo je do greške, korisnik nije sačuvan");
                return;
            }
            else
            {
                FormaGlavna fg = new FormaGlavna(k);
                this.Hide();
                fg.Show();
            }
        }