private void Add_Click(object sender, RoutedEventArgs e)
 {
     edw = new EditWindow(s);
     if (edw.ShowDialog() == true)
     {
         UpdateTable();
     }
 }
        private void Edit_Click(object sender, RoutedEventArgs e)
        {
            DataRowView row = dataGrid.SelectedItem as DataRowView;

            if (row != null)
            {
                int        value = int.Parse(row.Row.ItemArray[0].ToString());
                DetCarInfo sc    = s.GetSavedCar(value);
                if (sc != null)
                {
                    edw = new EditWindow(s, sc);
                    if (edw.ShowDialog() == true)
                    {
                        UpdateTable();
                    }
                }
            }
        }