Beispiel #1
0
        private async void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            using (var store = new MyCouchStore("http://*****:*****@localhost:5984", "tv-series"))
            {
                //Delete a document using user given ID

                await store.DeleteAsync(SearchIDTxt.Text);

                SearchIDTxt.Clear();
                ReadTxt.Clear();
                SearchIDTxt.IsEnabled = true;

                MessageBox.Show("Document Successfully Deleted", "TV-Series", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            }

            // Refreshes the number of tv-serie documents when one is removed.
            using (var client = new MyCouchClient("http://*****:*****@localhost:5984", "tv-series"))
            {
                var personQuery = new QueryViewRequest("series", "CountNoTvSeries").Configure(query2 => query2
                                                                                              .Reduce(false));
                ViewQueryResponse result2 = await client.Views.QueryAsync(personQuery);

                NoTvSeriesTxt.Text = result2.RowCount.ToString();
            }
        }
Beispiel #2
0
        private void ClearButton_Click(object sender, RoutedEventArgs e)
        {
            // Clears all boxes in case of mistake etc..

            SearchIDTxt.Clear();
            SearchIDTxt.IsEnabled = true;
            ReadTxt.Clear();
            TitleText.Clear();
            CreatorTxt.Clear();
            StarsTxt.Clear();
            SeasonsTxt.Clear();
            MPARatingTxt.Clear();
            IMBDRatingTxt.Clear();

            MessageBox.Show("All Fields Have Been Reset", "TV-Series", MessageBoxButton.OK, MessageBoxImage.Exclamation);
        }