예제 #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();
            }
        }
예제 #2
0
 public async void DeleteObject(string _id, string _rev)
 {
     using (var db = new MyCouchStore("http://localhost:5984", "cars"))
     {
         var response = await db.DeleteAsync(_id, _rev);
     }
 }
예제 #3
0
        public async Task <DeleteContractCommandContext> Execute(DeleteContractCommandContext commandContext)
        {
            using (var store = new MyCouchStore("http://*****:*****@cm-ylng-msk-03:5984", "cmas"))
            {
                await store.DeleteAsync(commandContext.id);

                return(commandContext);
            }
        }
예제 #4
0
        /// <summary>
        /// Returns false if object not found.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <bool> DeleteComment(string id)
        {
            var success = await _commentStore.DeleteAsync(id);

            if (success)
            {
                _commentCache.Remove(id);
            }

            return(success);
        }
 public void Remove(LeadType type)
 {
     _store.DeleteAsync(type.DocumentId).Wait();
 }
예제 #6
0
 public void Remove(Lead lead)
 {
     _store.DeleteAsync(lead.DocumentId).Wait();
 }
예제 #7
0
 public void Remove(Product product)
 {
     _store.DeleteAsync(product.DocumentId).Wait();
 }