public PurchaseForm(CarSpecificationForm carSpecificationForm) { InitializeComponent(); CarSpecificationForm = carSpecificationForm; Car = carSpecificationForm.getCar(); Store = carSpecificationForm.getStore(); User = carSpecificationForm.getUser(); labelNameOfProduct.Text = Car.CarName; if (User != null) { textBoxFirstName.Text = User.FirstName; textBoxLastName.Text = User.LastName; textBoxAddress.Text = User.Address; textBoxEmail.Text = User.Email; textBoxPhoneNumber.Text = User.PhoneNumber; textBoxFirstName.Enabled = false; textBoxLastName.Enabled = false; textBoxAddress.Enabled = false; textBoxEmail.Enabled = false; textBoxPhoneNumber.Enabled = false; } }
private void buttonSpecification_Click(object sender, EventArgs e) { SelectedCar = (Car)listBoxVehicles.SelectedItem; Form carSpecificationForm = new CarSpecificationForm(this); carSpecificationForm.Show(); this.Hide(); }