Пример #1
0
 private void deleteButton_Click(object sender, RoutedEventArgs e)
 {
     if (fuelGrid.SelectedItems.Count > 0)
     {
         for (int i = 0; i < fuelGrid.SelectedItems.Count; i++)
         {
             FUEL fuel = fuelGrid.SelectedItems[i] as FUEL;
             if (fuel != null)
             {
                 db.fuels.Remove(fuel);
             }
         }
     }
     db.SaveChanges();
 }
Пример #2
0
        private void chooseButton_Click(object sender, RoutedEventArgs e)
        {
            if (fuelGrid.SelectedItems.Count != 0)
            {
                for (int i = 0; i < fuelGrid.SelectedItems.Count; i++)
                {
                    FUEL fuel = fuelGrid.SelectedItems[i] as FUEL;
                    if (fuel != null)
                    {
                        FN    = fuel.FuelName;
                        Price = fuel.FuelPrice;
                    }
                }
            }

            QuantityWindow QW = new QuantityWindow(FN, Price, UserName);

            QW.ShowDialog();
        }