Пример #1
0
        private void UsersControl(object sender, EventArgs e)
        {
            MySqlConnection connection = MyMySQLConnection.ConnectionSingleton();

            connection.Open();
            Users users = new Users();

            users.Nickname = Nickname.Text;
            users.Password = Password.Text;
            bool isUser = usersdata.ControlUser(connection, users);

            if (isUser)
            {
                UsersConnection.Visibility = Visibility.Hidden;
                DatabaseTab.Visibility     = Visibility.Visible;
            }
            else
            {
                ErrorUserTextBlock.Visibility = Visibility.Visible;
                ErrorUserTextBlock.Text       = "Wrong nickname or password!";
            }
            connection.Close();
        }