Exemple #1
0
        private void BtnPrijaviSe_Click(object sender, RoutedEventArgs e)
        {
            Radnik r = new Radnik();
            string pravac;

            pravac     = "IN";
            r.Username = tbKorisnickoIme.Text;
            r.Password = tbLozinka.Text;

            r = k.prijava(r);
            //r = Broker.dajSesiju().prijava(r);
            if (r == null)
            {
                MessageBox.Show("Pogresno korisnicko ili lozinka!");
                tbKorisnickoIme.Clear();
                tbLozinka.Clear();
                tbKorisnickoIme.Focus();
            }
            else
            {
                SimulatorProlaska simulatorProlaska = new SimulatorProlaska(r, pravac, k);
                this.Hide();
                simulatorProlaska.ShowDialog();
                this.Close();
            }
            tbKorisnickoIme.Clear();
            tbLozinka.Clear();
        }
        private void MnOdjava_Click(object sender, RoutedEventArgs e)
        {
            string            pravac            = "OUT";
            SimulatorProlaska simulatorProlaska = new SimulatorProlaska(r, pravac, k);

            this.Hide();
            simulatorProlaska.ShowDialog();
            this.Close();
        }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            MessageBoxResult rezultat = MessageBox.Show("Da li zelite da se izlogujete?", "Upozorenje!", MessageBoxButton.YesNo, MessageBoxImage.Question);

            switch (rezultat)
            {
            case MessageBoxResult.Yes:
                string            pravac            = "OUT";
                SimulatorProlaska simulatorProlaska = new SimulatorProlaska(r, pravac, k);
                this.Hide();
                simulatorProlaska.ShowDialog();
                this.Close();
                break;

            case MessageBoxResult.No:
                break;
            }
        }