Ejemplo n.º 1
0
 private void acceptButton_Click(object sender, RoutedEventArgs e)
 {
     {
         MessageBox.Show("Действие выполнено accept");
         var query = (from d in db_bill.Bills select d).ToList();
         db_bill.Bills.RemoveRange(query);
         db_bill.SaveChanges();
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void Del_Target(object sender, RoutedEventArgs e)
        {
            if (productList.SelectedItem == null)
            {
                return;
            }
            // получаем выделенный объект
            Bill bill = productList.SelectedItem as Bill;

            db_bill.Bills.Remove(bill);
            Sum.sum       -= bill.Price;
            TextBlock.Text = Sum.sum.ToString();
            db_bill.SaveChanges();
        }