Exemplo n.º 1
0
        private void BackButton_Click(object sender, EventArgs e)
        {
            if (vehicleNeedServicing.GetType() == typeof(Car))
            {
                foreach (var car in this.manager.GetListVehicle("car"))
                {
                    if (car.IdVehicle == vehicleNeedServicing.IdVehicle)
                    {
                        car.GetServiceHistory = this.serviceLog;
                        break;
                    }
                }
            }
            else if (vehicleNeedServicing.GetType() == typeof(Truck))
            {
                foreach (var truck in this.manager.GetListVehicle("truck"))
                {
                    if (truck.IdVehicle == vehicleNeedServicing.IdVehicle)
                    {
                        truck.GetServiceHistory = this.serviceLog;
                        break;
                    }
                }
            }
            Form formManage = new FormVehicleListService(this.manager);

            serviceLog.RemoveObserver(this);
            var thread = new Thread(() => Program.Start(formManage));

            thread.Start();
            this.Close();
        }
Exemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            FormVehicleListService formManage = new FormVehicleListService(manage);
            var thread = new Thread(() => Program.Start(formManage));

            thread.Start();
            this.Close();
        }