private void GotMarriedBtnOnClick(object sender, EventArgs e) { if (PartnersComboBox.SelectedIndex == -1 || ( PartnersComboBox.SelectedIndex == 0 && !SourceMember.HadPartner(SinceDateTime) )) { PartnersComboBox.Focus(); return; } try { SourceMember.GotMarried( SinceDateTimePicker.Value, PartnersComboBox.SelectedIndex > 0 ? EnumerablePartners.ElementAt(PartnersComboBox.SelectedIndex - 1) : null ); UpdatePartnersListBox(); UpdateStatusesListBox(); UpdatePartnersComboBox(); UpdateButtons(); SinceDateTimePicker.Focus(); } catch (Exception ex) { if (new ValidationFailedDialog(ex.Message).ShowDialog() == DialogResult.OK) { PartnersComboBox.Focus(); } } }
private void WithPartnerBtnOnClick(object sender, EventArgs e) { if (PartnersComboBox.SelectedIndex < 1) { PartnersComboBox.Focus(); return; } try { SourceMember.WithPartner( EnumerablePartners.ElementAt(PartnersComboBox.SelectedIndex - 1), SinceDateTimePicker.Value ); UpdatePartnersListBox(); UpdatePartnersComboBox(); UpdateButtons(); SinceDateTimePicker.Focus(); } catch (Exception ex) { if (new ValidationFailedDialog(ex.Message).ShowDialog() == DialogResult.OK) { PartnersComboBox.Focus(); } } }
private void ChangedFullNameBtnOnClick(object sender, EventArgs e) { if (string.IsNullOrEmpty(FullNameTxtBox.Text)) { FullNameTxtBox.Focus(); return; } SourceMember.ChangedFullName( FullNameTxtBox.Text, SinceDateTimePicker.Value ); UpdateFullNamesListBox(); SinceDateTimePicker.Focus(); }
private void WithoutPartnerBtnOnClick(object sender, EventArgs e) { try { SourceMember.WithoutPartner(SinceDateTimePicker.Value); UpdatePartnersListBox(); UpdateStatusesListBox(); UpdatePartnersComboBox(); UpdateButtons(); } catch (Exception ex) { if (new ValidationFailedDialog(ex.Message).ShowDialog() == DialogResult.OK) { SinceDateTimePicker.Focus(); } } }