Exemplo n.º 1
0
        public void updateVehicle(Vehicle v)
        {
            ModifyElementForm form = new ModifyElementForm(v);

            if (form.ShowDialog() == DialogResult.OK)
            {
                v.SetValues(form.CarMake, form.TopSpeed, form.date, form.Type);
                foreach (View view in views)
                {
                    view.updateItem(v);
                }
            }
        }
Exemplo n.º 2
0
        public void addVehicle()
        {
            ModifyElementForm form = new ModifyElementForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                Vehicle v = new Vehicle(form.CarMake, form.TopSpeed, form.date, form.Type);
                foreach (View view in views)
                {
                    view.addItem(v);
                }
                model.Add(v);
            }
        }