private void AddGuestButton_Click(object sender, EventArgs e) { if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(3); foreach (Control control in GuestCreationPanel.Controls) { if (control is TextBox && control.Text == "") { (control as CampingTextBox).Flicker(); } } } else { Guest guest = DAL.Instance.CreateGuest(FirstNameTextBox.Text, LastNameTextBox.Text, DateOfBirthPicker.Value); guests.Add(guest); ListViewItem item = new ListViewItem(new string[] { guest.GetFullName(), guest.Age.ToString() }); this.CurrentGuests.Items.Add(item); FirstNameTextBox.Text = ""; LastNameTextBox.Text = ""; DateOfBirthPicker.Value = DateTime.Today.AddYears(-DAL.Instance.AverageAge); } }
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(); } }
private void SaveButton_Click(object sender, EventArgs e) { if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "" || EmailTextBox.Text == "" || CityTextBox.Text == "" || StreetNameTextBox.Text == "" || ZipCodeTextBox.Text == "") { WarningLabel.DissapearAfterSeconds(2); FirstNameTextBox.FlickerIfEmpty(); LastNameTextBox.FlickerIfEmpty(); EmailTextBox.FlickerIfEmpty(); CityTextBox.FlickerIfEmpty(); StreetNameTextBox.FlickerIfEmpty(); ZipCodeTextBox.FlickerIfEmpty(); } else { //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image); //Place place = (Place)PlacesComboBox.SelectedItem; if (FirstNameTextBox.Text != customer.FirstName) { customer.FirstName = FirstNameTextBox.Text; } if (LastNameTextBox.Text != customer.LastName) { customer.LastName = LastNameTextBox.Text; } if (EmailTextBox.Text != customer.Email) { customer.Email = EmailTextBox.Text; } if (CityTextBox.Text != customer.City) { customer.City = CityTextBox.Text; } if (StreetNameTextBox.Text != customer.Street) { customer.Street = StreetNameTextBox.Text; } if (ZipCodeTextBox.Text != customer.ZipCode) { customer.ZipCode = ZipCodeTextBox.Text; } if (DateOfBirthPicker.Value != customer.DateOfBirth) { customer.DateOfBirth = DateOfBirthPicker.Value; } this.Close(); } }
private void OkButton_Click(object sender, EventArgs e) { if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "" || EmailTextBox.Text == "" || CityTextBox.Text == "" || StreetNameTextBox.Text == "" || ZipCodeTextBox.Text == "") { WarningLabel.Visible = true; WarningLabel.DissapearAfterSeconds(3); foreach (Control control in AccountCreationPanel.Controls) { if (control is TextBox && control.Text == "") { (control as CampingTextBox).Flicker(2); } } } else { DAL.Instance.CreateCustomer( FirstNameTextBox.Text, LastNameTextBox.Text, DateOfBirthPicker.Value, EmailTextBox.Text, CityTextBox.Text, (int)HouseNumber.Value, ZipCodeTextBox.Text, StreetNameTextBox.Text); ResetAccountCreation(); AccountCreatedLabel.DissapearAfterSeconds(4); RefreshAccountList(); } }