private void SubmitButton_Click(object sender, RoutedEventArgs e) { string results = String.Empty; if ((results = isValidInput()).Equals(String.Empty)) { SelectionDetail selection = new SelectionDetail() { StudentNumber = StudentNumber.Text, FirstName = FirstName.Text, LastName = LastName.Text, FirstChoice = FirstOption.SelectedValue.ToString(), SecondChoice = SecondOption.SelectedValue.ToString(), ThirdChoice = ThirdOption.SelectedValue.ToString(), FourthChoice = FourthOption.SelectedValue.ToString() }; StudentOptionsService.StudentOptionsServiceClient prxy = new StudentOptionsService.StudentOptionsServiceClient(); prxy.AddOptionSelectionCompleted += new EventHandler <AddOptionSelectionCompletedEventArgs>(prxy_AddOptionSelectionCompleted); prxy.AddOptionSelectionAsync(selection); } else { ErrorWindow ew = new ErrorWindow(results); ew.Show(); } }
public MainPage() { InitializeComponent(); StudentOptionsService.StudentOptionsServiceClient prxy = new StudentOptionsService.StudentOptionsServiceClient(); prxy.GetOptionsCompleted += new EventHandler <GetOptionsCompletedEventArgs>(prxy_GetOptionsCompleted); prxy.GetOptionsAsync(); }