private void Remove_Click(object sender, EventArgs e) { Car c = new PAIN_Forms.Car( int.Parse(listView1.SelectedItems[0].Name), String.Empty, 0, 0, CarType.Personal ); parent.DeleteCar(c); }
private void Remove_Click(object sender, EventArgs e) { Car c = new PAIN_Forms.Car( int.Parse(IdTextBox.Text), BrandTextBox.Text, int.Parse(MaxVelocityTextBox.Text), int.Parse(ProdYearTextBox.Text), chooser.choosedType ); parent.DeleteCar(c); this.Close(); }
private void button1_Click(object sender, EventArgs e) { BrandTextBox_Validated(null, null); ProdYearTextBox_Validated(null, null); MaxVelocityTextBox_Validated(null, null); if ( errorProvider1.GetError(BrandTextBox) == String.Empty && errorProvider1.GetError(ProdYearTextBox) == String.Empty && errorProvider1.GetError(MaxVelocityTextBox) == String.Empty ) { Car c = new PAIN_Forms.Car( 0, BrandTextBox.Text, int.Parse(MaxVelocityTextBox.Text), int.Parse(ProdYearTextBox.Text), chooser.choosedType ); parent.AddCar(c); this.Close(); } }