private void btnUpdateInformation_Click(object sender, EventArgs e) { try { subscriber = subscriberBLL.Get(int.Parse(txtMemberID.Text)); subscriber.Name = txtFirstName.Text; subscriber.LastName = txtLastName.Text; subscriber.Address = txtFullAddress.Text; subscriber.Birthday = dtPickerBirthdate.Value; subscriber.PersonalNo = txtPersonalNumber.Text; subscriber.Email = txtEmail.Text; subscriber.PhoneNo = txtPhoneNumber.Text; subscriber.IsActive = true; subscriber.UpdBy = FormLoggedUser.Id; if (radioMale.Checked) { subscriber.Gender = 'M'; } else { subscriber.Gender = 'F'; } SubscriberValidation subscriberValidator = new SubscriberValidation(); subscriberValidator.subscriber = subscriber; subscriberValidator.ValidateSubscriber(); ValidationResult results = subscriberValidator.Validate(subscriber); if (results.IsValid == false) { foreach (ValidationFailure failure in results.Errors) { MessageBox.Show($"{failure.ErrorMessage}", "Error Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { subscriberBLL.Update(subscriber); MessageBox.Show("The information of subscriber is updated successfully!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }