Example #1
0
        private void Sign_In(object sender, RoutedEventArgs e)
        {
            if (userName.Text.ToString() != "" || userPassword.Text.ToString() != "")
            {
                string emailToCheck    = userName.Text.ToString();
                string passwordToCheck = userPassword.Text.ToString();

                using (SqlConnection connection = new SqlConnection("Data Source=localhost:1521:xe;Initial Catalog=vidigo;User ID=SYSTEM;Password=school10;"))
                    using (SqlCommand signInCheck = new SqlCommand("Select USERNAME, PASSWORD FROM VIGICLIENT WHERE " + emailToCheck + "=USERNAME and " + passwordToCheck + "=PASSWORD", connection))
                    {
                        connection.Open();
                        using (SqlDataReader reader = signInCheck.ExecuteReader())
                        {
                            if (reader.HasRows)
                            {
                                connection.Close();
                                this.Hide();
                                searchPage searchPage = new searchPage();
                                searchPage.Show();
                            }

                            else
                            {
                                signInError();
                                connection.Close();
                            }
                        }
                    }
            }
        }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Hide();
            searchPage searchPage = new searchPage();

            searchPage.Show();
        }
Example #3
0
        private void Sign_In(object sender, RoutedEventArgs e)
        {
            if (userName.Text.ToString() != "" || userPassword.Text.ToString() !="")
            {
                string emailToCheck = userName.Text.ToString();
                string passwordToCheck = userPassword.Text.ToString();

                using (SqlConnection connection = new SqlConnection("Data Source=localhost:1521:xe;Initial Catalog=vidigo;User ID=SYSTEM;Password=school10;"))
                using (SqlCommand signInCheck = new SqlCommand("Select USERNAME, PASSWORD FROM VIGICLIENT WHERE "+emailToCheck+"=USERNAME and "+passwordToCheck+"=PASSWORD",connection))
                {
                    connection.Open();
                    using(SqlDataReader reader = signInCheck.ExecuteReader())
                    {
                        if(reader.HasRows)
                        {
                            connection.Close();
                            this.Hide();
                            searchPage searchPage = new searchPage();
                            searchPage.Show();
                        }

                        else{signInError();
                        connection.Close();
                        }

                    }
                }
            }
}
Example #4
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     this.Hide();
     searchPage searchPage = new searchPage();
     searchPage.Show();
 }