private void SaveButton_Click_1(object sender, EventArgs e) { if (NameTextBox.Text == "" || DescriptionTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(2); NameTextBox.FlickerIfEmpty(); DescriptionTextBox.FlickerIfEmpty(); } else { //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image); Place place = (Place)PlacesComboBox.SelectedItem; if (NameTextBox.Text != place.Name) { place.Name = NameTextBox.Text; } if (LuxeCheckBox.Checked != place.Luxe) { place.Luxe = LuxeCheckBox.Checked; } if (DescriptionTextBox.Text != place.Description) { place.Description = DescriptionTextBox.Text; } if (ImagePictureBox.BackgroundImage != place.Image) { place.Image = ImagePictureBox.BackgroundImage; } this.Close(); } }
private void SaveButton_Click(object sender, EventArgs e) { if (NameTextBox.Text == "" || DescriptionTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(2); NameTextBox.FlickerIfEmpty(); DescriptionTextBox.FlickerIfEmpty(); } else { DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image); this.Close(); } }