private void Button_Click(object sender, RoutedEventArgs e) { // Home Page MovieInterfaceHome movieInterfaceHome = new MovieInterfaceHome(); this.NavigationService.Navigate(movieInterfaceHome); }
private void Button_Click(object sender, RoutedEventArgs e) { TitleText.Content = ""; GenreText.Content = ""; this.directors.Clear(); // Home Page MovieInterfaceHome movieInterfaceHome = new MovieInterfaceHome(); this.NavigationService.Navigate(movieInterfaceHome); }
private void SearchMovie(object sender, RoutedEventArgs e) { using (OleDbConnection cn = new OleDbConnection(@"Provider = Microsoft.ACE.OLEDB.12.0; Data Source =|DataDirectory|\MartinMovies.accdb")) { string query = ""; if (searchType == "Title") { query = "select Titles, [Release Date], Description, Director, Genre from Titles where Titles LIKE '%' + @value + '%'"; } else if (searchType == "Director") { query = "select Titles, [Release Date], Description, Director, Genre from Titles where Director LIKE '%' + @value + '%'"; } else { query = "select Titles, [Release Date], Description, Director, Genre from Titles where Genre LIKE '%' + @value + '%'"; } OleDbCommand cmd = new OleDbCommand(query, cn); OleDbParameter titleParam = new OleDbParameter(); titleParam.OleDbType = OleDbType.VarChar; titleParam.ParameterName = "@value"; titleParam.Value = SearchText.Text; cmd.Parameters.Add(titleParam); cn.Open(); MovieInterfaceHome searchMovies = new MovieInterfaceHome(); OleDbDataReader read = cmd.ExecuteReader(); searchMovies.clearList(); while (read.Read()) { List <string> items = new List <string>(); for (int i = 0; i < 5; i++) { items.Add(read[i].ToString()); } searchMovies.addItemToList(items); } read.Close(); this.NavigationService.Navigate(searchMovies); } }