Example #1
0
        private void butRegistration_Click(object sender, RoutedEventArgs e)
        {
            var nu = new FormAdmin();

            nu.Show();
            Hide();
        }
Example #2
0
        private void butLogin_Click(object sender, RoutedEventArgs e)
        {
            if (tbLogin.Text != "" && tbPassword.Password.ToString() != "")
            {
                dt = db.RunSelect("Select FIO, Admin from [User] where Login='******' and Password='******'");

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0][1].ToString() == "True")
                    {
                        FormAdmin fa = new FormAdmin();
                        fa.Title = dt.Rows[0][0].ToString();
                        fa.Show();
                        this.Hide();
                    }
                    else
                    {
                        FormJury fj = new FormJury();
                        fj.Title = dt.Rows[0][0].ToString();
                        fj.Show();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("Неверно введен логин или пароль!");
                }
            }
            else
            {
                MessageBox.Show("Заполните все поля!");
            }
        }