private async void LoadButton_Click(object sender, RoutedEventArgs e) { SimpleAppointment appointment = (await AzureMobileServicesHelper.GetDataFromAzureMobileSvc()).FirstOrDefault(); SubjectTextBox.Text = appointment.Subject; LocationTextBox.Text = appointment.Location; StartDatePicker.Date = appointment.StartDate; EndDatePicker.Date = appointment.EndDate; }
private void SaveButton_Click(object sender, RoutedEventArgs e) { try { AzureMobileServicesHelper.InsertDataFromAzureMobileSvc(new SimpleAppointment { Subject = SubjectTextBox.Text, Location = LocationTextBox.Text, StartDate = StartDatePicker.Date.Date, EndDate = EndDatePicker.Date.Date }); ResultTextBlock.Text = "Appointment saved!"; } catch (Exception ex) { ResultTextBlock.Text = ex.Message; } }