Exemple #1
0
        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();
            }
        }