private void SubmitForm_OnClick(object sender, EventArgs e) { bool bChecked = false; RadioButton rbChecked = null; foreach (Control control in Notifications_Panel.Controls) { if ((control as RadioButton).Checked) { rbChecked = control as RadioButton; bChecked = true; } } if (String.IsNullOrEmpty(Username_TextBox.Text) || !bChecked) { Error_TextBox.Show(); } else { AppSetting.eNotificationsLevel notificationsLevel = getNotificationLevel(rbChecked); AppSetting.eInterset interest = getInterest(Interests_ComboBox.Text); Error_TextBox.Hide(); AppSetting appSetting = new AppSetting(Username_TextBox.Text, LunceTime_TimePicker.Value, DinnerTime_TimePicker.Value, FriendlyTime_TimePicker.Value, interest, notificationsLevel); appSetting.SaveToFile(); this.formDashboard.appSetting = appSetting; this.formDashboard.Show(); this.Hide(); } }
public FormFirstEntry(FormDashboard formDashboard) { this.formDashboard = formDashboard; InitializeComponent(); Error_TextBox.Hide(); setTimePickers(LunceTime_TimePicker); setTimePickers(DinnerTime_TimePicker); setTimePickers(FriendlyTime_TimePicker); }