private void GenerateAssignments(object sender, RoutedEventArgs e) { bool assignGifts = this.comboBox.Text.Equals("Yes") ? true : false; if (this.checkBox.IsVisible) { assignGifts = this.checkBox.IsChecked.Value; } string errorMessage = GiftManager.GenerateAssignments(assignGifts); if (!string.IsNullOrEmpty(errorMessage)) { MessageBox.Show(errorMessage); return; } this.UpdateList(); }