/// <summary>
 /// Deletes all cards in a pack
 /// </summary>
 /// <param name="pack">Pack which you want to remove</param>
 public void DeleteSavedPack(int pack)
 {
     using (SQLite.Net.SQLiteConnection db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.path))
     {
         IEnumerable<SavedCards> packQuery = db.Table<SavedCards>().Where(card => card.PackNumber == pack);
         foreach (SavedCards savedCard in packQuery)
         {
             db.Delete(savedCard);
         }
     }
 }
 /// <summary>
 /// Deletes a individual card in a pack
 /// </summary>
 /// <param name="pack">A packnumber where you want the card to be removed</param>
 /// <param name="card">Cardnumber the be removed</param>
 public void DeleteSavedCard(int pack, int card)
 {
     using (SQLite.Net.SQLiteConnection db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.path))
     {
         IEnumerable<SavedCards> entityQuery = db.Table<SavedCards>().Where(x => x.PackNumber == pack && x.CardNumber == card);  // from savedCards in context.SavedCardPacks where savedCards.packNumber == pack && savedCards.packCard == card select savedCards;
         foreach (SavedCards savedCard in entityQuery)
         {
             db.Delete(savedCard);
         }
     }
 }
        //Delete specific contact
        public void DeleteRegular(int _RegularItemID)
        {
            using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                    RegularItem ri = new RegularItem(_RegularItemID, "", REGULARS_PERIOD.DAYLY, 0);

                    conn.Delete(ri);
                });
            }
        }
Exemple #4
0
        public bool DeleteProduct(int productID)
        {
            Products p = this.GetProductByID(productID);

            if (conn.Delete(p) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #5
0
 //Delete specific contact
 public void DeleteContact(int Id)
 {
     using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
     {
         var existingconact = conn.Query <Contacts>("select * from Contacts where Id =" + Id).FirstOrDefault();
         if (existingconact != null)
         {
             conn.RunInTransaction(() =>
             {
                 conn.Delete(existingconact);
             });
         }
     }
 }
        //Delete specific contact
        public void DeleteUniqueExpense(int _ItemID)
        {
            using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                    UniqueExpenseItem ri = new UniqueExpenseItem(_ItemID, DateTime.Now, 0, "");

                    conn.Delete(ri);
                });

                // after insert - update total
                UpdateTotal(conn);
            }
        }
Exemple #7
0
        //Delete specific contact
        public void DeleteContact(int Id)
        {
            using (SQLite.Net.SQLiteConnection conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), App.DB_PATH))
            {
                conn.RunInTransaction(() =>
                {
                    ExpenseItem ri = new ExpenseItem(Id, DateTime.Now, 0);

                    conn.Delete(ri);
                });

                // update average
                UpdateStatistics(conn);
            }
        }
Exemple #8
0
        } // End SHOW ALL_Tapped

        private void Delete_Tapped(object sender, TappedRoutedEventArgs e)
        {
            try
            {
                dbConnection();
                var           listProducts = conn.Table <Product>();
                List <string> products     = new List <string>();
                foreach (var product in listProducts)
                {
                    string compareResult = string.Format("{0} " + Environment.NewLine + " Qty: {1}     Price: €{2}", product.productName, product.productQTY, product.productPrice);

                    if (fetchData.SelectedValue.Equals(compareResult))
                    {
                        conn.Delete <Product>(product.productID);
                    }
                }
                Show_Tapped(sender, e);
                closeDBconnection();
            }
            catch (Exception)
            {
                throw;
            }
        } //  End Function
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            var query = conn.Table <ToDoList>();

            if (Display.SelectedIndex > -1)
            {
                foreach (var message in query)
                {
                    CheckBox myItem = Display.SelectedItem as CheckBox;
                    if (message.Title == myItem.Content as string)
                    {
                        conn.Delete(message);
                        return;
                    }
                }
            }
            lib.Remove(Display);
        }
Exemple #10
0
        private void deleteButton_Click(object sender, RoutedEventArgs e)
        {
            //textbox array
            TextBox[] infoBoxArr = { usernameTextbox, cvcTextbox, passwordTextbox, accountTextbox, sq1_Textbox, sq2_Textbox, sqa1_Textbox, sqa2_Textbox, accNoTextbox, codeTextbox };

            //Clear textboxes
            for (int i = 0; i < infoBoxArr.Length; i++)
            {
                infoBoxArr[i].Text = "";
            }

            //Delete lbitem
            //passwords
            if (CategoryListbox.SelectedIndex == 0)
            {
                NewPassword.Remove((Passwords)AccountListBox.SelectedItem);

                var query = conn.Query <Passwords>(
                    "SELECT * FROM Passwords ORDER BY Passwords.Account ASC;");

                int counter = 0;


                foreach (var item in query)
                {
                    if (counter == AccountListBox.SelectedIndex)
                    {
                        conn.Delete <Passwords>(
                            "DELETE FROM Passwords WHERE Passwords.Account = " + item.Account + ";");
                    }
                    counter++;
                }
            }
            //mail
            else if (CategoryListbox.SelectedIndex == 1)
            {
                NewPassword.Remove((Passwords)AccountListBox.SelectedItem);
            }
            //wallet
            else if (CategoryListbox.SelectedIndex == 2)
            {
                NewPassword.Remove((Passwords)AccountListBox.SelectedItem);
            }
        }
Exemple #11
0
 public int DeleteUser(Lugars i)
 {
     return(db.Delete(i));
 }
Exemple #12
0
 public void Delete(Comic comic)
 {
     _conexao.Delete(comic);
 }
Exemple #13
0
 public void Delete <T>(object objeto)
 {
     _conexao.Delete(objeto);
 }
Exemple #14
0
 /// <summary>
 /// 必须有PK
 /// </summary>
 /// <param name="target"></param>
 public void DeleteOne(T target)
 {
     db.Delete(target);
 }
 public void Remover(Usuario usuario)
 {
     _connection.Delete(usuario);
 }
 public void Delete(ProdutoCompra produtoCompra)
 {
     _conexao.Delete(produtoCompra);
 }
Exemple #17
0
 public void Delete(Contato contato)
 {
     _conexao.Delete(contato);
 }