private void buttonAccept_Click(object sender, EventArgs e) { if (testForInvalidValues()) { Customer c = new Customer(); c.Name = txtName.TextWithoutWatermark; c.LastName = txtLastName.TextWithoutWatermark; c.EmailAddress = txtEmail.TextWithoutWatermark; c.PhoneNumber = txtPhoneNumber.TextWithoutWatermark; c.PasswordHash = customerOld.PasswordHash; c.Birthday = DateTime.Parse(txtBirthDate.TextWithoutWatermark); c.Street = txtStreet.TextWithoutWatermark; c.HouseNumber = txtHouseNumber.TextWithoutWatermark; c.PLZ = txtPlz.TextWithoutWatermark; c.City = txtCity.TextWithoutWatermark; c.Country = txtCountry.TextWithoutWatermark; c.IsAdmin = checkAdmin.Checked; if (DBController.TryUpdateCustomer(c, customerOld.EmailAddress) == 0) { FormController.MainView.UpdateCustomersList(); Feedback.SuccessCustomersEdit(); if (FormController.CurrentCustomer.EmailAddress == customerOld.EmailAddress) { FormController.CurrentCustomer = c; } } else { Feedback.ErrorDatabaseCustomersEdit(); } ParentForm.Close(); } }