Example #1
0
        private void CompareButton_Click(object sender, EventArgs e)
        {
            /*Creating a listed object to send to the compare form.*/
            Listed list = new Listed();

            list = list.DefaultForm1ToLoad();
            Listed list2 = new Listed();

            list2 = list.DefaultForm1ToLoad();
            this.Hide();
            Compare compareCar = new Compare(list, list2);

            compareCar.Closed += (s, args) => this.Close();
            compareCar.Show();
        }
Example #2
0
        private void AddCarButton_Click(object sender, EventArgs e)
        {
            Listed list = new Listed();

            list = list.DefaultForm1ToLoad();
            this.Hide();
            Form1 addCar = new Form1(list);

            addCar.Closed += (s, args) => this.Close();
            addCar.Show();
        }
Example #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Listed list = new Listed();

            list.DefaultForm1ToLoad();

            //loading a car from the database.
            LoadCar           load       = new LoadCar();
            IEnumerable <Car> loadedCars = load.Load();

            //if the car is null then there was no saved car.
            if (loadedCars.Count() == 0)
            {
                Application.Run(new Form1(list));
            }
            else
            {
                Application.Run(new Overview());
            }
        }