public string M_GCityCar()
        {
            Fuelbook Car       = new Fuelbook();
            Car      ReturnCar = new Car();

            Car.Area_City = 0;
            foreach (var Note in DB.FuelDb)
            {
                if (DB.ReturnPlates(DB.ReturnLastEntry().DisplayName).Contains(Note.PlateNumber))
                {
                    if (Car.Area_City < Note.Area_City)
                    {
                        Car = Note;
                    }
                }
            }

            foreach (var Note in DB.CarDb)
            {
                if (Note.PlateNumber == Car.PlateNumber)
                {
                    ReturnCar = Note;
                }
            }
            return(ReturnCar.Year + " " + ReturnCar.Manufacturer + " " + ReturnCar.Model + $" {Car.Area_City}%");
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (TryParse(_Price.Text) == true && TryParse(_Litres.Text) == true && TryParse(_Cost.Text) == true && TryParse(_Consumption.Text) == true && TryParse(_Distance.Text) == true && TryParse(_Area_City.Text) == true && TryParse(_Area_Open.Text) == true)
     {
         Fuelbook FuelNote = new Fuelbook(DB.ReturnLastEntry().PlateNumber, _Description.Text, decimal.Parse(_Cost.Text), decimal.Parse(_Price.Text), decimal.Parse(_Litres.Text), decimal.Parse(_Distance.Text), decimal.Parse(_Consumption.Text), decimal.Parse(_Area_City.Text), decimal.Parse(_Area_Open.Text));
         FuelNote.SaveToDb(DB);
         TextBlock Info = new TextBlock();
         Info.Text = $"Dodano notatkę. \nOpis: {FuelNote.Description}\nDolano Litrów: {FuelNote.Litres}L\nPrzejechany dystans: {FuelNote.Distance}km\nCena tankowania: {FuelNote.Price}zł\nKoszt paliwa: {FuelNote.Cost}PLN/L\nPrzeciętne spalanie: {FuelNote.Consumption}L/100km\nCykl jazdy: \n\t{FuelNote.Area_City}% w zabudowanym, \n\t{FuelNote.Area_Open}% w trasie\n";
         _Info.Children.Add(Info);
     }
     else
     {
         MessageBox.Show("Nie wszystkie rubryki zostały wypełnione lub dane są niepoprawne");
         _Price.Text       = "";
         _Litres.Text      = "";
         _Cost.Text        = "";
         _Consumption.Text = "";
         _Distance.Text    = "";
         _Area_City.Text   = "";
         _Area_Open.Text   = "";
     }
 }