void prepareCarForEdit(Guid id) { carToEdit = carshop_db.Instance.Cars.Single(x => x.id.Equals(id)); textBoxCount.Text = carToEdit.quantity.ToString(); textBoxCreationDate.Text = carToEdit.creationDate.ToString(); textBoxMarka.Text = carToEdit.marka; textBoxModel.Text = carToEdit.model; textBoxPrice.Text = carToEdit.price.ToString(); richTextBoxDescription.Text = carToEdit.description; comboBoxCategory.SelectedIndex = comboBoxCategory.FindStringExact(carToEdit.Category.name); edit = true; }
private void buttonCancelEdit_Click(object sender, EventArgs e) { edit = false; carToEdit = null; clear(); buttonCancelEdit.Visible = false; }